vfs: add and use lookup_flags_t for sparse checking
Subsystems (48)
PATCH 1/1 vfs: add and use lookup_flags_t for sparse checking
Few places arent't switched as they using
flags & LOOKUP_...
as a bool substitute.
Signed-off-by Alexey Dobriyan <[email protected]>
---
drivers/staging/lustre/lustre/llite/dcache.c | 4 - drivers/staging/lustre/lustre/llite/namei.c | 2 drivers/staging/ncpfs/dir.c | 6 +- fs/9p/v9fs.h | 2 fs/9p/vfs_dentry.c | 2 fs/9p/vfs_inode.c | 2 fs/adfs/dir.c | 2 fs/affs/affs.h | 2 fs/affs/namei.c | 2 fs/afs/dir.c | 8 +-- fs/afs/dynroot.c | 4 - fs/afs/mntpt.c | 4 - fs/autofs4/root.c | 4 - fs/bad_inode.c | 2 fs/befs/linuxvfs.c | 2 fs/bfs/dir.c | 2 fs/btrfs/inode.c | 2 fs/ceph/dir.c | 6 +- fs/cifs/cifsfs.h | 2 fs/cifs/dir.c | 4 - fs/coda/dir.c | 4 - fs/configfs/dir.c | 2 fs/cramfs/inode.c | 2 fs/crypto/crypto.c | 2 fs/ecryptfs/dentry.c | 2 fs/ecryptfs/inode.c | 2 fs/efs/efs.h | 2 fs/efs/namei.c | 2 fs/exec.c | 4 - fs/exofs/namei.c | 2 fs/ext2/namei.c | 2 fs/ext4/namei.c | 2 fs/f2fs/namei.c | 2 fs/fat/namei_msdos.c | 2 fs/fat/namei_vfat.c | 6 +- fs/fhandle.c | 2 fs/freevxfs/vxfs_lookup.c | 4 - fs/fuse/dir.c | 4 - fs/gfs2/dentry.c | 2 fs/gfs2/inode.c | 2 fs/hfs/dir.c | 2 fs/hfs/inode.c | 2 fs/hfs/sysdep.c | 2 fs/hfsplus/dir.c | 2 fs/hostfs/hostfs_kern.c | 2 fs/hpfs/dir.c | 2 fs/hpfs/hpfs_fn.h | 2 fs/internal.h | 8 +-- fs/isofs/isofs.h | 2 fs/isofs/namei.c | 2 fs/jffs2/dir.c | 4 - fs/jfs/namei.c | 4 - fs/kernfs/dir.c | 4 - fs/libfs.c | 4 - fs/minix/namei.c | 2 fs/namei.c | 68 +++++++++++++-------------- fs/namespace.c | 2 fs/nfs/dir.c | 18 +++---- fs/nfs/internal.h | 2 fs/nilfs2/namei.c | 2 fs/notify/fanotify/fanotify_user.c | 2 fs/notify/inotify/inotify_user.c | 4 - fs/ntfs/namei.c | 2 fs/ocfs2/dcache.c | 2 fs/ocfs2/namei.c | 2 fs/omfs/dir.c | 2 fs/open.c | 14 ++--- fs/openpromfs/inode.c | 4 - fs/orangefs/dcache.c | 2 fs/orangefs/namei.c | 2 fs/overlayfs/namei.c | 2 fs/overlayfs/overlayfs.h | 2 fs/overlayfs/super.c | 4 - fs/proc/base.c | 16 +++--- fs/proc/fd.c | 6 +- fs/proc/generic.c | 4 - fs/proc/internal.h | 6 +- fs/proc/namespaces.c | 2 fs/proc/proc_net.c | 2 fs/proc/proc_sysctl.c | 4 - fs/proc/root.c | 2 fs/qnx4/namei.c | 2 fs/qnx4/qnx4.h | 2 fs/qnx6/namei.c | 2 fs/qnx6/qnx6.h | 2 fs/reiserfs/namei.c | 2 fs/reiserfs/xattr.c | 2 fs/romfs/super.c | 2 fs/squashfs/namei.c | 2 fs/stat.c | 4 - fs/statfs.c | 2 fs/sysv/namei.c | 2 fs/ubifs/dir.c | 2 fs/udf/namei.c | 2 fs/ufs/namei.c | 2 fs/utimes.c | 2 fs/xattr.c | 8 +-- fs/xfs/xfs_iops.c | 4 - include/linux/dcache.h | 4 - include/linux/fs.h | 6 +- include/linux/fscrypt.h | 2 include/linux/namei.h | 44 ++++++++--------- include/linux/types.h | 1 kernel/bpf/inode.c | 2 104 files changed, 221 insertions(+), 220 deletions(-)
drivers/staging/lustre/lustre/llite/dcache.c +2 -2
@@ -246,7 +246,7 @@ void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode) }static int ll_revalidate_dentry (struct dentry *dentry, -unsigned int lookup_flags) +lookup_flags_t lookup_flags) {struct inode *dir =d_inode (dentry->d_parent);
@@ -283,7 +283,7 @@ static int ll_revalidate_dentry(struct dentry *dentry,/* * Always trust cached dentries. Update statahead window if necessary. */ -static int ll_revalidate_nd (struct dentry *dentry,unsigned int flags) +static int ll_revalidate_nd (struct dentry *dentry,lookup_flags_t flags) {CDEBUG (D_VFSTRACE ,"VFS Op:name=%pd, flags=%u\n" , dentry, flags);
drivers/staging/lustre/lustre/llite/namei.c +1 -1
@@ -644,7 +644,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, }static struct dentry *ll_lookup_nd (struct inode *parent,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct lookup_intent *itp, it = { .it_op =IT_GETATTR };struct dentry *de;
drivers/staging/ncpfs/dir.c +3 -3
@@ -32,7 +32,7 @@ static void ncp_do_readdir(struct file *, struct dir_context *,static int ncp_readdir (struct file *,struct dir_context *);static int ncp_create (struct inode *,struct dentry *,umode_t ,bool ); -static struct dentry *ncp_lookup (struct inode *,struct dentry *,unsigned int ); +static struct dentry *ncp_lookup (struct inode *,struct dentry *,lookup_flags_t );static int ncp_unlink (struct inode *,struct dentry *);static int ncp_mkdir (struct inode *,struct dentry *,umode_t );static int ncp_rmdir (struct inode *,struct dentry *);
@@ -299,7 +299,7 @@ leave_me:;static int -ncp_lookup_validate (struct dentry *dentry,unsigned int flags) +ncp_lookup_validate (struct dentry *dentry,lookup_flags_t flags) {struct ncp_server *server;struct dentry *parent;
@@ -818,7 +818,7 @@ int ncp_conn_logged_in(struct super_block *sb)return result; } -static struct dentry *ncp_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +static struct dentry *ncp_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct ncp_server *server =NCP_SERVER (dir);struct inode *inode =NULL ;
fs/9p/v9fs.h +1 -1
@@ -146,7 +146,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, -unsigned int flags); +lookup_flags_t 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,
fs/9p/vfs_dentry.c +1 -1
@@ -74,7 +74,7 @@ static void v9fs_dentry_release(struct dentry *dentry) dentry->d_fsdata =NULL ; } -static int v9fs_lookup_revalidate (struct dentry *dentry,unsigned int flags) +static int v9fs_lookup_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct p9_fid *fid;struct inode *inode;
fs/9p/vfs_inode.c +1 -1
@@ -803,7 +803,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, -unsigned int flags) +lookup_flags_t flags) {struct dentry *res;struct v9fs_session_info *v9ses;
fs/adfs/dir.c +1 -1
@@ -258,7 +258,7 @@ const struct dentry_operations adfs_dentry_operations = { };static struct dentry * -adfs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +adfs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct inode *inode =NULL ;struct object_info obj;
fs/affs/affs.h +1 -1
@@ -165,7 +165,7 @@ extern void affs_free_bitmap(struct super_block *sb);extern const struct export_operations affs_export_ops;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,unsigned int ); +struct dentry *affs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t );extern int affs_unlink (struct inode *dir,struct dentry *dentry);extern int affs_create (struct inode *dir,struct dentry *dentry,umode_t mode,bool );extern int affs_mkdir (struct inode *dir,struct dentry *dentry,umode_t mode);
fs/affs/namei.c +1 -1
@@ -196,7 +196,7 @@ affs_find_entry(struct inode *dir, struct dentry *dentry) }struct dentry * -affs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +affs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct super_block *sb = dir->i_sb;struct buffer_head *bh;
fs/afs/dir.c +4 -4
@@ -21,10 +21,10 @@#include "xdr_fs.h" static struct dentry *afs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags); +lookup_flags_t flags);static int afs_dir_open (struct inode *inode,struct file *file);static int afs_readdir (struct file *file,struct dir_context *ctx); -static int afs_d_revalidate (struct dentry *dentry,unsigned int flags); +static int afs_d_revalidate (struct dentry *dentry,lookup_flags_t flags);static int afs_d_delete (const struct dentry *dentry);static int afs_lookup_one_filldir (struct dir_context *ctx,const char *name,int nlen,loff_t fpos,u64 ino,unsigned dtype);
@@ -820,7 +820,7 @@ static struct dentry *afs_lookup_atsys(struct inode *dir, struct dentry *dentry,* look up an entry in a directory */ static struct dentry *afs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct afs_vnode *dvnode =AFS_FS_I (dir);struct inode *inode;
@@ -908,7 +908,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,* - NOTE! the hit can be a negative hit too, so we can't assume we have an * inode */ -static int afs_d_revalidate (struct dentry *dentry,unsigned int flags) +static int afs_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct afs_vnode *vnode, *dir;struct afs_fid uninitialized_var (fid );
fs/afs/dynroot.c +2 -2
@@ -139,7 +139,7 @@ static struct dentry *afs_lookup_atcell(struct dentry *dentry)* Look up an entry in a dynroot directory. */ static struct dentry *afs_dynroot_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct afs_vnode *vnode;struct inode *inode;
@@ -185,7 +185,7 @@ const struct inode_operations afs_dynroot_inode_operations = {/* * Dirs in the dynamic root don't need revalidation. */ -static int afs_dynroot_d_revalidate (struct dentry *dentry,unsigned int flags) +static int afs_dynroot_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {return 1 ; }
fs/afs/mntpt.c +2 -2
@@ -22,7 +22,7 @@static struct dentry *afs_mntpt_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags); +lookup_flags_t flags);static int afs_mntpt_open (struct inode *inode,struct file *file);static void afs_mntpt_expiry_timed_out (struct work_struct *work);
@@ -52,7 +52,7 @@ static unsigned long afs_mntpt_expiry_timeout = 10 * 60;*/ static struct dentry *afs_mntpt_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {_enter ("%p,%p{%pd2}" , dir, dentry, dentry);return ERR_PTR (-EREMOTE );
fs/autofs4/root.c +2 -2
@@ -30,7 +30,7 @@ static long autofs4_root_compat_ioctl(struct file *,#endif static int autofs4_dir_open (struct inode *inode,struct file *file);static struct dentry *autofs4_lookup (struct inode *, -struct dentry *,unsigned int ); +struct dentry *,lookup_flags_t );static struct vfsmount *autofs4_d_automount (struct path *);static int autofs4_d_manage (const struct path *,bool );static void autofs4_dentry_release (struct dentry *);
@@ -501,7 +501,7 @@ static int autofs4_d_manage(const struct path *path, bool rcu_walk)/* Lookups in the root directory */ static struct dentry *autofs4_lookup (struct inode *dir, -struct dentry *dentry,unsigned int flags) +struct dentry *dentry,lookup_flags_t flags) {struct autofs_sb_info *sbi;struct autofs_info *ino;
fs/bad_inode.c +1 -1
@@ -33,7 +33,7 @@ static int bad_inode_create (struct inode *dir, struct dentry *dentry, }static struct dentry *bad_inode_lookup (struct inode *dir, -struct dentry *dentry,unsigned int flags) +struct dentry *dentry,lookup_flags_t flags) {return ERR_PTR (-EIO ); }
fs/befs/linuxvfs.c +1 -1
@@ -167,7 +167,7 @@ befs_get_block(struct inode *inode, sector_t block, }static struct dentry * -befs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +befs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct inode *inode;struct super_block *sb = dir->i_sb;
fs/bfs/dir.c +1 -1
@@ -125,7 +125,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, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode =NULL ;struct buffer_head *bh;
fs/btrfs/inode.c +1 -1
@@ -5849,7 +5849,7 @@ static void btrfs_dentry_release(struct dentry *dentry) }static struct dentry *btrfs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode;
fs/ceph/dir.c +3 -3
@@ -727,7 +727,7 @@ static bool 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, -unsigned int flags) +lookup_flags_t flags) {struct ceph_fs_client *fsc =ceph_sb_to_client (dir->i_sb);struct ceph_mds_client *mdsc = fsc->mdsc;
@@ -1135,7 +1135,7 @@ void ceph_invalidate_dentry_lease(struct dentry *dentry)* Check if dentry lease is valid. If not, delete the lease. Try to * renew if the least is more than half up. */ -static int dentry_lease_is_valid (struct dentry *dentry,unsigned int flags, +static int dentry_lease_is_valid (struct dentry *dentry,lookup_flags_t flags,struct inode *dir) {struct ceph_dentry_info *di;
@@ -1210,7 +1210,7 @@ static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry)/* * Check if cached dentry can be trusted. */ -static int ceph_d_revalidate (struct dentry *dentry,unsigned int flags) +static int ceph_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {int valid =0 ;struct dentry *parent;
fs/cifs/cifsfs.h +1 -1
@@ -68,7 +68,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 *, -unsigned int ); +lookup_flags_t );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 );
fs/cifs/dir.c +2 -2
@@ -759,7 +759,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, -unsigned int flags) +lookup_flags_t flags) {unsigned int xid;int rc =0 ;/* to get around spurious gcc warning, set to zero here */
@@ -839,7 +839,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, }static int -cifs_d_revalidate (struct dentry *direntry,unsigned int flags) +cifs_d_revalidate (struct dentry *direntry,lookup_flags_t flags) {if (flags &LOOKUP_RCU )return -ECHILD ;
fs/coda/dir.c +2 -2
@@ -38,7 +38,7 @@ static int coda_return_EIO(void)/* inode operations for directories */ /* access routines: lookup, readlink, permission */ -static struct dentry *coda_lookup (struct inode *dir,struct dentry *entry,unsigned int flags) +static struct dentry *coda_lookup (struct inode *dir,struct dentry *entry,lookup_flags_t flags) {struct super_block *sb = dir->i_sb;const char *name = entry->d_name.name;
@@ -453,7 +453,7 @@ static int coda_readdir(struct file *coda_file, struct dir_context *ctx) }/* called when a cache lookup succeeds */ -static int coda_dentry_revalidate (struct dentry *de,unsigned int flags) +static int coda_dentry_revalidate (struct dentry *de,lookup_flags_t flags) {struct inode *inode;struct coda_inode_info *cii;
fs/configfs/dir.c +1 -1
@@ -439,7 +439,7 @@ static int configfs_attach_attr(struct configfs_dirent * sd, struct dentry * denstatic struct dentry *configfs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct configfs_dirent * parent_sd = dentry->d_parent->d_fsdata;struct configfs_dirent * sd;
fs/cramfs/inode.c +1 -1
@@ -756,7 +756,7 @@ static int cramfs_readdir(struct file *file, struct dir_context *ctx)/* * Lookup and fill in the inode data.. */ -static struct dentry *cramfs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +static struct dentry *cramfs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {unsigned int offset =0 ;struct inode *inode =NULL ;
fs/crypto/crypto.c +1 -1
@@ -312,7 +312,7 @@ EXPORT_SYMBOL(fscrypt_decrypt_page);* potentially caching stale data after a key has been added or * removed. */ -static int fscrypt_d_revalidate (struct dentry *dentry,unsigned int flags) +static int fscrypt_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct dentry *dir;int dir_has_key, cached_with_key;
fs/ecryptfs/dentry.c +1 -1
@@ -42,7 +42,7 @@* Returns 1 if valid, 0 otherwise. * */ -static int ecryptfs_d_revalidate (struct dentry *dentry,unsigned int flags) +static int ecryptfs_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct dentry *lower_dentry =ecryptfs_dentry_to_lower (dentry);int rc =1 ;
fs/ecryptfs/inode.c +1 -1
@@ -381,7 +381,7 @@ static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry,*/ static struct dentry *ecryptfs_lookup (struct inode *ecryptfs_dir_inode,struct dentry *ecryptfs_dentry, -unsigned int flags) +lookup_flags_t flags) {char *encrypted_and_encoded_name =NULL ;struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
fs/efs/efs.h +1 -1
@@ -136,7 +136,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 *,unsigned int ); +struct dentry *efs_lookup (struct inode *,struct dentry *,lookup_flags_t );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,
fs/efs/namei.c +1 -1
@@ -62,7 +62,7 @@ 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,unsigned int flags) +struct dentry *efs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {efs_ino_t inodenum;struct inode *inode =NULL ;
fs/exec.c +2 -2
@@ -1949,7 +1949,7 @@ SYSCALL_DEFINE5(execveat, const char __user *const __user *, envp, int, flags) { - int lookup_flags = (flags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0; + lookup_flags_t lookup_flags = (flags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0; return do_execveat(fd, getname_flags(filename, lookup_flags, NULL),
@@ -1970,7 +1970,7 @@ COMPAT_SYSCALL_DEFINE5(execveat, int, fd, const compat_uptr_t __user *, envp, int, flags) { - int lookup_flags = (flags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0; + lookup_flags_t lookup_flags = (flags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0; return compat_do_execveat(fd, getname_flags(filename, lookup_flags, NULL),
fs/exofs/namei.c +1 -1
@@ -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, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode;ino_t ino;
fs/ext2/namei.c +1 -1
@@ -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,unsigned int flags) +static struct dentry *ext2_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct inode * inode;ino_t ino;
fs/ext4/namei.c +1 -1
@@ -1539,7 +1539,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir,return bh; } -static struct dentry *ext4_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +static struct dentry *ext4_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct inode *inode;struct ext4_dir_entry_2 *de;
fs/f2fs/namei.c +1 -1
@@ -419,7 +419,7 @@ static int __recover_dot_dentries(struct inode *dir, nid_t pino) }static struct dentry *f2fs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode =NULL ;struct f2fs_dir_entry *de;
fs/fat/namei_msdos.c +1 -1
@@ -198,7 +198,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, -unsigned int flags) +lookup_flags_t flags) {struct super_block *sb = dir->i_sb;struct fat_slot_info sinfo;
fs/fat/namei_vfat.c +3 -3
@@ -52,7 +52,7 @@ static int vfat_revalidate_shortname(struct dentry *dentry)return ret; } -static int vfat_revalidate (struct dentry *dentry,unsigned int flags) +static int vfat_revalidate (struct dentry *dentry,lookup_flags_t flags) {if (flags &LOOKUP_RCU )return -ECHILD ;
@@ -63,7 +63,7 @@ static int vfat_revalidate(struct dentry *dentry, unsigned int flags)return vfat_revalidate_shortname (dentry); } -static int vfat_revalidate_ci (struct dentry *dentry,unsigned int flags) +static int vfat_revalidate_ci (struct dentry *dentry,lookup_flags_t flags) {if (flags &LOOKUP_RCU )return -ECHILD ;
@@ -707,7 +707,7 @@ static int vfat_d_anon_disconn(struct dentry *dentry) }static struct dentry *vfat_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct super_block *sb = dir->i_sb;struct fat_slot_info sinfo;
fs/fhandle.c +1 -1
@@ -95,7 +95,7 @@ SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name, int, flag) {struct path path; -int lookup_flags; +lookup_flags_t lookup_flags;int err;if ((flag & ~(AT_SYMLINK_FOLLOW |AT_EMPTY_PATH )) !=0 )
fs/freevxfs/vxfs_lookup.c +2 -2
@@ -49,7 +49,7 @@#define VXFS_BLOCK_PER_PAGE (sbp) ((PAGE_SIZE / (sbp)->s_blocksize)) -static struct dentry *vxfs_lookup (struct inode *,struct dentry *,unsigned int ); +static struct dentry *vxfs_lookup (struct inode *,struct dentry *,lookup_flags_t );static int vxfs_readdir (struct file *,struct dir_context *);const struct inode_operations vxfs_dir_inode_ops = {
@@ -184,7 +184,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,unsigned int flags) +vxfs_lookup (struct inode *dip,struct dentry *dp,lookup_flags_t flags) {struct inode *ip =NULL ;ino_t ino;
fs/fuse/dir.c +2 -2
@@ -178,7 +178,7 @@ u64 fuse_get_attr_version(struct fuse_conn *fc)* the lookup once more. If the lookup results in the same inode, * then refresh the attributes, timeouts and mark the dentry valid. */ -static int fuse_dentry_revalidate (struct dentry *entry,unsigned int flags) +static int fuse_dentry_revalidate (struct dentry *entry,lookup_flags_t flags) {struct inode *inode;struct dentry *parent;
@@ -348,7 +348,7 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name }static struct dentry *fuse_lookup (struct inode *dir,struct dentry *entry, -unsigned int flags) +lookup_flags_t flags) {int err;struct fuse_entry_out outarg;
fs/gfs2/dentry.c +1 -1
@@ -33,7 +33,7 @@* Returns: 1 if the dentry is ok, 0 if it isn't */ -static int gfs2_drevalidate (struct dentry *dentry,unsigned int flags) +static int gfs2_drevalidate (struct dentry *dentry,lookup_flags_t flags) {struct dentry *parent;struct gfs2_sbd *sdp;
fs/gfs2/inode.c +1 -1
@@ -877,7 +877,7 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, }static struct dentry *gfs2_lookup (struct inode *dir,struct dentry *dentry, -unsigned flags) +lookup_flags_t flags) {return __gfs2_lookup (dir, dentry,NULL ,NULL ); }
fs/hfs/dir.c +1 -1
@@ -18,7 +18,7 @@* hfs_lookup() */ static struct dentry *hfs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {hfs_cat_rec rec;struct hfs_find_data fd;
fs/hfs/inode.c +1 -1
@@ -504,7 +504,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc) }static struct dentry *hfs_file_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode =NULL ;hfs_cat_rec rec;
fs/hfs/sysdep.c +1 -1
@@ -13,7 +13,7 @@/* dentry case-handling: just lowercase everything */ -static int hfs_revalidate_dentry (struct dentry *dentry,unsigned int flags) +static int hfs_revalidate_dentry (struct dentry *dentry,lookup_flags_t flags) {struct inode *inode;int diff;
fs/hfsplus/dir.c +1 -1
@@ -29,7 +29,7 @@ static inline void hfsplus_instantiate(struct dentry *dentry,/* Find the entry inside dir named dentry->d_name */ static struct dentry *hfsplus_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode =NULL ;struct hfs_find_data fd;
fs/hostfs/hostfs_kern.c +1 -1
@@ -603,7 +603,7 @@ static int hostfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, }static struct dentry *hostfs_lookup (struct inode *ino,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode;char *name;
fs/hpfs/dir.c +1 -1
@@ -199,7 +199,7 @@ static int hpfs_readdir(struct file *file, struct dir_context *ctx)* to tell read_inode to read fnode or not. */ -struct dentry *hpfs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +struct dentry *hpfs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {const unsigned char *name = dentry->d_name.name;unsigned len = dentry->d_name.len;
fs/hpfs/hpfs_fn.h +1 -1
@@ -238,7 +238,7 @@ extern const struct dentry_operations hpfs_dentry_operations;/* dir.c */ -struct dentry *hpfs_lookup (struct inode *,struct dentry *,unsigned int ); +struct dentry *hpfs_lookup (struct inode *,struct dentry *,lookup_flags_t );extern const struct file_operations hpfs_dir_ops;/* dnode.c */
fs/internal.h +4 -4
@@ -52,9 +52,9 @@ extern void __init chrdev_init(void);/* * namei.c */ -extern int user_path_mountpoint_at (int ,const char __user *,unsigned int ,struct path *); +int user_path_mountpoint_at (int ,const char __user *,lookup_flags_t ,struct path *);extern int vfs_path_lookup (struct dentry *,struct vfsmount *, -const char *,unsigned int ,struct path *); +const char *,lookup_flags_t ,struct path *);long do_mknodat (int dfd,const char __user *filename,umode_t mode,unsigned int dev);long do_mkdirat (int dfd,const char __user *pathname,umode_t mode);
@@ -111,8 +111,8 @@ struct open_flags {int open_flag;umode_t mode;int acc_mode; -int intent; -int lookup_flags; +lookup_flags_t intent; +lookup_flags_t lookup_flags; };extern struct file *do_filp_open (int dfd,struct filename *pathname,const struct open_flags *op);
fs/isofs/isofs.h +1 -1
@@ -118,7 +118,7 @@ extern int isofs_name_translate(struct iso_directory_record *, char *, struct inint get_joliet_filename (struct iso_directory_record *,unsigned char *,struct inode *);int get_acorn_filename (struct iso_directory_record *,char *,struct inode *); -extern struct dentry *isofs_lookup (struct inode *,struct dentry *,unsigned int flags); +struct dentry *isofs_lookup (struct inode *,struct dentry *,lookup_flags_t flags);extern struct buffer_head *isofs_bread (struct inode *,sector_t );extern int isofs_get_blocks (struct inode *,sector_t ,struct buffer_head **,unsigned long );
fs/isofs/namei.c +1 -1
@@ -149,7 +149,7 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,return 0 ; } -struct dentry *isofs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +struct dentry *isofs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {int found;unsigned long uninitialized_var (block );
fs/jffs2/dir.c +2 -2
@@ -27,7 +27,7 @@ static int jffs2_readdir (struct file *, struct dir_context *);static int jffs2_create (struct inode *,struct dentry *,umode_t ,bool );static struct dentry *jffs2_lookup (struct inode *,struct dentry *, -unsigned int ); +lookup_flags_t );static int jffs2_link (struct dentry *,struct inode *,struct dentry *);static int jffs2_unlink (struct inode *,struct dentry *);static int jffs2_symlink (struct inode *,struct dentry *,const char *);
@@ -73,7 +73,7 @@ const struct inode_operations jffs2_dir_inode_operations =nice and simple */ static struct dentry *jffs2_lookup (struct inode *dir_i,struct dentry *target, -unsigned int flags) +lookup_flags_t flags) {struct jffs2_inode_info *dir_f;struct jffs2_full_dirent *fd =NULL , *fd_list;
fs/jfs/namei.c +2 -2
@@ -1459,7 +1459,7 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,return rc; } -static struct dentry *jfs_lookup (struct inode *dip,struct dentry *dentry,unsigned int flags) +static struct dentry *jfs_lookup (struct inode *dip,struct dentry *dentry,lookup_flags_t flags) {struct btstack btstack;ino_t inum;
@@ -1588,7 +1588,7 @@ static int jfs_ci_compare(const struct dentry *dentry,return result; } -static int jfs_ci_revalidate (struct dentry *dentry,unsigned int flags) +static int jfs_ci_revalidate (struct dentry *dentry,lookup_flags_t flags) {/* * This is not negative dentry. Always valid.
fs/kernfs/dir.c +2 -2
@@ -555,7 +555,7 @@ void kernfs_put(struct kernfs_node *kn) }EXPORT_SYMBOL_GPL (kernfs_put); -static int kernfs_dop_revalidate (struct dentry *dentry,unsigned int flags) +static int kernfs_dop_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct kernfs_node *kn;
@@ -1048,7 +1048,7 @@ struct kernfs_node *kernfs_create_empty_dir(struct kernfs_node *parent,static struct dentry *kernfs_iop_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct dentry *ret;struct kernfs_node *parent = dir->i_private;
fs/libfs.c +2 -2
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(simple_dentry_operations);* Lookup the data. This is trivial - if the dentry didn't already * exist, we know it is negative. Set d_op to delete negative dentries. */ -struct dentry *simple_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +struct dentry *simple_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {if (dentry->d_name.len >NAME_MAX )return ERR_PTR (-ENAMETOOLONG );
@@ -1182,7 +1182,7 @@ EXPORT_SYMBOL(simple_symlink_inode_operations);/* * Operations for a permanently empty directory. */ -static struct dentry *empty_dir_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +static struct dentry *empty_dir_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {return ERR_PTR (-ENOENT ); }
fs/minix/namei.c +1 -1
@@ -19,7 +19,7 @@ static int add_nondir(struct dentry *dentry, struct inode *inode)return err; } -static struct dentry *minix_lookup (struct inode * dir,struct dentry *dentry,unsigned int flags) +static struct dentry *minix_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct inode * inode =NULL ;ino_t ino;
fs/namei.c +34 -34
272 lines not on this page · raw message
fs/namespace.c +1 -1
@@ -1686,7 +1686,7 @@ int ksys_umount(char __user *name, int flags)struct path path;struct mount *mnt;int retval; -int lookup_flags =0 ; +lookup_flags_t lookup_flags =0 ;if (flags & ~(MNT_FORCE |MNT_DETACH |MNT_EXPIRE |UMOUNT_NOFOLLOW ))return -EINVAL ;
fs/nfs/dir.c +9 -9
@@ -989,7 +989,7 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry,* Use intent information to check whether or not we're going to do * an O_EXCL create using this path component. */ -static int nfs_is_exclusive_create (struct inode *dir,unsigned int flags) +static int nfs_is_exclusive_create (struct inode *dir,lookup_flags_t flags) {if (NFS_PROTO (dir)->version ==2 )return 0 ;
@@ -1005,7 +1005,7 @@ static int nfs_is_exclusive_create(struct inode *dir, unsigned int flags)* */ static -int nfs_lookup_verify_inode (struct inode *inode,unsigned int flags) +int nfs_lookup_verify_inode (struct inode *inode,lookup_flags_t flags) {struct nfs_server *server =NFS_SERVER (inode);int ret;
@@ -1042,7 +1042,7 @@ int nfs_lookup_verify_inode(struct inode *inode, unsigned int flags)*/ static inline int nfs_neg_need_reval (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {/* Don't revalidate a negative dentry if we're creating a new file */ if (flags &LOOKUP_CREATE )
@@ -1063,7 +1063,7 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry,* If the parent directory is seen to have changed, we throw out the * cached dentry and do a new lookup. */ -static int nfs_lookup_revalidate (struct dentry *dentry,unsigned int flags) +static int nfs_lookup_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct inode *dir;struct inode *inode;
@@ -1212,7 +1212,7 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)* In this situation, we just want to verify that the inode itself is OK * since the dentry might have changed on the server. */ -static int nfs_weak_revalidate (struct dentry *dentry,unsigned int flags) +static int nfs_weak_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct inode *inode =d_inode (dentry);int error =0 ;
@@ -1316,7 +1316,7 @@ const struct dentry_operations nfs_dentry_operations = { };EXPORT_SYMBOL_GPL (nfs_dentry_operations); -struct dentry *nfs_lookup (struct inode *dir,struct dentry * dentry,unsigned int flags) +struct dentry *nfs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct dentry *res;struct inode *inode =NULL ;
@@ -1383,7 +1383,7 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned inEXPORT_SYMBOL_GPL (nfs_lookup);#if IS_ENABLED (CONFIG_NFS_V4 ) -static int nfs4_lookup_revalidate (struct dentry *,unsigned int ); +static int nfs4_lookup_revalidate (struct dentry *,lookup_flags_t );const struct dentry_operations nfs4_dentry_operations = { .d_revalidate = nfs4_lookup_revalidate,
@@ -1443,7 +1443,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,struct dentry *res;struct iattr attr = { .ia_valid =ATTR_OPEN };struct inode *inode; -unsigned int lookup_flags =0 ; +lookup_flags_t lookup_flags =0 ;bool switched = false;int err;
@@ -1555,7 +1555,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, }EXPORT_SYMBOL_GPL (nfs_atomic_open); -static int nfs4_lookup_revalidate (struct dentry *dentry,unsigned int flags) +static int nfs4_lookup_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct inode *inode;int ret =0 ;
fs/nfs/internal.h +1 -1
@@ -355,7 +355,7 @@ extern unsigned long nfs_access_cache_count(struct shrinker *shrink, struct shrink_control *sc);extern unsigned long nfs_access_cache_scan (struct shrinker *shrink,struct shrink_control *sc); -struct dentry *nfs_lookup (struct inode *,struct dentry *,unsigned int ); +struct dentry *nfs_lookup (struct inode *,struct dentry *,lookup_flags_t );int nfs_create (struct inode *,struct dentry *,umode_t ,bool );int nfs_mkdir (struct inode *,struct dentry *,umode_t );int nfs_rmdir (struct inode *,struct dentry *);
fs/nilfs2/namei.c +1 -1
@@ -61,7 +61,7 @@ static inline int nilfs_add_nondir(struct dentry *dentry, struct inode *inode)*/ static struct dentry * -nilfs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +nilfs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct inode *inode;ino_t ino;
fs/notify/fanotify/fanotify_user.c +1 -1
@@ -476,7 +476,7 @@ static int fanotify_find_path(int dfd, const char __user *filename,path_get (path);fdput (f); }else { -unsigned int lookup_flags =0 ; +lookup_flags_t lookup_flags =0 ;if (!(flags &FAN_MARK_DONT_FOLLOW )) lookup_flags |=LOOKUP_FOLLOW ;
fs/notify/inotify/inotify_user.c +2 -2
@@ -341,7 +341,7 @@ static const struct file_operations inotify_fops = {/* * find_inode - resolve a user-given path to a specific inode */ -static int inotify_find_inode (const char __user *dirname,struct path *path,unsigned flags) +static int inotify_find_inode (const char __user *dirname,struct path *path,lookup_flags_t flags) {int error;
@@ -692,7 +692,7 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,struct path path;struct fd f;int ret; -unsigned flags =0 ; +lookup_flags_t flags =0 ;/* * We share a lot of code with fs/dnotify. We also share
fs/ntfs/namei.c +1 -1
@@ -101,7 +101,7 @@* Locking: Caller must hold i_mutex on the directory. */ static struct dentry *ntfs_lookup (struct inode *dir_ino,struct dentry *dent, -unsigned int flags) +lookup_flags_t flags) {ntfs_volume *vol =NTFS_SB (dir_ino->i_sb);struct inode *dent_inode;
fs/ocfs2/dcache.c +1 -1
@@ -48,7 +48,7 @@ void ocfs2_dentry_attach_gen(struct dentry *dentry) } -static int ocfs2_dentry_revalidate (struct dentry *dentry,unsigned int flags) +static int ocfs2_dentry_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct inode *inode;int ret =0 ;/* if all else fails, just return false */
fs/ocfs2/namei.c +1 -1
@@ -109,7 +109,7 @@ static void ocfs2_double_unlock(struct inode *inode1, struct inode *inode2);#define OCFS2_ORPHAN_NAMELEN ((int)(2 * sizeof(u64)))static struct dentry *ocfs2_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {int status;u64 blkno;
fs/omfs/dir.c +1 -1
@@ -291,7 +291,7 @@ static int omfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, }static struct dentry *omfs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct buffer_head *bh;struct inode *inode =NULL ;
fs/open.c +7 -7
@@ -130,7 +130,7 @@ EXPORT_SYMBOL_GPL(vfs_truncate);long do_sys_truncate (const char __user *pathname,loff_t length) { -unsigned int lookup_flags =LOOKUP_FOLLOW ; +lookup_flags_t lookup_flags =LOOKUP_FOLLOW ;struct path path;int error;
@@ -362,7 +362,7 @@ long do_faccessat(int dfd, const char __user *filename, int mode)struct path path;struct inode *inode;int res; -unsigned int lookup_flags =LOOKUP_FOLLOW ; +lookup_flags_t lookup_flags =LOOKUP_FOLLOW ;if (mode & ~S_IRWXO )/* where's F_OK, X_OK, W_OK, R_OK? */ return -EINVAL ;
@@ -445,7 +445,7 @@ int ksys_chdir(const char __user *filename) {struct path path;int error; -unsigned int lookup_flags =LOOKUP_FOLLOW |LOOKUP_DIRECTORY ; +lookup_flags_t lookup_flags =LOOKUP_FOLLOW |LOOKUP_DIRECTORY ; retry: error =user_path_at (AT_FDCWD , filename, lookup_flags, &path);if (error)
@@ -498,7 +498,7 @@ int ksys_chroot(const char __user *filename) {struct path path;int error; -unsigned int lookup_flags =LOOKUP_FOLLOW |LOOKUP_DIRECTORY ; +lookup_flags_t lookup_flags =LOOKUP_FOLLOW |LOOKUP_DIRECTORY ; retry: error =user_path_at (AT_FDCWD , filename, lookup_flags, &path);if (error)
@@ -583,7 +583,7 @@ int do_fchmodat(int dfd, const char __user *filename, umode_t mode) {struct path path;int error; -unsigned int lookup_flags =LOOKUP_FOLLOW ; +lookup_flags_t lookup_flags =LOOKUP_FOLLOW ; retry: error =user_path_at (dfd, filename, lookup_flags, &path);if (!error) {
@@ -655,7 +655,7 @@ int do_fchownat(int dfd, const char __user *filename, uid_t user, gid_t group, {struct path path;int error = -EINVAL ; -int lookup_flags; +lookup_flags_t lookup_flags;if ((flag & ~(AT_SYMLINK_NOFOLLOW |AT_EMPTY_PATH )) !=0 ) goto out;
@@ -933,7 +933,7 @@ EXPORT_SYMBOL(dentry_open);static inline int build_open_flags (int flags,umode_t mode,struct open_flags *op) { -int lookup_flags =0 ; +lookup_flags_t lookup_flags =0 ;int acc_mode =ACC_MODE (flags);/*
fs/openpromfs/inode.c +2 -2
@@ -170,13 +170,13 @@ static const struct file_operations openprom_operations = { .llseek = generic_file_llseek, }; -static struct dentry *openpromfs_lookup (struct inode *,struct dentry *,unsigned int ); +static struct dentry *openpromfs_lookup (struct inode *,struct dentry *,lookup_flags_t );static const struct inode_operations openprom_inode_operations = { .lookup = openpromfs_lookup, }; -static struct dentry *openpromfs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +static struct dentry *openpromfs_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {struct op_inode_info *ent_oi, *oi =OP_I (dir);struct device_node *dp, *child;
fs/orangefs/dcache.c +1 -1
@@ -92,7 +92,7 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)* * Should return 1 if dentry can still be trusted, else 0. */ -static int orangefs_d_revalidate (struct dentry *dentry,unsigned int flags) +static int orangefs_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {int ret;unsigned long time = (unsigned long ) dentry->d_fsdata;
fs/orangefs/namei.c +1 -1
@@ -106,7 +106,7 @@ static int orangefs_create(struct inode *dir,* fsid into a handle for the object. */ static struct dentry *orangefs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct orangefs_inode_s *parent =ORANGEFS_I (dir);struct orangefs_kernel_op_s *new_op;
fs/overlayfs/namei.c +1 -1
@@ -816,7 +816,7 @@ static int ovl_fix_origin(struct dentry *dentry, struct dentry *lower, }struct dentry *ovl_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct ovl_entry *oe;const struct cred *old_cred;
fs/overlayfs/overlayfs.h +1 -1
@@ -288,7 +288,7 @@ struct dentry *ovl_lookup_index(struct ovl_fs *ofs, struct dentry *upper, struct dentry *origin, bool verify);int ovl_path_next (int idx,struct dentry *dentry,struct path *path);struct dentry *ovl_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags); +lookup_flags_t flags);bool ovl_lower_positive (struct dentry *dentry); static inline int ovl_verify_origin(struct dentry *upper,
fs/overlayfs/super.c +2 -2
@@ -137,7 +137,7 @@ static struct dentry *ovl_d_real(struct dentry *dentry,return dentry; } -static int ovl_dentry_revalidate (struct dentry *dentry,unsigned int flags) +static int ovl_dentry_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct ovl_entry *oe = dentry->d_fsdata;unsigned int i;
@@ -160,7 +160,7 @@ static int ovl_dentry_revalidate(struct dentry *dentry, unsigned int flags)return 1 ; } -static int ovl_dentry_weak_revalidate (struct dentry *dentry,unsigned int flags) +static int ovl_dentry_weak_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct ovl_entry *oe = dentry->d_fsdata;unsigned int i;
fs/proc/base.c +8 -8
@@ -1817,7 +1817,7 @@ int pid_getattr(const struct path *path, struct kstat *stat,* performed a setuid(), etc. * */ -int pid_revalidate (struct dentry *dentry,unsigned int flags) +int pid_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct inode *inode;struct task_struct *task;
@@ -1950,7 +1950,7 @@ static int dname_to_vma_addr(struct dentry *dentry,return 0 ; } -static int map_files_d_revalidate (struct dentry *dentry,unsigned int flags) +static int map_files_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {unsigned long vm_start, vm_end;bool exact_vma_exists = false;
@@ -2094,7 +2094,7 @@ proc_map_files_instantiate(struct inode *dir, struct dentry *dentry, }static struct dentry *proc_map_files_lookup (struct inode *dir, -struct dentry *dentry,unsigned int flags) +struct dentry *dentry,lookup_flags_t flags) {unsigned long vm_start, vm_end;struct vm_area_struct *vma;
@@ -2621,7 +2621,7 @@ static const struct file_operations proc_attr_dir_operations = { };static struct dentry *proc_attr_dir_lookup (struct inode *dir, -struct dentry *dentry,unsigned int flags) +struct dentry *dentry,lookup_flags_t flags) {return proc_pident_lookup (dir, dentry, attr_dir_stuff,ARRAY_SIZE (attr_dir_stuff));
@@ -3039,7 +3039,7 @@ static const struct file_operations proc_tgid_base_operations = { .llseek = generic_file_llseek, }; -static struct dentry *proc_tgid_base_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +static struct dentry *proc_tgid_base_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {return proc_pident_lookup (dir, dentry, tgid_base_stuff,ARRAY_SIZE (tgid_base_stuff));
@@ -3164,7 +3164,7 @@ static int proc_pid_instantiate(struct inode *dir,return -ENOENT ; } -struct dentry *proc_pid_lookup (struct inode *dir,struct dentry * dentry,unsigned int flags) +struct dentry *proc_pid_lookup (struct inode *dir,struct dentry * dentry,lookup_flags_t flags) {int result = -ENOENT ;struct task_struct *task;
@@ -3417,7 +3417,7 @@ static int proc_tid_base_readdir(struct file *file, struct dir_context *ctx) tid_base_stuff, ARRAY_SIZE(tid_base_stuff)); } -static struct dentry *proc_tid_base_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +static struct dentry *proc_tid_base_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {return proc_pident_lookup (dir, dentry, tid_base_stuff,ARRAY_SIZE (tid_base_stuff));
@@ -3459,7 +3459,7 @@ static int proc_task_instantiate(struct inode *dir,return -ENOENT ; } -static struct dentry *proc_task_lookup (struct inode *dir,struct dentry * dentry,unsigned int flags) +static struct dentry *proc_task_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {int result = -ENOENT ;struct task_struct *task;
fs/proc/fd.c +3 -3
@@ -81,7 +81,7 @@ static const struct file_operations proc_fdinfo_file_operations = { .release = single_release, }; -static int tid_fd_revalidate (struct dentry *dentry,unsigned int flags) +static int tid_fd_revalidate (struct dentry *dentry,lookup_flags_t flags) {struct files_struct *files;struct task_struct *task;
@@ -271,7 +271,7 @@ const struct file_operations proc_fd_operations = { };static struct dentry *proc_lookupfd (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {return proc_lookupfd_common (dir, dentry, proc_fd_instantiate); }
@@ -332,7 +332,7 @@ proc_fdinfo_instantiate(struct inode *dir, struct dentry *dentry, }static struct dentry * -proc_lookupfdinfo (struct inode *dir,struct dentry *dentry,unsigned int flags) +proc_lookupfdinfo (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {return proc_lookupfd_common (dir, dentry, proc_fdinfo_instantiate); }
fs/proc/generic.c +2 -2
@@ -218,7 +218,7 @@ void proc_free_inum(unsigned int inum)ida_simple_remove (&proc_inum_ida, inum -PROC_DYNAMIC_FIRST ); } -static int proc_misc_d_revalidate (struct dentry *dentry,unsigned int flags) +static int proc_misc_d_revalidate (struct dentry *dentry,lookup_flags_t flags) {if (flags &LOOKUP_RCU )return -ECHILD ;
@@ -264,7 +264,7 @@ struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry, }struct dentry *proc_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {return proc_lookup_de (dir, dentry,PDE (dir)); }
fs/proc/internal.h +3 -3
@@ -147,10 +147,10 @@ extern const struct dentry_operations pid_dentry_operations;extern int pid_getattr (const struct path *,struct kstat *,u32 ,unsigned int );extern int proc_setattr (struct dentry *,struct iattr *);extern struct inode *proc_pid_make_inode (struct super_block *,struct task_struct *,umode_t ); -extern int pid_revalidate (struct dentry *,unsigned int ); +int pid_revalidate (struct dentry *,lookup_flags_t );extern int pid_delete_dentry (const struct dentry *);extern int proc_pid_readdir (struct file *,struct dir_context *); -extern struct dentry *proc_pid_lookup (struct inode *,struct dentry *,unsigned int ); +struct dentry *proc_pid_lookup (struct inode *,struct dentry *,lookup_flags_t );extern loff_t mem_lseek (struct file *,loff_t ,int );/* Lookups */
@@ -162,7 +162,7 @@ extern bool proc_fill_cache(struct file *, struct dir_context *, const char *, i/* * generic.c */ -extern struct dentry *proc_lookup (struct inode *,struct dentry *,unsigned int ); +struct dentry *proc_lookup (struct inode *,struct dentry *,lookup_flags_t );struct dentry *proc_lookup_de (struct inode *,struct dentry *,struct proc_dir_entry *);extern int proc_readdir (struct file *,struct dir_context *);int proc_readdir_de (struct file *,struct dir_context *,struct proc_dir_entry *);
fs/proc/namespaces.c +1 -1
@@ -145,7 +145,7 @@ const struct file_operations proc_ns_dir_operations = { };static struct dentry *proc_ns_dir_lookup (struct inode *dir, -struct dentry *dentry,unsigned int flags) +struct dentry *dentry,lookup_flags_t flags) {int error;struct task_struct *task =get_proc_task (dir);
fs/proc/proc_net.c +1 -1
@@ -127,7 +127,7 @@ static struct net *get_proc_task_net(struct inode *dir) }static struct dentry *proc_tgid_net_lookup (struct inode *dir, -struct dentry *dentry,unsigned int flags) +struct dentry *dentry,lookup_flags_t flags) {struct dentry *de;struct net *net;
fs/proc/proc_sysctl.c +2 -2
@@ -522,7 +522,7 @@ static struct ctl_table_header *grab_header(struct inode *inode) }static struct dentry *proc_sys_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct ctl_table_header *head =grab_header (dir);struct ctl_table_header *h =NULL ;
@@ -861,7 +861,7 @@ static const struct inode_operations proc_sys_dir_operations = { .getattr = proc_sys_getattr, }; -static int proc_sys_revalidate (struct dentry *dentry,unsigned int flags) +static int proc_sys_revalidate (struct dentry *dentry,lookup_flags_t flags) {if (flags &LOOKUP_RCU )return -ECHILD ;
fs/proc/root.c +1 -1
@@ -152,7 +152,7 @@ static int proc_root_getattr(const struct path *path, struct kstat *stat,return 0 ; } -static struct dentry *proc_root_lookup (struct inode * dir,struct dentry * dentry,unsigned int flags) +static struct dentry *proc_root_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {if (!proc_pid_lookup (dir, dentry, flags))return NULL ;
fs/qnx4/namei.c +1 -1
@@ -92,7 +92,7 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,return NULL ; } -struct dentry *qnx4_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) +struct dentry *qnx4_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {int ino;struct qnx4_inode_entry *de;
fs/qnx4/qnx4.h +1 -1
@@ -22,7 +22,7 @@ struct qnx4_inode_info { };extern struct inode *qnx4_iget (struct super_block *,unsigned long ); -extern struct dentry *qnx4_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags); +struct dentry *qnx4_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags);extern unsigned long qnx4_count_free_blocks (struct super_block *sb);extern unsigned long qnx4_block_map (struct inode *inode,long iblock);
fs/qnx6/namei.c +1 -1
@@ -14,7 +14,7 @@#include "qnx6.h" struct dentry *qnx6_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {unsigned ino;struct page *page;
fs/qnx6/qnx6.h +1 -1
@@ -46,7 +46,7 @@ struct qnx6_inode_info {extern struct inode *qnx6_iget (struct super_block *sb,unsigned ino);extern struct dentry *qnx6_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags); +lookup_flags_t flags);#ifdef CONFIG_QNX6FS_DEBUG extern void qnx6_superblock_debug(struct qnx6_super_block *,
fs/reiserfs/namei.c +1 -1
@@ -350,7 +350,7 @@ static int reiserfs_find_entry(struct inode *dir, const char *name, int namelen, }static struct dentry *reiserfs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {int retval;struct inode *inode =NULL ;
fs/reiserfs/xattr.c +1 -1
@@ -927,7 +927,7 @@ int reiserfs_permission(struct inode *inode, int mask)return generic_permission (inode, mask); } -static int xattr_hide_revalidate (struct dentry *dentry,unsigned int flags) +static int xattr_hide_revalidate (struct dentry *dentry,lookup_flags_t flags) {return -EPERM ; }
fs/romfs/super.c +1 -1
@@ -210,7 +210,7 @@ static int romfs_readdir(struct file *file, struct dir_context *ctx)* look up an entry in a directory */ static struct dentry *romfs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {unsigned long offset, maxoff;struct inode *inode;
fs/squashfs/namei.c +1 -1
@@ -137,7 +137,7 @@ static int get_dir_index_using_name(struct super_block *sb,static struct dentry *squashfs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {const unsigned char *name = dentry->d_name.name;int len = dentry->d_name.len;
fs/stat.c +2 -2
@@ -168,7 +168,7 @@ int vfs_statx(int dfd, const char __user *filename, int flags, {struct path path;int error = -EINVAL ; -unsigned int lookup_flags =LOOKUP_FOLLOW |LOOKUP_AUTOMOUNT ; +lookup_flags_t lookup_flags =LOOKUP_FOLLOW |LOOKUP_AUTOMOUNT ;if ((flags & ~(AT_SYMLINK_NOFOLLOW |AT_NO_AUTOMOUNT |AT_EMPTY_PATH |KSTAT_QUERY_FLAGS )) !=0 )
@@ -385,7 +385,7 @@ static int do_readlinkat(int dfd, const char __user *pathname,struct path path;int error;int empty =0 ; -unsigned int lookup_flags =LOOKUP_EMPTY ; +lookup_flags_t lookup_flags =LOOKUP_EMPTY ;if (bufsiz <=0 )return -EINVAL ;
fs/statfs.c +1 -1
@@ -82,7 +82,7 @@ int user_statfs(const char __user *pathname, struct kstatfs *st) {struct path path;int error; -unsigned int lookup_flags =LOOKUP_FOLLOW |LOOKUP_AUTOMOUNT ; +lookup_flags_t lookup_flags =LOOKUP_FOLLOW |LOOKUP_AUTOMOUNT ; retry: error =user_path_at (AT_FDCWD , pathname, lookup_flags, &path);if (!error) {
fs/sysv/namei.c +1 -1
@@ -43,7 +43,7 @@ const struct dentry_operations sysv_dentry_operations = { .d_hash = sysv_hash, }; -static struct dentry *sysv_lookup (struct inode * dir,struct dentry * dentry,unsigned int flags) +static struct dentry *sysv_lookup (struct inode * dir,struct dentry * dentry,lookup_flags_t flags) {struct inode * inode =NULL ;ino_t ino;
fs/ubifs/dir.c +1 -1
@@ -209,7 +209,7 @@ static int dbg_check_name(const struct ubifs_info *c, }static struct dentry *ubifs_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {int err;union ubifs_key key;
fs/udf/namei.c +1 -1
@@ -294,7 +294,7 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir, }static struct dentry *udf_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {struct inode *inode =NULL ;struct fileIdentDesc cfi;
fs/ufs/namei.c +1 -1
@@ -49,7 +49,7 @@ static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode)return err; } -static struct dentry *ufs_lookup (struct inode * dir,struct dentry *dentry,unsigned int flags) +static struct dentry *ufs_lookup (struct inode * dir,struct dentry *dentry,lookup_flags_t flags) {struct inode * inode =NULL ;ino_t ino;
fs/utimes.c +1 -1
@@ -144,7 +144,7 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times,fdput (f); }else {struct path path; -int lookup_flags =0 ; +lookup_flags_t lookup_flags =0 ;if (!(flags &AT_SYMLINK_NOFOLLOW )) lookup_flags |=LOOKUP_FOLLOW ;
fs/xattr.c +4 -4
@@ -459,7 +459,7 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,static int path_setxattr (const char __user *pathname,const char __user *name,const void __user *value, -size_t size,int flags,unsigned int lookup_flags) +size_t size,int flags,lookup_flags_t lookup_flags) {struct path path;int error;
@@ -557,7 +557,7 @@ getxattr(struct dentry *d, const char __user *name, void __user *value,static ssize_t path_getxattr (const char __user *pathname,const char __user *name,void __user *value, -size_t size,unsigned int lookup_flags) +size_t size,lookup_flags_t lookup_flags) {struct path path;ssize_t error;
@@ -633,7 +633,7 @@ listxattr(struct dentry *d, char __user *list, size_t size) }static ssize_t path_listxattr (const char __user *pathname,char __user *list, -size_t size,unsigned int lookup_flags) +size_t size,lookup_flags_t lookup_flags) {struct path path;ssize_t error;
@@ -694,7 +694,7 @@ removexattr(struct dentry *d, const char __user *name) }static int path_removexattr (const char __user *pathname, -const char __user *name,unsigned int lookup_flags) +const char __user *name,lookup_flags_t lookup_flags) {struct path path;int error;
fs/xfs/xfs_iops.c +2 -2
@@ -258,7 +258,7 @@ STATIC struct dentry *xfs_vn_lookup ( struct inode *dir, struct dentry *dentry, - unsigned int flags) + lookup_flags_t flags) { struct xfs_inode *cip;struct xfs_name name;
@@ -283,7 +283,7 @@ STATIC struct dentry *xfs_vn_ci_lookup ( struct inode *dir, struct dentry *dentry, - unsigned int flags) + lookup_flags_t flags) { struct xfs_inode *ip;struct xfs_name xname;
include/linux/dcache.h +2 -2
@@ -132,8 +132,8 @@ enum dentry_d_lock_class };struct dentry_operations { -int (*d_revalidate)(struct dentry *,unsigned int ); -int (*d_weak_revalidate)(struct dentry *,unsigned int ); +int (*d_revalidate)(struct dentry *,lookup_flags_t ); +int (*d_weak_revalidate)(struct dentry *,lookup_flags_t );int (*d_hash)(const struct dentry *,struct qstr *);int (*d_compare)(const struct dentry *,unsigned int ,const char *,const struct qstr *);
include/linux/fs.h +3 -3
@@ -1743,7 +1743,7 @@ struct file_operations { } __randomize_layout;struct inode_operations { -struct dentry * (*lookup) (struct inode *,struct dentry *,unsigned int ); +struct dentry * (*lookup) (struct inode *,struct dentry *,lookup_flags_t );const char * (*get_link) (struct dentry *,struct inode *,struct delayed_call *);int (*permission) (struct inode *,int );struct posix_acl * (*get_acl)(struct inode *,int );
@@ -2403,7 +2403,7 @@ extern struct file *file_open_root(struct dentry *, struct vfsmount *,extern struct file *dentry_open (const struct path *,int ,const struct cred *);extern int filp_close (struct file *,fl_owner_t id); -extern struct filename *getname_flags (const char __user *,int ,int *); +struct filename *getname_flags (const char __user *,lookup_flags_t ,int *);extern struct filename *getname (const char __user *);extern struct filename *getname_kernel (const char *);extern void putname (struct filename *name);
@@ -3150,7 +3150,7 @@ extern struct inode *alloc_anon_inode(struct super_block *);extern int simple_nosetlease (struct file *,long ,struct file_lock **,void **);extern const struct dentry_operations simple_dentry_operations; -extern struct dentry *simple_lookup (struct inode *,struct dentry *,unsigned int flags); +struct dentry *simple_lookup (struct inode *,struct dentry *,lookup_flags_t flags);extern ssize_t generic_read_dir (struct file *,char __user *,size_t ,loff_t *);extern const struct file_operations simple_dir_operations;extern const struct inode_operations simple_dir_inode_operations;
include/linux/fscrypt.h +1 -1
@@ -155,7 +155,7 @@ static inline int fscrypt_prepare_rename(struct inode *old_dir,*/ static inline int fscrypt_prepare_lookup (struct inode *dir,struct dentry *dentry, -unsigned int flags) +lookup_flags_t flags) {if (IS_ENCRYPTED (dir))return __fscrypt_prepare_lookup (dir, dentry);
include/linux/namei.h +22 -22
75 lines not on this page · raw message
include/linux/types.h +1 -0
@@ -158,6 +158,7 @@ typedef u32 dma_addr_t;typedef unsigned __bitwise gfp_t ;typedef unsigned __bitwise slab_flags_t ;typedef unsigned __bitwise fmode_t ; +typedef unsigned __bitwise lookup_flags_t ;#ifdef CONFIG_PHYS_ADDR_T_64BIT typedef u64 phys_addr_t ;
kernel/bpf/inode.c +1 -1
@@ -176,7 +176,7 @@ static int bpf_mkmap(struct dentry *dentry, umode_t mode, void *arg) }static struct dentry * -bpf_lookup (struct inode *dir,struct dentry *dentry,unsigned flags) +bpf_lookup (struct inode *dir,struct dentry *dentry,lookup_flags_t flags) {/* Dots in names (e.g. "/sys/fs/bpf/foo.bar") are reserved for future * extensions.