Skip to content

Commit 00cd8dd

Browse files
author
Al Viro
committed
stop passing nameidata to ->lookup()
Just the flags; only NFS cares even about that, but there are legitimate uses for such argument. And getting rid of that completely would require splitting ->lookup() into a couple of methods (at least), so let's leave that alone for now... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 201f956 commit 00cd8dd

79 files changed

Lines changed: 115 additions & 114 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/filesystems/Locking‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ d_manage: no no yes (ref-walk) maybe
3838
--------------------------- inode_operations ---------------------------
3939
prototypes:
4040
int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *);
41-
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid
42-
ata *);
41+
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
4342
int (*link) (struct dentry *,struct inode *,struct dentry *);
4443
int (*unlink) (struct inode *,struct dentry *);
4544
int (*symlink) (struct inode *,struct dentry *,const char *);

‎Documentation/filesystems/porting‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,5 +434,5 @@ d_make_root() drops the reference to inode if dentry allocation fails.
434434

435435
--
436436
[mandatory]
437-
The witch is dead! Well, 1/3 of it, anyway. ->d_revalidate() does *not*
438-
take struct nameidata anymore; just the flags.
437+
The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and
438+
->lookup() do *not* take struct nameidata anymore; just the flags.

‎Documentation/filesystems/vfs.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ filesystem. As of kernel 2.6.22, the following members are defined:
342342

343343
struct inode_operations {
344344
int (*create) (struct inode *,struct dentry *, umode_t, struct nameidata *);
345-
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
345+
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
346346
int (*link) (struct dentry *,struct inode *,struct dentry *);
347347
int (*unlink) (struct inode *,struct dentry *);
348348
int (*symlink) (struct inode *,struct dentry *,const char *);

‎fs/9p/v9fs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ extern void v9fs_session_close(struct v9fs_session_info *v9ses);
144144
extern void v9fs_session_cancel(struct v9fs_session_info *v9ses);
145145
extern void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses);
146146
extern struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
147-
struct nameidata *nameidata);
147+
unsigned int flags);
148148
extern int v9fs_vfs_unlink(struct inode *i, struct dentry *d);
149149
extern int v9fs_vfs_rmdir(struct inode *i, struct dentry *d);
150150
extern int v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,

‎fs/9p/vfs_inode.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
785785
*/
786786

787787
struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
788-
struct nameidata *nameidata)
788+
unsigned int flags)
789789
{
790790
struct dentry *res;
791791
struct super_block *sb;
@@ -795,8 +795,8 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
795795
char *name;
796796
int result = 0;
797797

798-
p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n",
799-
dir, dentry->d_name.name, dentry, nameidata);
798+
p9_debug(P9_DEBUG_VFS, "dir: %p dentry: (%s) %p flags: %x\n",
799+
dir, dentry->d_name.name, dentry, flags);
800800

801801
if (dentry->d_name.len > NAME_MAX)
802802
return ERR_PTR(-ENAMETOOLONG);
@@ -869,7 +869,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
869869
struct dentry *res = NULL;
870870

871871
if (d_unhashed(dentry)) {
872-
res = v9fs_vfs_lookup(dir, dentry, NULL);
872+
res = v9fs_vfs_lookup(dir, dentry, 0);
873873
if (IS_ERR(res))
874874
return PTR_ERR(res);
875875

‎fs/9p/vfs_inode_dotl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
259259
struct dentry *res = NULL;
260260

261261
if (d_unhashed(dentry)) {
262-
res = v9fs_vfs_lookup(dir, dentry, NULL);
262+
res = v9fs_vfs_lookup(dir, dentry, 0);
263263
if (IS_ERR(res))
264264
return PTR_ERR(res);
265265

‎fs/adfs/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ const struct dentry_operations adfs_dentry_operations = {
266266
};
267267

268268
static struct dentry *
269-
adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
269+
adfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
270270
{
271271
struct inode *inode = NULL;
272272
struct object_info obj;

‎fs/affs/affs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ extern void affs_free_bitmap(struct super_block *sb);
153153
/* namei.c */
154154

155155
extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
156-
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *);
156+
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int);
157157
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
158158
extern int affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *);
159159
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);

‎fs/affs/namei.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ affs_find_entry(struct inode *dir, struct dentry *dentry)
211211
}
212212

213213
struct dentry *
214-
affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
214+
affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
215215
{
216216
struct super_block *sb = dir->i_sb;
217217
struct buffer_head *bh;

‎fs/afs/dir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "internal.h"
2121

2222
static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
23-
struct nameidata *nd);
23+
unsigned int flags);
2424
static int afs_dir_open(struct inode *inode, struct file *file);
2525
static int afs_readdir(struct file *file, void *dirent, filldir_t filldir);
2626
static int afs_d_revalidate(struct dentry *dentry, unsigned int flags);
@@ -516,7 +516,7 @@ static struct inode *afs_try_auto_mntpt(
516516
* look up an entry in a directory
517517
*/
518518
static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
519-
struct nameidata *nd)
519+
unsigned int flags)
520520
{
521521
struct afs_vnode *vnode;
522522
struct afs_fid fid;

0 commit comments

Comments
 (0)