Commit dea39376 authored by Al Viro's avatar Al Viro

Trim excessive arguments of follow_mount_rcu()

... and kill a useless local variable in follow_dotdot_rcu(), while
we are at it - follow_mount_rcu(nd, path, inode) *always* assigned
value to *inode, and always it had been path->dentry->d_inode (aka
nd->path.dentry->d_inode, since it always got &nd->path as the second
argument).
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 287548e4
...@@ -951,29 +951,21 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path, ...@@ -951,29 +951,21 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
return true; return true;
} }
static void follow_mount_rcu(struct nameidata *nd, struct path *path, static void follow_mount_rcu(struct nameidata *nd)
struct inode **inode)
{ {
for (;;) { while (d_mountpoint(nd->path.dentry)) {
struct vfsmount *mounted; struct vfsmount *mounted;
*inode = path->dentry->d_inode; mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry, 1);
if (!d_mountpoint(path->dentry))
break;
mounted = __lookup_mnt(path->mnt, path->dentry, 1);
if (!mounted) if (!mounted)
break; break;
path->mnt = mounted; nd->path.mnt = mounted;
path->dentry = mounted->mnt_root; nd->path.dentry = mounted->mnt_root;
nd->seq = read_seqcount_begin(&path->dentry->d_seq); nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
} }
} }
static int follow_dotdot_rcu(struct nameidata *nd) static int follow_dotdot_rcu(struct nameidata *nd)
{ {
struct inode *inode = nd->inode;
set_root_rcu(nd); set_root_rcu(nd);
while (1) { while (1) {
...@@ -989,7 +981,6 @@ static int follow_dotdot_rcu(struct nameidata *nd) ...@@ -989,7 +981,6 @@ static int follow_dotdot_rcu(struct nameidata *nd)
seq = read_seqcount_begin(&parent->d_seq); seq = read_seqcount_begin(&parent->d_seq);
if (read_seqcount_retry(&old->d_seq, nd->seq)) if (read_seqcount_retry(&old->d_seq, nd->seq))
goto failed; goto failed;
inode = parent->d_inode;
nd->path.dentry = parent; nd->path.dentry = parent;
nd->seq = seq; nd->seq = seq;
break; break;
...@@ -997,10 +988,9 @@ static int follow_dotdot_rcu(struct nameidata *nd) ...@@ -997,10 +988,9 @@ static int follow_dotdot_rcu(struct nameidata *nd)
if (!follow_up_rcu(&nd->path)) if (!follow_up_rcu(&nd->path))
break; break;
nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
inode = nd->path.dentry->d_inode;
} }
follow_mount_rcu(nd, &nd->path, &inode); follow_mount_rcu(nd);
nd->inode = inode; nd->inode = nd->path.dentry->d_inode;
return 0; return 0;
failed: failed:
......
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