summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Emelianov <xemul@sw.ru>2007-07-15 23:39:55 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 09:05:42 -0700
commitb0765fb85782da9dca98482ebb1ae0d8c1a5e0f7 (patch)
treedc39cd14661fa878bac146232b7f4ded3b257629
parent25216b00395dfb52bfe06e4886a6ad831ede7b4b (diff)
downloadlinux-3.10-b0765fb85782da9dca98482ebb1ae0d8c1a5e0f7.tar.gz
linux-3.10-b0765fb85782da9dca98482ebb1ae0d8c1a5e0f7.tar.bz2
linux-3.10-b0765fb85782da9dca98482ebb1ae0d8c1a5e0f7.zip
Make /proc/self/mounts(tats) use seq_list_xxx helpers
One more simple and stupid switching to the new API. Signed-off-by: Pavel Emelianov <xemul@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/namespace.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index b696e3a0d18..c811a94e4c8 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -320,22 +320,16 @@ EXPORT_SYMBOL(mnt_unpin);
static void *m_start(struct seq_file *m, loff_t *pos)
{
struct mnt_namespace *n = m->private;
- struct list_head *p;
- loff_t l = *pos;
down_read(&namespace_sem);
- list_for_each(p, &n->list)
- if (!l--)
- return list_entry(p, struct vfsmount, mnt_list);
- return NULL;
+ return seq_list_start(&n->list, *pos);
}
static void *m_next(struct seq_file *m, void *v, loff_t *pos)
{
struct mnt_namespace *n = m->private;
- struct list_head *p = ((struct vfsmount *)v)->mnt_list.next;
- (*pos)++;
- return p == &n->list ? NULL : list_entry(p, struct vfsmount, mnt_list);
+
+ return seq_list_next(v, &n->list, pos);
}
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)
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;
static struct proc_fs_info {
int flag;
@@ -405,7 +399,7 @@ struct seq_operations mounts_op = {
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;
/* device */