diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-10 17:17:17 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:34:40 -0400 |
commit | 72bd866a01fc62ccbc466f3eb7599b14c937e96b (patch) | |
tree | 05a6e0db9d20d90d4bccbe9184ee28080b4614ec | |
parent | 00cd8dd3bf95f2cc8435b4cac01d9995635c6d0b (diff) |
fs/namei.c: don't pass nameidata to __lookup_hash() and lookup_real()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/namei.c b/fs/namei.c index 175e81b8f261..fc01090a96c1 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1080,7 +1080,7 @@ static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir, | |||
1080 | * dir->d_inode->i_mutex must be held | 1080 | * dir->d_inode->i_mutex must be held |
1081 | */ | 1081 | */ |
1082 | static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry, | 1082 | static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry, |
1083 | struct nameidata *nd) | 1083 | unsigned int flags) |
1084 | { | 1084 | { |
1085 | struct dentry *old; | 1085 | struct dentry *old; |
1086 | 1086 | ||
@@ -1090,7 +1090,7 @@ static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry, | |||
1090 | return ERR_PTR(-ENOENT); | 1090 | return ERR_PTR(-ENOENT); |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | old = dir->i_op->lookup(dir, dentry, nd ? nd->flags : 0); | 1093 | old = dir->i_op->lookup(dir, dentry, flags); |
1094 | if (unlikely(old)) { | 1094 | if (unlikely(old)) { |
1095 | dput(dentry); | 1095 | dput(dentry); |
1096 | dentry = old; | 1096 | dentry = old; |
@@ -1099,16 +1099,16 @@ static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry, | |||
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | static struct dentry *__lookup_hash(struct qstr *name, | 1101 | static struct dentry *__lookup_hash(struct qstr *name, |
1102 | struct dentry *base, struct nameidata *nd) | 1102 | struct dentry *base, unsigned int flags) |
1103 | { | 1103 | { |
1104 | bool need_lookup; | 1104 | bool need_lookup; |
1105 | struct dentry *dentry; | 1105 | struct dentry *dentry; |
1106 | 1106 | ||
1107 | dentry = lookup_dcache(name, base, nd ? nd->flags : 0, &need_lookup); | 1107 | dentry = lookup_dcache(name, base, flags, &need_lookup); |
1108 | if (!need_lookup) | 1108 | if (!need_lookup) |
1109 | return dentry; | 1109 | return dentry; |
1110 | 1110 | ||
1111 | return lookup_real(base->d_inode, dentry, nd); | 1111 | return lookup_real(base->d_inode, dentry, flags); |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | /* | 1114 | /* |
@@ -1227,7 +1227,7 @@ static int lookup_slow(struct nameidata *nd, struct qstr *name, | |||
1227 | BUG_ON(nd->inode != parent->d_inode); | 1227 | BUG_ON(nd->inode != parent->d_inode); |
1228 | 1228 | ||
1229 | mutex_lock(&parent->d_inode->i_mutex); | 1229 | mutex_lock(&parent->d_inode->i_mutex); |
1230 | dentry = __lookup_hash(name, parent, nd); | 1230 | dentry = __lookup_hash(name, parent, nd->flags); |
1231 | mutex_unlock(&parent->d_inode->i_mutex); | 1231 | mutex_unlock(&parent->d_inode->i_mutex); |
1232 | if (IS_ERR(dentry)) | 1232 | if (IS_ERR(dentry)) |
1233 | return PTR_ERR(dentry); | 1233 | return PTR_ERR(dentry); |
@@ -1859,7 +1859,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt, | |||
1859 | */ | 1859 | */ |
1860 | static struct dentry *lookup_hash(struct nameidata *nd) | 1860 | static struct dentry *lookup_hash(struct nameidata *nd) |
1861 | { | 1861 | { |
1862 | return __lookup_hash(&nd->last, nd->path.dentry, nd); | 1862 | return __lookup_hash(&nd->last, nd->path.dentry, nd->flags); |
1863 | } | 1863 | } |
1864 | 1864 | ||
1865 | /** | 1865 | /** |
@@ -1906,7 +1906,7 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) | |||
1906 | if (err) | 1906 | if (err) |
1907 | return ERR_PTR(err); | 1907 | return ERR_PTR(err); |
1908 | 1908 | ||
1909 | return __lookup_hash(&this, base, NULL); | 1909 | return __lookup_hash(&this, base, 0); |
1910 | } | 1910 | } |
1911 | 1911 | ||
1912 | int user_path_at_empty(int dfd, const char __user *name, unsigned flags, | 1912 | int user_path_at_empty(int dfd, const char __user *name, unsigned flags, |
@@ -2310,7 +2310,7 @@ out: | |||
2310 | 2310 | ||
2311 | no_open: | 2311 | no_open: |
2312 | if (need_lookup) { | 2312 | if (need_lookup) { |
2313 | dentry = lookup_real(dir, dentry, nd); | 2313 | dentry = lookup_real(dir, dentry, nd->flags); |
2314 | if (IS_ERR(dentry)) | 2314 | if (IS_ERR(dentry)) |
2315 | return PTR_ERR(dentry); | 2315 | return PTR_ERR(dentry); |
2316 | 2316 | ||
@@ -2372,7 +2372,7 @@ static int lookup_open(struct nameidata *nd, struct path *path, | |||
2372 | if (need_lookup) { | 2372 | if (need_lookup) { |
2373 | BUG_ON(dentry->d_inode); | 2373 | BUG_ON(dentry->d_inode); |
2374 | 2374 | ||
2375 | dentry = lookup_real(dir_inode, dentry, nd); | 2375 | dentry = lookup_real(dir_inode, dentry, nd->flags); |
2376 | if (IS_ERR(dentry)) | 2376 | if (IS_ERR(dentry)) |
2377 | return PTR_ERR(dentry); | 2377 | return PTR_ERR(dentry); |
2378 | } | 2378 | } |