aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-05-27 06:53:39 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-05-27 07:01:49 -0400
commitdea3937619cb67d2ad08e2d29ae923875b1eeee9 (patch)
treed4c4e3ed44cff625f6d2730c2288961922357ba2 /fs/namei.c
parent287548e46aa752ce9bb87fcff46f8aa794cc5037 (diff)
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: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/fs/namei.c b/fs/namei.c
index da9c26578663..988081424098 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -951,29 +951,21 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
951 return true; 951 return true;
952} 952}
953 953
954static void follow_mount_rcu(struct nameidata *nd, struct path *path, 954static void follow_mount_rcu(struct nameidata *nd)
955 struct inode **inode)
956{ 955{
957 for (;;) { 956 while (d_mountpoint(nd->path.dentry)) {
958 struct vfsmount *mounted; 957 struct vfsmount *mounted;
959 *inode = path->dentry->d_inode; 958 mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry, 1);
960
961 if (!d_mountpoint(path->dentry))
962 break;
963
964 mounted = __lookup_mnt(path->mnt, path->dentry, 1);
965 if (!mounted) 959 if (!mounted)
966 break; 960 break;
967 path->mnt = mounted; 961 nd->path.mnt = mounted;
968 path->dentry = mounted->mnt_root; 962 nd->path.dentry = mounted->mnt_root;
969 nd->seq = read_seqcount_begin(&path->dentry->d_seq); 963 nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
970 } 964 }
971} 965}
972 966
973static int follow_dotdot_rcu(struct nameidata *nd) 967static int follow_dotdot_rcu(struct nameidata *nd)
974{ 968{
975 struct inode *inode = nd->inode;
976
977 set_root_rcu(nd); 969 set_root_rcu(nd);
978 970
979 while (1) { 971 while (1) {
@@ -989,7 +981,6 @@ static int follow_dotdot_rcu(struct nameidata *nd)
989 seq = read_seqcount_begin(&parent->d_seq); 981 seq = read_seqcount_begin(&parent->d_seq);
990 if (read_seqcount_retry(&old->d_seq, nd->seq)) 982 if (read_seqcount_retry(&old->d_seq, nd->seq))
991 goto failed; 983 goto failed;
992 inode = parent->d_inode;
993 nd->path.dentry = parent; 984 nd->path.dentry = parent;
994 nd->seq = seq; 985 nd->seq = seq;
995 break; 986 break;
@@ -997,10 +988,9 @@ static int follow_dotdot_rcu(struct nameidata *nd)
997 if (!follow_up_rcu(&nd->path)) 988 if (!follow_up_rcu(&nd->path))
998 break; 989 break;
999 nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); 990 nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
1000 inode = nd->path.dentry->d_inode;
1001 } 991 }
1002 follow_mount_rcu(nd, &nd->path, &inode); 992 follow_mount_rcu(nd);
1003 nd->inode = inode; 993 nd->inode = nd->path.dentry->d_inode;
1004 return 0; 994 return 0;
1005 995
1006failed: 996failed: