Skip to content

Commit

Permalink
vfs: cleanup show_mountinfo
Browse files Browse the repository at this point in the history
Starting with commit v3.2-rc4-1-g02125a8, seq_path_root() no longer
changes the value of its "struct path *root" argument.
Starting with commit v3.2-rc7-104-g8c9379e, the "struct path *root"
argument of seq_path_root() is const.
As result, the temporary variable "root" in show_mountinfo() that
holds a copy of struct path root is no longer needed.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Dmitry V. Levin authored and Al Viro committed Dec 17, 2014
1 parent 1097593 commit 9ad4dc4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/proc_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
struct mount *r = real_mount(mnt);
struct super_block *sb = mnt->mnt_sb;
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
struct path root = p->root;
int err = 0;

seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id,
Expand All @@ -139,7 +138,7 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
seq_putc(m, ' ');

/* mountpoints outside of chroot jail will give SEQ_SKIP on this */
err = seq_path_root(m, &mnt_path, &root, " \t\n\\");
err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\");
if (err)
goto out;

Expand Down

0 comments on commit 9ad4dc4

Please sign in to comment.