Skip to content

Commit 72bd866

Browse files
author
Al Viro
committed
fs/namei.c: don't pass nameidata to __lookup_hash() and lookup_real()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 00cd8dd commit 72bd866

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎fs/namei.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir,
10801080
* dir->d_inode->i_mutex must be held
10811081
*/
10821082
static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry,
1083-
struct nameidata *nd)
1083+
unsigned int flags)
10841084
{
10851085
struct dentry *old;
10861086

@@ -1090,7 +1090,7 @@ static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry,
10901090
return ERR_PTR(-ENOENT);
10911091
}
10921092

1093-
old = dir->i_op->lookup(dir, dentry, nd ? nd->flags : 0);
1093+
old = dir->i_op->lookup(dir, dentry, flags);
10941094
if (unlikely(old)) {
10951095
dput(dentry);
10961096
dentry = old;
@@ -1099,16 +1099,16 @@ static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry,
10991099
}
11001100

11011101
static struct dentry *__lookup_hash(struct qstr *name,
1102-
struct dentry *base, struct nameidata *nd)
1102+
struct dentry *base, unsigned int flags)
11031103
{
11041104
bool need_lookup;
11051105
struct dentry *dentry;
11061106

1107-
dentry = lookup_dcache(name, base, nd ? nd->flags : 0, &need_lookup);
1107+
dentry = lookup_dcache(name, base, flags, &need_lookup);
11081108
if (!need_lookup)
11091109
return dentry;
11101110

1111-
return lookup_real(base->d_inode, dentry, nd);
1111+
return lookup_real(base->d_inode, dentry, flags);
11121112
}
11131113

11141114
/*
@@ -1227,7 +1227,7 @@ static int lookup_slow(struct nameidata *nd, struct qstr *name,
12271227
BUG_ON(nd->inode != parent->d_inode);
12281228

12291229
mutex_lock(&parent->d_inode->i_mutex);
1230-
dentry = __lookup_hash(name, parent, nd);
1230+
dentry = __lookup_hash(name, parent, nd->flags);
12311231
mutex_unlock(&parent->d_inode->i_mutex);
12321232
if (IS_ERR(dentry))
12331233
return PTR_ERR(dentry);
@@ -1859,7 +1859,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
18591859
*/
18601860
static struct dentry *lookup_hash(struct nameidata *nd)
18611861
{
1862-
return __lookup_hash(&nd->last, nd->path.dentry, nd);
1862+
return __lookup_hash(&nd->last, nd->path.dentry, nd->flags);
18631863
}
18641864

18651865
/**
@@ -1906,7 +1906,7 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
19061906
if (err)
19071907
return ERR_PTR(err);
19081908

1909-
return __lookup_hash(&this, base, NULL);
1909+
return __lookup_hash(&this, base, 0);
19101910
}
19111911

19121912
int user_path_at_empty(int dfd, const char __user *name, unsigned flags,
@@ -2310,7 +2310,7 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
23102310

23112311
no_open:
23122312
if (need_lookup) {
2313-
dentry = lookup_real(dir, dentry, nd);
2313+
dentry = lookup_real(dir, dentry, nd->flags);
23142314
if (IS_ERR(dentry))
23152315
return PTR_ERR(dentry);
23162316

@@ -2372,7 +2372,7 @@ static int lookup_open(struct nameidata *nd, struct path *path,
23722372
if (need_lookup) {
23732373
BUG_ON(dentry->d_inode);
23742374

2375-
dentry = lookup_real(dir_inode, dentry, nd);
2375+
dentry = lookup_real(dir_inode, dentry, nd->flags);
23762376
if (IS_ERR(dentry))
23772377
return PTR_ERR(dentry);
23782378
}

0 commit comments

Comments
 (0)