diff options
-rw-r--r-- | fs/namespace.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index b696e3a0d18f..c811a94e4c88 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -320,22 +320,16 @@ EXPORT_SYMBOL(mnt_unpin); | |||
320 | static void *m_start(struct seq_file *m, loff_t *pos) | 320 | static void *m_start(struct seq_file *m, loff_t *pos) |
321 | { | 321 | { |
322 | struct mnt_namespace *n = m->private; | 322 | struct mnt_namespace *n = m->private; |
323 | struct list_head *p; | ||
324 | loff_t l = *pos; | ||
325 | 323 | ||
326 | down_read(&namespace_sem); | 324 | down_read(&namespace_sem); |
327 | list_for_each(p, &n->list) | 325 | return seq_list_start(&n->list, *pos); |
328 | if (!l--) | ||
329 | return list_entry(p, struct vfsmount, mnt_list); | ||
330 | return NULL; | ||
331 | } | 326 | } |
332 | 327 | ||
333 | static void *m_next(struct seq_file *m, void *v, loff_t *pos) | 328 | static void *m_next(struct seq_file *m, void *v, loff_t *pos) |
334 | { | 329 | { |
335 | struct mnt_namespace *n = m->private; | 330 | struct mnt_namespace *n = m->private; |
336 | struct list_head *p = ((struct vfsmount *)v)->mnt_list.next; | 331 | |
337 | (*pos)++; | 332 | return seq_list_next(v, &n->list, pos); |
338 | return p == &n->list ? NULL : list_entry(p, struct vfsmount, mnt_list); | ||
339 | } | 333 | } |
340 | 334 | ||
341 | static void m_stop(struct seq_file *m, void *v) | 335 | 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 | 344 | ||
351 | static int show_vfsmnt(struct seq_file *m, void *v) | 345 | static int show_vfsmnt(struct seq_file *m, void *v) |
352 | { | 346 | { |
353 | struct vfsmount *mnt = v; | 347 | struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); |
354 | int err = 0; | 348 | int err = 0; |
355 | static struct proc_fs_info { | 349 | static struct proc_fs_info { |
356 | int flag; | 350 | int flag; |
@@ -405,7 +399,7 @@ struct seq_operations mounts_op = { | |||
405 | 399 | ||
406 | static int show_vfsstat(struct seq_file *m, void *v) | 400 | static int show_vfsstat(struct seq_file *m, void *v) |
407 | { | 401 | { |
408 | struct vfsmount *mnt = v; | 402 | struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); |
409 | int err = 0; | 403 | int err = 0; |
410 | 404 | ||
411 | /* device */ | 405 | /* device */ |