Skip to content

Commit

Permalink
stop passing nameidata to ->lookup()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Jul 14, 2012
1 parent 201f956 commit 00cd8dd
Show file tree
Hide file tree
Showing 79 changed files with 115 additions and 114 deletions.
3 changes: 1 addition & 2 deletions Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ d_manage: no no yes (ref-walk) maybe
--------------------------- inode_operations ---------------------------
prototypes:
int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *);
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid
ata *);
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
int (*link) (struct dentry *,struct inode *,struct dentry *);
int (*unlink) (struct inode *,struct dentry *);
int (*symlink) (struct inode *,struct dentry *,const char *);
Expand Down
4 changes: 2 additions & 2 deletions Documentation/filesystems/porting
Original file line number Diff line number Diff line change
Expand Up @@ -434,5 +434,5 @@ d_make_root() drops the reference to inode if dentry allocation fails.

--
[mandatory]
The witch is dead! Well, 1/3 of it, anyway. ->d_revalidate() does *not*
take struct nameidata anymore; just the flags.
The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and
->lookup() do *not* take struct nameidata anymore; just the flags.
2 changes: 1 addition & 1 deletion Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ filesystem. As of kernel 2.6.22, the following members are defined:

struct inode_operations {
int (*create) (struct inode *,struct dentry *, umode_t, struct nameidata *);
struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
int (*link) (struct dentry *,struct inode *,struct dentry *);
int (*unlink) (struct inode *,struct dentry *);
int (*symlink) (struct inode *,struct dentry *,const char *);
Expand Down
2 changes: 1 addition & 1 deletion fs/9p/v9fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extern void v9fs_session_close(struct v9fs_session_info *v9ses);
extern void v9fs_session_cancel(struct v9fs_session_info *v9ses);
extern void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses);
extern struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nameidata);
unsigned int flags);
extern int v9fs_vfs_unlink(struct inode *i, struct dentry *d);
extern int v9fs_vfs_rmdir(struct inode *i, struct dentry *d);
extern int v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
Expand Down
8 changes: 4 additions & 4 deletions fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
*/

struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nameidata)
unsigned int flags)
{
struct dentry *res;
struct super_block *sb;
Expand All @@ -795,8 +795,8 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
char *name;
int result = 0;

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

if (dentry->d_name.len > NAME_MAX)
return ERR_PTR(-ENAMETOOLONG);
Expand Down Expand Up @@ -869,7 +869,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
struct dentry *res = NULL;

if (d_unhashed(dentry)) {
res = v9fs_vfs_lookup(dir, dentry, NULL);
res = v9fs_vfs_lookup(dir, dentry, 0);
if (IS_ERR(res))
return PTR_ERR(res);

Expand Down
2 changes: 1 addition & 1 deletion fs/9p/vfs_inode_dotl.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
struct dentry *res = NULL;

if (d_unhashed(dentry)) {
res = v9fs_vfs_lookup(dir, dentry, NULL);
res = v9fs_vfs_lookup(dir, dentry, 0);
if (IS_ERR(res))
return PTR_ERR(res);

Expand Down
2 changes: 1 addition & 1 deletion fs/adfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const struct dentry_operations adfs_dentry_operations = {
};

static struct dentry *
adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
adfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
struct inode *inode = NULL;
struct object_info obj;
Expand Down
2 changes: 1 addition & 1 deletion fs/affs/affs.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ extern void affs_free_bitmap(struct super_block *sb);
/* namei.c */

extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *);
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int);
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
extern int affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *);
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
Expand Down
2 changes: 1 addition & 1 deletion fs/affs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ affs_find_entry(struct inode *dir, struct dentry *dentry)
}

struct dentry *
affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
struct super_block *sb = dir->i_sb;
struct buffer_head *bh;
Expand Down
4 changes: 2 additions & 2 deletions fs/afs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "internal.h"

static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd);
unsigned int flags);
static int afs_dir_open(struct inode *inode, struct file *file);
static int afs_readdir(struct file *file, void *dirent, filldir_t filldir);
static int afs_d_revalidate(struct dentry *dentry, unsigned int flags);
Expand Down Expand Up @@ -516,7 +516,7 @@ static struct inode *afs_try_auto_mntpt(
* look up an entry in a directory
*/
static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct afs_vnode *vnode;
struct afs_fid fid;
Expand Down
4 changes: 2 additions & 2 deletions fs/afs/mntpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

static struct dentry *afs_mntpt_lookup(struct inode *dir,
struct dentry *dentry,
struct nameidata *nd);
unsigned int flags);
static int afs_mntpt_open(struct inode *inode, struct file *file);
static void afs_mntpt_expiry_timed_out(struct work_struct *work);

Expand Down Expand Up @@ -104,7 +104,7 @@ int afs_mntpt_check_symlink(struct afs_vnode *vnode, struct key *key)
*/
static struct dentry *afs_mntpt_lookup(struct inode *dir,
struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
_enter("%p,%p{%p{%s},%s}",
dir,
Expand Down
4 changes: 2 additions & 2 deletions fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long);
static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long);
#endif
static int autofs4_dir_open(struct inode *inode, struct file *file);
static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
static struct dentry *autofs4_lookup(struct inode *,struct dentry *, unsigned int);
static struct vfsmount *autofs4_d_automount(struct path *);
static int autofs4_d_manage(struct dentry *, bool);
static void autofs4_dentry_release(struct dentry *);
Expand Down Expand Up @@ -458,7 +458,7 @@ int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
}

/* Lookups in the root directory */
static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
struct autofs_sb_info *sbi;
struct autofs_info *ino;
Expand Down
2 changes: 1 addition & 1 deletion fs/bad_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static int bad_inode_create (struct inode *dir, struct dentry *dentry,
}

static struct dentry *bad_inode_lookup(struct inode *dir,
struct dentry *dentry, struct nameidata *nd)
struct dentry *dentry, unsigned int flags)
{
return ERR_PTR(-EIO);
}
Expand Down
4 changes: 2 additions & 2 deletions fs/befs/linuxvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static int befs_readdir(struct file *, void *, filldir_t);
static int befs_get_block(struct inode *, sector_t, struct buffer_head *, int);
static int befs_readpage(struct file *file, struct page *page);
static sector_t befs_bmap(struct address_space *mapping, sector_t block);
static struct dentry *befs_lookup(struct inode *, struct dentry *, struct nameidata *);
static struct dentry *befs_lookup(struct inode *, struct dentry *, unsigned int);
static struct inode *befs_iget(struct super_block *, unsigned long);
static struct inode *befs_alloc_inode(struct super_block *sb);
static void befs_destroy_inode(struct inode *inode);
Expand Down Expand Up @@ -159,7 +159,7 @@ befs_get_block(struct inode *inode, sector_t block,
}

static struct dentry *
befs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
struct inode *inode = NULL;
struct super_block *sb = dir->i_sb;
Expand Down
2 changes: 1 addition & 1 deletion fs/bfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
}

static struct dentry *bfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct inode *inode = NULL;
struct buffer_head *bh;
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4247,7 +4247,7 @@ static void btrfs_dentry_release(struct dentry *dentry)
}

static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct dentry *ret;

Expand Down
6 changes: 3 additions & 3 deletions fs/ceph/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ static int is_root_ceph_dentry(struct inode *inode, struct dentry *dentry)
* the MDS so that it gets our 'caps wanted' value in a single op.
*/
static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb);
struct ceph_mds_client *mdsc = fsc->mdsc;
Expand Down Expand Up @@ -653,7 +653,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
}

if (d_unhashed(dentry)) {
res = ceph_lookup(dir, dentry, NULL);
res = ceph_lookup(dir, dentry, 0);
if (IS_ERR(res))
return PTR_ERR(res);

Expand All @@ -678,7 +678,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
*/
int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry)
{
struct dentry *result = ceph_lookup(dir, dentry, NULL);
struct dentry *result = ceph_lookup(dir, dentry, 0);

if (result && !IS_ERR(result)) {
/*
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern int cifs_atomic_open(struct inode *, struct dentry *,
struct file *, unsigned, umode_t,
int *);
extern struct dentry *cifs_lookup(struct inode *, struct dentry *,
struct nameidata *);
unsigned int);
extern int cifs_unlink(struct inode *dir, struct dentry *dentry);
extern int cifs_hardlink(struct dentry *, struct inode *, struct dentry *);
extern int cifs_mknod(struct inode *, struct dentry *, umode_t, dev_t);
Expand Down
4 changes: 2 additions & 2 deletions fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
* in network traffic in the other paths.
*/
if (!(oflags & O_CREAT)) {
struct dentry *res = cifs_lookup(inode, direntry, NULL);
struct dentry *res = cifs_lookup(inode, direntry, 0);
if (IS_ERR(res))
return PTR_ERR(res);

Expand Down Expand Up @@ -621,7 +621,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,

struct dentry *
cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
struct nameidata *nd)
unsigned int flags)
{
int xid;
int rc = 0; /* to get around spurious gcc warning, set to zero here */
Expand Down
4 changes: 2 additions & 2 deletions fs/coda/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/* dir inode-ops */
static int coda_create(struct inode *dir, struct dentry *new, umode_t mode, struct nameidata *nd);
static struct dentry *coda_lookup(struct inode *dir, struct dentry *target, struct nameidata *nd);
static struct dentry *coda_lookup(struct inode *dir, struct dentry *target, unsigned int flags);
static int coda_link(struct dentry *old_dentry, struct inode *dir_inode,
struct dentry *entry);
static int coda_unlink(struct inode *dir_inode, struct dentry *entry);
Expand Down Expand Up @@ -94,7 +94,7 @@ const struct file_operations coda_dir_operations = {

/* inode operations for directories */
/* access routines: lookup, readlink, permission */
static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struct nameidata *nd)
static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsigned int flags)
{
struct super_block *sb = dir->i_sb;
const char *name = entry->d_name.name;
Expand Down
2 changes: 1 addition & 1 deletion fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static int configfs_attach_attr(struct configfs_dirent * sd, struct dentry * den

static struct dentry * configfs_lookup(struct inode *dir,
struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct configfs_dirent * parent_sd = dentry->d_parent->d_fsdata;
struct configfs_dirent * sd;
Expand Down
2 changes: 1 addition & 1 deletion fs/cramfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
/*
* Lookup and fill in the inode data..
*/
static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
unsigned int offset = 0;
struct inode *inode = NULL;
Expand Down
2 changes: 1 addition & 1 deletion fs/ecryptfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static int ecryptfs_lookup_interpose(struct dentry *dentry,
*/
static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode,
struct dentry *ecryptfs_dentry,
struct nameidata *ecryptfs_nd)
unsigned int flags)
{
char *encrypted_and_encoded_name = NULL;
size_t encrypted_and_encoded_name_size;
Expand Down
2 changes: 1 addition & 1 deletion fs/efs/efs.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ extern struct inode *efs_iget(struct super_block *, unsigned long);
extern efs_block_t efs_map_block(struct inode *, efs_block_t);
extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);

extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *);
extern struct dentry *efs_lookup(struct inode *, struct dentry *, unsigned int);
extern struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid,
int fh_len, int fh_type);
extern struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid,
Expand Down
3 changes: 2 additions & 1 deletion fs/efs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len)
return(0);
}

struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) {
struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
efs_ino_t inodenum;
struct inode *inode = NULL;

Expand Down
2 changes: 1 addition & 1 deletion fs/exofs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static inline int exofs_add_nondir(struct dentry *dentry, struct inode *inode)
}

static struct dentry *exofs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct inode *inode;
ino_t ino;
Expand Down
2 changes: 1 addition & 1 deletion fs/ext2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
* Methods themselves.
*/

static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd)
static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags)
{
struct inode * inode;
ino_t ino;
Expand Down
2 changes: 1 addition & 1 deletion fs/ext3/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ static struct buffer_head * ext3_dx_find_entry(struct inode *dir,
return NULL;
}

static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd)
static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags)
{
struct inode * inode;
struct ext3_dir_entry_2 * de;
Expand Down
2 changes: 1 addition & 1 deletion fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q
return NULL;
}

static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
{
struct inode *inode;
struct ext4_dir_entry_2 *de;
Expand Down
2 changes: 1 addition & 1 deletion fs/fat/namei_msdos.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static const struct dentry_operations msdos_dentry_operations = {

/***** Get inode using directory and name */
static struct dentry *msdos_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct super_block *sb = dir->i_sb;
struct fat_slot_info sinfo;
Expand Down
2 changes: 1 addition & 1 deletion fs/fat/namei_vfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ static int vfat_d_anon_disconn(struct dentry *dentry)
}

static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
unsigned int flags)
{
struct super_block *sb = dir->i_sb;
struct fat_slot_info sinfo;
Expand Down
4 changes: 2 additions & 2 deletions fs/freevxfs/vxfs_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#define VXFS_BLOCK_PER_PAGE(sbp) ((PAGE_CACHE_SIZE / (sbp)->s_blocksize))


static struct dentry * vxfs_lookup(struct inode *, struct dentry *, struct nameidata *);
static struct dentry * vxfs_lookup(struct inode *, struct dentry *, unsigned int);
static int vxfs_readdir(struct file *, void *, filldir_t);

const struct inode_operations vxfs_dir_inode_ops = {
Expand Down Expand Up @@ -203,7 +203,7 @@ vxfs_inode_by_name(struct inode *dip, struct dentry *dp)
* in the return pointer.
*/
static struct dentry *
vxfs_lookup(struct inode *dip, struct dentry *dp, struct nameidata *nd)
vxfs_lookup(struct inode *dip, struct dentry *dp, unsigned int flags)
{
struct inode *ip = NULL;
ino_t ino;
Expand Down
Loading

0 comments on commit 00cd8dd

Please sign in to comment.