Commit b0765fb8 authored by Pavel Emelianov's avatar Pavel Emelianov Committed by Linus Torvalds

Make /proc/self/mounts(tats) use seq_list_xxx helpers

One more simple and stupid switching to the new API.
Signed-off-by: default avatarPavel Emelianov <xemul@openvz.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 25216b00
...@@ -320,22 +320,16 @@ EXPORT_SYMBOL(mnt_unpin); ...@@ -320,22 +320,16 @@ EXPORT_SYMBOL(mnt_unpin);
static void *m_start(struct seq_file *m, loff_t *pos) static void *m_start(struct seq_file *m, loff_t *pos)
{ {
struct mnt_namespace *n = m->private; struct mnt_namespace *n = m->private;
struct list_head *p;
loff_t l = *pos;
down_read(&namespace_sem); down_read(&namespace_sem);
list_for_each(p, &n->list) return seq_list_start(&n->list, *pos);
if (!l--)
return list_entry(p, struct vfsmount, mnt_list);
return NULL;
} }
static void *m_next(struct seq_file *m, void *v, loff_t *pos) static void *m_next(struct seq_file *m, void *v, loff_t *pos)
{ {
struct mnt_namespace *n = m->private; struct mnt_namespace *n = m->private;
struct list_head *p = ((struct vfsmount *)v)->mnt_list.next;
(*pos)++; return seq_list_next(v, &n->list, pos);
return p == &n->list ? NULL : list_entry(p, struct vfsmount, mnt_list);
} }
static void m_stop(struct seq_file *m, void *v) static void m_stop(struct seq_file *m, void *v)
...@@ -350,7 +344,7 @@ static inline void mangle(struct seq_file *m, const char *s) ...@@ -350,7 +344,7 @@ static inline void mangle(struct seq_file *m, const char *s)
static int show_vfsmnt(struct seq_file *m, void *v) static int show_vfsmnt(struct seq_file *m, void *v)
{ {
struct vfsmount *mnt = v; struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
int err = 0; int err = 0;
static struct proc_fs_info { static struct proc_fs_info {
int flag; int flag;
...@@ -405,7 +399,7 @@ struct seq_operations mounts_op = { ...@@ -405,7 +399,7 @@ struct seq_operations mounts_op = {
static int show_vfsstat(struct seq_file *m, void *v) static int show_vfsstat(struct seq_file *m, void *v)
{ {
struct vfsmount *mnt = v; struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
int err = 0; int err = 0;
/* device */ /* device */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment