fs: port to const struct mnt_idmap
Subsystems (74)
Christian Brauner
maintainerPATCH 17/27 fs: port ->tmpfile() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/minix/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- include/linux/lsm_hook_defs.h | 2 +- include/linux/security.h | 4 ++-- mm/shmem.c | 2 +- security/integrity/ima/ima_main.c | 2 +- security/security.c | 2 +- 23 files changed, 24 insertions(+), 24 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -86,7 +86,7 @@ prototypes:: int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned open_flag, umode_t create_mode); - int (*tmpfile) (struct mnt_idmap *, struct inode *, + int (*tmpfile) (const struct mnt_idmap *, struct inode *, struct file *, umode_t); int (*fileattr_set)(const struct mnt_idmap *idmap, struct dentry *dentry, struct file_kattr *fa);
Documentation/filesystems/vfs.rst +1 -1
@@ -438,7 +438,7 @@ As of kernel 2.6.22, the following members are defined: void (*sync_lazytime)(struct inode *inode); int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned open_flag, umode_t create_mode); - int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t); + int (*tmpfile) (const struct mnt_idmap *, struct inode *, struct file *, umode_t); struct posix_acl * (*get_acl)(const struct mnt_idmap *, struct dentry *, int); int (*set_acl)(const struct mnt_idmap *, struct dentry *, struct posix_acl *, int); int (*fileattr_set)(const struct mnt_idmap *idmap,
fs/bad_inode.c +1 -1
@@ -146,7 +146,7 @@ static int bad_inode_atomic_open(struct inode *inode, struct dentry *dentry,return -EIO ; } -static int bad_inode_tmpfile (struct mnt_idmap *idmap, +static int bad_inode_tmpfile (const struct mnt_idmap *idmap,struct inode *inode,struct file *file,umode_t mode) {
fs/btrfs/inode.c +1 -1
@@ -9391,7 +9391,7 @@ static int btrfs_permission(const struct mnt_idmap *idmap,return generic_permission (idmap, inode, mask); } -static int btrfs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct btrfs_fs_info *fs_info =inode_to_fs_info (dir);
fs/ext2/namei.c +1 -1
@@ -117,7 +117,7 @@ static int ext2_create (struct mnt_idmap * idmap,return ext2_add_nondir (dentry, inode); } -static int ext2_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ext2_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode =ext2_new_inode (dir, mode,NULL );
fs/ext4/namei.c +1 -1
@@ -2881,7 +2881,7 @@ static int ext4_mknod(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ext4_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {handle_t *handle;
fs/f2fs/namei.c +1 -1
@@ -928,7 +928,7 @@ static int __f2fs_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int f2fs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);
fs/fuse/dir.c +1 -1
@@ -1098,7 +1098,7 @@ static int fuse_create(struct mnt_idmap *idmap, struct inode *dir,return fuse_mknod (idmap, dir, entry, mode,0 ); } -static int fuse_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct fuse_conn *fc =get_fuse_conn (dir);
fs/hugetlbfs/inode.c +1 -1
@@ -984,7 +984,7 @@ static int hugetlbfs_create(struct mnt_idmap *idmap,return hugetlbfs_mknod (idmap, dir, dentry, mode |S_IFREG ,0 ); } -static int hugetlbfs_tmpfile (struct mnt_idmap *idmap, +static int hugetlbfs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {
fs/minix/namei.c +1 -1
@@ -50,7 +50,7 @@ static int minix_mknod(struct mnt_idmap *idmap, struct inode *dir,return add_nondir (dentry, inode); } -static int minix_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int minix_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode =minix_new_inode (dir, mode);
fs/overlayfs/dir.c +1 -1
@@ -1420,7 +1420,7 @@ static int ovl_dummy_open(struct inode *inode, struct file *file)return 0 ; } -static int ovl_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {int err;
fs/ramfs/inode.c +1 -1
@@ -163,7 +163,7 @@ static int ramfs_symlink(struct mnt_idmap *idmap, struct inode *dir,return error; } -static int ramfs_tmpfile (struct mnt_idmap *idmap, +static int ramfs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode;
fs/smb/client/cifsfs.h +1 -1
@@ -57,7 +57,7 @@ int cifs_create(struct mnt_idmap *idmap, struct inode *dir, struct dentry *direntry, umode_t mode);int cifs_atomic_open (struct inode *dir,struct dentry *direntry,struct file *file,unsigned int oflags,umode_t mode); -int cifs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +int cifs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode);struct dentry *cifs_lookup (struct inode *parent_dir_inode,struct dentry *direntry,unsigned int flags);
fs/smb/client/dir.c +1 -1
@@ -1059,7 +1059,7 @@ static int set_tmpfile_attr(const unsigned int xid, unsigned int oflags,* The initial dentry state is unhashed-negative. On success, dentry will * become unhashed-positive by calling d_instantiate(). */ -int cifs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +int cifs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct dentry *dentry = file->f_path.dentry;
fs/ubifs/dir.c +1 -1
@@ -440,7 +440,7 @@ static void unlock_2_inodes(struct inode *inode1, struct inode *inode2)mutex_unlock (&ubifs_inode (inode1)->ui_mutex); } -static int ubifs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct dentry *dentry = file->f_path.dentry;
fs/udf/namei.c +1 -1
@@ -386,7 +386,7 @@ static int udf_create(struct mnt_idmap *idmap, struct inode *dir,return udf_add_nondir (dentry, inode); } -static int udf_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int udf_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode =udf_new_inode (dir, mode);
fs/xfs/xfs_iops.c +1 -1
@@ -1250,7 +1250,7 @@ xfs_vn_fiemap( STATIC intxfs_vn_tmpfile ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode)
include/linux/fs.h +1 -1
@@ -2024,7 +2024,7 @@ struct inode_operations {int (*atomic_open)(struct inode *,struct dentry *,struct file *,unsigned open_flag,umode_t create_mode); -int (*tmpfile) (struct mnt_idmap *,struct inode *, +int (*tmpfile) (const struct mnt_idmap *,struct inode *,struct file *,umode_t );struct posix_acl *(*get_acl)(const struct mnt_idmap *,struct dentry *,int );
include/linux/lsm_hook_defs.h +1 -1
@@ -122,7 +122,7 @@ LSM_HOOK(int, 0, inode_init_security_anon, struct inode *inode, const struct qstr *name, const struct inode *context_inode) LSM_HOOK(int, 0, inode_create, struct inode *dir, struct dentry *dentry, umode_t mode) -LSM_HOOK(void, LSM_RET_VOID, inode_post_create_tmpfile, struct mnt_idmap *idmap, +LSM_HOOK(void, LSM_RET_VOID, inode_post_create_tmpfile, const struct mnt_idmap *idmap, struct inode *inode) LSM_HOOK(int, 0, inode_link, struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry)
include/linux/security.h +2 -2
@@ -405,7 +405,7 @@ int security_inode_init_security_anon(struct inode *inode,const struct qstr *name, const struct inode *context_inode);int security_inode_create (struct inode *dir,struct dentry *dentry,umode_t mode); -void security_inode_post_create_tmpfile (struct mnt_idmap *idmap, +void security_inode_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode);int security_inode_link (struct dentry *old_dentry,struct inode *dir,struct dentry *new_dentry);
@@ -910,7 +910,7 @@ static inline int security_inode_create(struct inode *dir, }static inline void -security_inode_post_create_tmpfile (struct mnt_idmap *idmap,struct inode *inode) +security_inode_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode) { } static inline int security_inode_link(struct dentry *old_dentry,
mm/shmem.c +1 -1
@@ -3857,7 +3857,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, }static int -shmem_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +shmem_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode;
security/integrity/ima/ima_main.c +1 -1
@@ -846,7 +846,7 @@ EXPORT_SYMBOL_GPL(ima_inode_hash);* Skip calling process_measurement(), but indicate which newly, created * tmpfiles are in policy. */ -static void ima_post_create_tmpfile (struct mnt_idmap *idmap, +static void ima_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode) {
security/security.c +1 -1
@@ -1638,7 +1638,7 @@ EXPORT_SYMBOL_GPL(security_inode_create);* * Update inode security data after a tmpfile has been created. */ -void security_inode_post_create_tmpfile (struct mnt_idmap *idmap, +void security_inode_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode) {if (unlikely (IS_PRIVATE (inode)))
Signature · 1 line
2.53.0
Re: [PATCH 17/27] fs: port ->tmpfile() to pass const mnt_idmap
Quoted 8 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
Quoted 7 lines
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 338 lines
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/minix/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- include/linux/lsm_hook_defs.h | 2 +- include/linux/security.h | 4 ++-- mm/shmem.c | 2 +- security/integrity/ima/ima_main.c | 2 +- security/security.c | 2 +- 23 files changed, 24 insertions(+), 24 deletions(-)Documentation/filesystems/locking.rst +1
-1@@ -86,7 +86,7 @@ prototypes:: int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned open_flag, umode_t create_mode); - int (*tmpfile) (struct mnt_idmap *, struct inode *, + int (*tmpfile) (const struct mnt_idmap *, struct inode *, struct file *, umode_t); int (*fileattr_set)(const struct mnt_idmap *idmap, struct dentry *dentry, struct file_kattr *fa);Documentation/filesystems/vfs.rst +1
-1@@ -438,7 +438,7 @@ As of kernel 2.6.22, the following members are defined: void (*sync_lazytime)(struct inode *inode); int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned open_flag, umode_t create_mode); - int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t); + int (*tmpfile) (const struct mnt_idmap *, struct inode *, struct file *, umode_t); struct posix_acl * (*get_acl)(const struct mnt_idmap *, struct dentry *, int); int (*set_acl)(const struct mnt_idmap *, struct dentry *, struct posix_acl *, int); int (*fileattr_set)(const struct mnt_idmap *idmap,fs/bad_inode.c +1
-1@@ -146,7 +146,7 @@ static int bad_inode_atomic_open(struct inode *inode, struct dentry *dentry,return -EIO ; } -static int bad_inode_tmpfile (struct mnt_idmap *idmap, +static int bad_inode_tmpfile (const struct mnt_idmap *idmap,struct inode *inode,struct file *file,umode_t mode) {fs/btrfs/inode.c +1
-1@@ -9391,7 +9391,7 @@ static int btrfs_permission(const struct mnt_idmap *idmap,return generic_permission (idmap, inode, mask); } -static int btrfs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct btrfs_fs_info *fs_info =inode_to_fs_info (dir);fs/ext2/namei.c +1
-1@@ -117,7 +117,7 @@ static int ext2_create (struct mnt_idmap * idmap,return ext2_add_nondir (dentry, inode); } -static int ext2_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ext2_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode =ext2_new_inode (dir, mode,NULL );fs/ext4/namei.c +1
-1@@ -2881,7 +2881,7 @@ static int ext4_mknod(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ext4_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {handle_t *handle;fs/f2fs/namei.c +1
-1@@ -928,7 +928,7 @@ static int __f2fs_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int f2fs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);fs/fuse/dir.c +1
-1@@ -1098,7 +1098,7 @@ static int fuse_create(struct mnt_idmap *idmap, struct inode *dir,return fuse_mknod (idmap, dir, entry, mode,0 ); } -static int fuse_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct fuse_conn *fc =get_fuse_conn (dir);fs/hugetlbfs/inode.c +1
-1@@ -984,7 +984,7 @@ static int hugetlbfs_create(struct mnt_idmap *idmap,return hugetlbfs_mknod (idmap, dir, dentry, mode |S_IFREG ,0 ); } -static int hugetlbfs_tmpfile (struct mnt_idmap *idmap, +static int hugetlbfs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {fs/minix/namei.c +1
-1@@ -50,7 +50,7 @@ static int minix_mknod(struct mnt_idmap *idmap, struct inode *dir,return add_nondir (dentry, inode); } -static int minix_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int minix_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode =minix_new_inode (dir, mode);fs/overlayfs/dir.c +1
-1@@ -1420,7 +1420,7 @@ static int ovl_dummy_open(struct inode *inode, struct file *file)return 0 ; } -static int ovl_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {int err;fs/ramfs/inode.c +1
-1@@ -163,7 +163,7 @@ static int ramfs_symlink(struct mnt_idmap *idmap, struct inode *dir,return error; } -static int ramfs_tmpfile (struct mnt_idmap *idmap, +static int ramfs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode;fs/smb/client/cifsfs.h +1
-1@@ -57,7 +57,7 @@ int cifs_create(struct mnt_idmap *idmap, struct inode *dir, struct dentry *direntry, umode_t mode);int cifs_atomic_open (struct inode *dir,struct dentry *direntry,struct file *file,unsigned int oflags,umode_t mode); -int cifs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +int cifs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode);struct dentry *cifs_lookup (struct inode *parent_dir_inode,struct dentry *direntry,unsigned int flags);fs/smb/client/dir.c +1
-1@@ -1059,7 +1059,7 @@ static int set_tmpfile_attr(const unsigned int xid, unsigned int oflags,* The initial dentry state is unhashed-negative. On success, dentry will * become unhashed-positive by calling d_instantiate(). */ -int cifs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +int cifs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct dentry *dentry = file->f_path.dentry;fs/ubifs/dir.c +1
-1@@ -440,7 +440,7 @@ static void unlock_2_inodes(struct inode *inode1, struct inode *inode2)mutex_unlock (&ubifs_inode (inode1)->ui_mutex); } -static int ubifs_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct dentry *dentry = file->f_path.dentry;fs/udf/namei.c +1
-1@@ -386,7 +386,7 @@ static int udf_create(struct mnt_idmap *idmap, struct inode *dir,return udf_add_nondir (dentry, inode); } -static int udf_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +static int udf_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode =udf_new_inode (dir, mode);fs/xfs/xfs_iops.c +1
-1@@ -1250,7 +1250,7 @@ xfs_vn_fiemap( STATIC intxfs_vn_tmpfile ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode)include/linux/fs.h +1
-1@@ -2024,7 +2024,7 @@ struct inode_operations {int (*atomic_open)(struct inode *,struct dentry *,struct file *,unsigned open_flag,umode_t create_mode); -int (*tmpfile) (struct mnt_idmap *,struct inode *, +int (*tmpfile) (const struct mnt_idmap *,struct inode *,struct file *,umode_t );struct posix_acl *(*get_acl)(const struct mnt_idmap *,struct dentry *,int );include/linux/lsm_hook_defs.h +1
-1@@ -122,7 +122,7 @@ LSM_HOOK(int, 0, inode_init_security_anon, struct inode *inode, const struct qstr *name, const struct inode *context_inode) LSM_HOOK(int, 0, inode_create, struct inode *dir, struct dentry *dentry, umode_t mode) -LSM_HOOK(void, LSM_RET_VOID, inode_post_create_tmpfile, struct mnt_idmap *idmap, +LSM_HOOK(void, LSM_RET_VOID, inode_post_create_tmpfile, const struct mnt_idmap *idmap, struct inode *inode) LSM_HOOK(int, 0, inode_link, struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry)include/linux/security.h +2
-2@@ -405,7 +405,7 @@ int security_inode_init_security_anon(struct inode *inode,const struct qstr *name, const struct inode *context_inode);int security_inode_create (struct inode *dir,struct dentry *dentry,umode_t mode); -void security_inode_post_create_tmpfile (struct mnt_idmap *idmap, +void security_inode_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode);int security_inode_link (struct dentry *old_dentry,struct inode *dir,struct dentry *new_dentry);@@ -910,7 +910,7 @@ static inline int security_inode_create(struct inode *dir, }static inline void -security_inode_post_create_tmpfile (struct mnt_idmap *idmap,struct inode *inode) +security_inode_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode) { } static inline int security_inode_link(struct dentry *old_dentry,mm/shmem.c +1
-1@@ -3857,7 +3857,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, }static int -shmem_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +shmem_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct file *file,umode_t mode) {struct inode *inode;security/integrity/ima/ima_main.c +1
-1@@ -846,7 +846,7 @@ EXPORT_SYMBOL_GPL(ima_inode_hash);* Skip calling process_measurement(), but indicate which newly, created * tmpfiles are in policy. */ -static void ima_post_create_tmpfile (struct mnt_idmap *idmap, +static void ima_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode) {security/security.c +1
-1@@ -1638,7 +1638,7 @@ EXPORT_SYMBOL_GPL(security_inode_create);* * Update inode security data after a tmpfile has been created. */ -void security_inode_post_create_tmpfile (struct mnt_idmap *idmap, +void security_inode_post_create_tmpfile (const struct mnt_idmap *idmap,struct inode *inode) {if (unlikely (IS_PRIVATE (inode)))Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 17/27] fs: port ->tmpfile() to pass const mnt_idmap
In reply to Christian BraunerQuoted 34 lines · On Sep 1, 2026 Christian Brauner <[email protected]> wrote:
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>Reviewed-by Jan Kara <[email protected]>--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/minix/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +-
Quoted 8 lines
fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- include/linux/lsm_hook_defs.h | 2 +- include/linux/security.h | 4 ++-- mm/shmem.c | 2 +- security/integrity/ima/ima_main.c | 2 +- security/security.c | 2 +- 23 files changed, 24 insertions(+), 24 deletions(-)
--
paul-moore.com
Christian Brauner
maintainerPATCH 18/27 fs: port ->mknod() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 4 ++-- fs/gfs2/inode.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- include/linux/lsm_hook_defs.h | 2 +- include/linux/security.h | 4 ++-- mm/shmem.c | 4 ++-- security/integrity/evm/evm_main.c | 2 +- security/integrity/ima/ima_main.c | 2 +- security/security.c | 2 +- 41 files changed, 46 insertions(+), 46 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -68,7 +68,7 @@ prototypes:: int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); - int (*mknod) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); + int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int);
Documentation/filesystems/vfs.rst +1 -1
@@ -422,7 +422,7 @@ As of kernel 2.6.22, the following members are defined: int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); - int (*mknod) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); + int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int);
fs/9p/vfs_inode.c +1 -1
@@ -1304,7 +1304,7 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir,*/ static int -v9fs_vfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct v9fs_session_info *v9ses =v9fs_inode2v9ses (dir);
fs/9p/vfs_inode_dotl.c +2 -2
@@ -29,7 +29,7 @@#include "acl.h" static int -v9fs_vfs_mknod_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_mknod_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode,dev_t rdev);/**
@@ -809,7 +809,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,* */ static int -v9fs_vfs_mknod_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_mknod_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode,dev_t rdev) {int err;
fs/bad_inode.c +1 -1
@@ -69,7 +69,7 @@ static int bad_inode_rmdir (struct inode *dir, struct dentry *dentry)return -EIO ; } -static int bad_inode_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int bad_inode_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {return -EIO ;
fs/btrfs/inode.c +1 -1
@@ -7004,7 +7004,7 @@ static int btrfs_create_common(struct inode *dir, struct dentry *dentry,return ret; } -static int btrfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;
fs/ceph/dir.c +1 -1
@@ -921,7 +921,7 @@ int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry)return PTR_ERR (result); } -static int ceph_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ceph_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct ceph_mds_client *mdsc =ceph_sb_to_mdsc (dir->i_sb);
fs/ecryptfs/inode.c +1 -1
@@ -562,7 +562,7 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) }static int -ecryptfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +ecryptfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {int rc;
fs/ext2/namei.c +1 -1
@@ -131,7 +131,7 @@ static int ext2_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return finish_open_simple (file,0 ); } -static int ext2_mknod (struct mnt_idmap * idmap,struct inode * dir, +static int ext2_mknod (const struct mnt_idmap * idmap,struct inode * dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode * inode;
fs/ext4/namei.c +1 -1
@@ -2847,7 +2847,7 @@ static int ext4_create(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ext4_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {handle_t *handle;
fs/f2fs/namei.c +1 -1
@@ -810,7 +810,7 @@ static int f2fs_rmdir(struct inode *dir, struct dentry *dentry)return -ENOTEMPTY ; } -static int f2fs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);
fs/fuse/dir.c +2 -2
@@ -934,7 +934,7 @@ static int fuse_create_open(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int fuse_mknod (struct mnt_idmap *,struct inode *,struct dentry *, +static int fuse_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); static int fuse_atomic_open(struct inode *dir, struct dentry *entry, struct file *file, unsigned flags,
@@ -1069,7 +1069,7 @@ static int create_new_nondir(const struct mnt_idmap *idmap, struct fuse_mount *freturn PTR_ERR (create_new_entry (idmap, fm, args, dir, entry, mode)); } -static int fuse_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,umode_t mode,dev_t rdev) {struct fuse_mknod_in inarg;
fs/gfs2/inode.c +1 -1
@@ -1363,7 +1363,7 @@ static struct dentry *gfs2_mkdir(struct mnt_idmap *idmap, struct inode *dir,* */ -static int gfs2_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int gfs2_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {return gfs2_create_inode (dir, dentry,NULL , mode, dev,NULL ,0 ,0 );
fs/hfsplus/dir.c +1 -1
@@ -511,7 +511,7 @@ static int hfsplus_symlink(struct mnt_idmap *idmap, struct inode *dir,return res; } -static int hfsplus_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hfsplus_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);
fs/hostfs/hostfs_kern.c +1 -1
@@ -719,7 +719,7 @@ static int hostfs_rmdir(struct inode *ino, struct dentry *dentry)return err; } -static int hostfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hostfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode *inode;
fs/hpfs/namei.c +1 -1
@@ -215,7 +215,7 @@ static int hpfs_create(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int hpfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hpfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {const unsigned char *name = dentry->d_name.name;
fs/hugetlbfs/inode.c +1 -1
@@ -954,7 +954,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,/* * File creation. Allocate an inode, and we're done.. */ -static int hugetlbfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hugetlbfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode *inode;
fs/jffs2/dir.c +2 -2
@@ -36,7 +36,7 @@ static int jffs2_symlink (struct mnt_idmap *, struct inode *,static struct dentry *jffs2_mkdir (struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static int jffs2_rmdir (struct inode *,struct dentry *); -static int jffs2_mknod (struct mnt_idmap *,struct inode *,struct dentry *, +static int jffs2_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); static int jffs2_rename (struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *,
@@ -620,7 +620,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)return ret; } -static int jffs2_mknod (struct mnt_idmap *idmap,struct inode *dir_i, +static int jffs2_mknod (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,umode_t mode,dev_t rdev) {struct jffs2_inode_info *f, *dir_f;
fs/jfs/namei.c +1 -1
@@ -1355,7 +1355,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,* * FUNCTION: Create a special file (device) */ -static int jfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int jfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct jfs_inode_info *jfs_ip;
fs/minix/namei.c +1 -1
@@ -33,7 +33,7 @@ static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, unreturn d_splice_alias (inode, dentry); } -static int minix_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int minix_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;
fs/nfs/dir.c +1 -1
@@ -2448,7 +2448,7 @@ EXPORT_SYMBOL_GPL(nfs_create);* See comments for nfs_proc_create regarding failed operations. */ int -nfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +nfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct iattr attr;
fs/nfs/internal.h +1 -1
@@ -405,7 +405,7 @@ int nfs_unlink(struct inode *, struct dentry *);int nfs_symlink (struct mnt_idmap *,struct inode *,struct dentry *,const char *);int nfs_link (struct dentry *,struct inode *,struct dentry *); -int nfs_mknod (struct mnt_idmap *,struct inode *,struct dentry *,umode_t , +int nfs_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t );int nfs_rename (struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );
fs/nilfs2/namei.c +1 -1
@@ -113,7 +113,7 @@ static int nilfs_create(struct mnt_idmap *idmap, struct inode *dir, }static int -nilfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +nilfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;
fs/ntfs/namei.c +1 -1
@@ -1447,7 +1447,7 @@ static int ntfs_symlink(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ntfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct super_block *sb = dir->i_sb;
fs/ntfs3/namei.c +1 -1
@@ -121,7 +121,7 @@ static int ntfs_create(struct mnt_idmap *idmap, struct inode *dir,/* * ntfs_mknod - inode_operations::mknod */ -static int ntfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) { return ntfs_create_inode(idmap, dir, dentry, NULL, mode, rdev, NULL, 0,
fs/ocfs2/namei.c +1 -1
@@ -227,7 +227,7 @@ static void ocfs2_cleanup_add_entry_failure(struct ocfs2_super *osb,iput (inode); } -static int ocfs2_mknod(struct mnt_idmap *idmap, +static int ocfs2_mknod(const struct mnt_idmap *idmap, struct inode *dir, struct dentry *dentry, umode_t mode,
fs/overlayfs/dir.c +1 -1
@@ -742,7 +742,7 @@ static struct dentry *ovl_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ERR_PTR (ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFDIR ,0 ,NULL )); } -static int ovl_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {/* Don't allow creation of "whiteout" on overlay */
fs/ramfs/inode.c +1 -1
@@ -95,7 +95,7 @@ struct inode *ramfs_get_inode(struct super_block *sb,*/ /* SMP-safe */ static int -ramfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +ramfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode * inode =ramfs_get_inode (dir->i_sb, dir, mode, dev);
fs/smb/client/cifsfs.h +1 -1
@@ -64,7 +64,7 @@ struct dentry *cifs_lookup(struct inode *parent_dir_inode,int cifs_unlink (struct inode *dir,struct dentry *dentry);int cifs_hardlink (struct dentry *old_file,struct inode *inode,struct dentry *direntry); -int cifs_mknod (struct mnt_idmap *idmap,struct inode *inode, +int cifs_mknod (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode,dev_t device_number);struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode);
fs/smb/client/dir.c +1 -1
@@ -696,7 +696,7 @@ int cifs_create(struct mnt_idmap *idmap, struct inode *dir,return rc; } -int cifs_mknod (struct mnt_idmap *idmap,struct inode *inode, +int cifs_mknod (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode,dev_t device_number) {int rc = -EPERM ;
fs/ubifs/dir.c +1 -1
@@ -1077,7 +1077,7 @@ static struct dentry *ubifs_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ERR_PTR (err); } -static int ubifs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;
fs/udf/namei.c +1 -1
@@ -403,7 +403,7 @@ static int udf_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return finish_open_simple (file,0 ); } -static int udf_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int udf_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;
fs/ufs/namei.c +1 -1
@@ -85,7 +85,7 @@ static int ufs_create (struct mnt_idmap * idmap,return ufs_add_nondir (dentry, inode); } -static int ufs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ufs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;
fs/xfs/xfs_iops.c +1 -1
@@ -279,7 +279,7 @@ xfs_generic_create( STATIC int xfs_vn_mknod( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct inode *dir, struct dentry *dentry, umode_t mode,
include/linux/fs.h +1 -1
@@ -2008,7 +2008,7 @@ struct inode_operations {struct dentry *(*mkdir) (struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int (*rmdir) (struct inode *,struct dentry *); -int (*mknod) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*mknod) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t );int (*rename) (struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );
include/linux/lsm_hook_defs.h +1 -1
@@ -94,7 +94,7 @@ LSM_HOOK(int, 0, path_mkdir, const struct path *dir, struct dentry *dentry, LSM_HOOK(int, 0, path_rmdir, const struct path *dir, struct dentry *dentry) LSM_HOOK(int, 0, path_mknod, const struct path *dir, struct dentry *dentry, umode_t mode, unsigned int dev) -LSM_HOOK(void, LSM_RET_VOID, path_post_mknod, struct mnt_idmap *idmap, +LSM_HOOK(void, LSM_RET_VOID, path_post_mknod, const struct mnt_idmap *idmap, struct dentry *dentry) LSM_HOOK(int, 0, path_truncate, const struct path *path) LSM_HOOK(int, 0, path_symlink, const struct path *dir, struct dentry *dentry,
include/linux/security.h +2 -2
@@ -2085,7 +2085,7 @@ int security_path_mkdir(const struct path *dir, struct dentry *dentry, umode_t mint security_path_rmdir (const struct path *dir,struct dentry *dentry);int security_path_mknod (const struct path *dir,struct dentry *dentry,umode_t mode,unsigned int dev); -void security_path_post_mknod (struct mnt_idmap *idmap,struct dentry *dentry); +void security_path_post_mknod (const struct mnt_idmap *idmap,struct dentry *dentry);int security_path_truncate (const struct path *path);int security_path_symlink (const struct path *dir,struct dentry *dentry,const char *old_name);
@@ -2120,7 +2120,7 @@ static inline int security_path_mknod(const struct path *dir, struct dentry *denreturn 0 ; } -static inline void security_path_post_mknod (struct mnt_idmap *idmap, +static inline void security_path_post_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) { }
mm/shmem.c +2 -2
@@ -3818,7 +3818,7 @@ static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf)* File creation. Allocate an inode, and we're done.. */ static int -shmem_mknod (struct mnt_idmap *idmap,struct inode *dir, +shmem_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode *inode;
@@ -3970,7 +3970,7 @@ static int shmem_rmdir(struct inode *dir, struct dentry *dentry)return shmem_unlink (dir, dentry); } -static int shmem_whiteout (struct mnt_idmap *idmap, +static int shmem_whiteout (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry) {struct dentry *whiteout;
security/integrity/evm/evm_main.c +1 -1
@@ -1140,7 +1140,7 @@ static void evm_file_release(struct file *file) iint->flags &= ~EVM_NEW_FILE ; } -static void evm_post_path_mknod (struct mnt_idmap *idmap,struct dentry *dentry) +static void evm_post_path_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) {struct inode *inode =d_backing_inode (dentry);struct evm_iint_cache *iint =evm_iint_inode (inode);
security/integrity/ima/ima_main.c +1 -1
@@ -879,7 +879,7 @@ static void ima_post_create_tmpfile(const struct mnt_idmap *idmap,* Mark files created via the mknodat syscall as new, so that the * file data can be written later. */ -static void ima_post_path_mknod (struct mnt_idmap *idmap,struct dentry *dentry) +static void ima_post_path_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) {struct ima_iint_cache *iint;struct inode *inode = dentry->d_inode;
security/security.c +1 -1
@@ -1425,7 +1425,7 @@ EXPORT_SYMBOL(security_path_mknod);* * Update inode security field after a regular file has been created. */ -void security_path_post_mknod (struct mnt_idmap *idmap,struct dentry *dentry) +void security_path_post_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) {if (unlikely (IS_PRIVATE (d_backing_inode (dentry))))return ;
Signature · 1 line
2.53.0
Re: [PATCH 18/27] fs: port ->mknod() to pass const mnt_idmap
Quoted 8 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
Quoted 7 lines
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 626 lines
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 4 ++-- fs/gfs2/inode.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- include/linux/lsm_hook_defs.h | 2 +- include/linux/security.h | 4 ++-- mm/shmem.c | 4 ++-- security/integrity/evm/evm_main.c | 2 +- security/integrity/ima/ima_main.c | 2 +- security/security.c | 2 +- 41 files changed, 46 insertions(+), 46 deletions(-)Documentation/filesystems/locking.rst +1
-1@@ -68,7 +68,7 @@ prototypes:: int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); - int (*mknod) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); + int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int);Documentation/filesystems/vfs.rst +1
-1@@ -422,7 +422,7 @@ As of kernel 2.6.22, the following members are defined: int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); - int (*mknod) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); + int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int);fs/9p/vfs_inode.c +1
-1@@ -1304,7 +1304,7 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir,*/ static int -v9fs_vfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct v9fs_session_info *v9ses =v9fs_inode2v9ses (dir);fs/9p/vfs_inode_dotl.c +2
-2@@ -29,7 +29,7 @@#include "acl.h" static int -v9fs_vfs_mknod_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_mknod_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode,dev_t rdev);/** @@ -809,7 +809,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,* */ static int -v9fs_vfs_mknod_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_mknod_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode,dev_t rdev) {int err;fs/bad_inode.c +1
-1@@ -69,7 +69,7 @@ static int bad_inode_rmdir (struct inode *dir, struct dentry *dentry)return -EIO ; } -static int bad_inode_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int bad_inode_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {return -EIO ;fs/btrfs/inode.c +1
-1@@ -7004,7 +7004,7 @@ static int btrfs_create_common(struct inode *dir, struct dentry *dentry,return ret; } -static int btrfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;fs/ceph/dir.c +1
-1@@ -921,7 +921,7 @@ int ceph_handle_notrace_create(struct inode *dir, struct dentry *dentry)return PTR_ERR (result); } -static int ceph_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ceph_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct ceph_mds_client *mdsc =ceph_sb_to_mdsc (dir->i_sb);fs/ecryptfs/inode.c +1
-1@@ -562,7 +562,7 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) }static int -ecryptfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +ecryptfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {int rc;fs/ext2/namei.c +1
-1@@ -131,7 +131,7 @@ static int ext2_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return finish_open_simple (file,0 ); } -static int ext2_mknod (struct mnt_idmap * idmap,struct inode * dir, +static int ext2_mknod (const struct mnt_idmap * idmap,struct inode * dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode * inode;fs/ext4/namei.c +1
-1@@ -2847,7 +2847,7 @@ static int ext4_create(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ext4_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {handle_t *handle;fs/f2fs/namei.c +1
-1@@ -810,7 +810,7 @@ static int f2fs_rmdir(struct inode *dir, struct dentry *dentry)return -ENOTEMPTY ; } -static int f2fs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);fs/fuse/dir.c +2
-2@@ -934,7 +934,7 @@ static int fuse_create_open(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int fuse_mknod (struct mnt_idmap *,struct inode *,struct dentry *, +static int fuse_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); static int fuse_atomic_open(struct inode *dir, struct dentry *entry, struct file *file, unsigned flags,@@ -1069,7 +1069,7 @@ static int create_new_nondir(const struct mnt_idmap *idmap, struct fuse_mount *freturn PTR_ERR (create_new_entry (idmap, fm, args, dir, entry, mode)); } -static int fuse_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,umode_t mode,dev_t rdev) {struct fuse_mknod_in inarg;fs/gfs2/inode.c +1
-1@@ -1363,7 +1363,7 @@ static struct dentry *gfs2_mkdir(struct mnt_idmap *idmap, struct inode *dir,* */ -static int gfs2_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int gfs2_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {return gfs2_create_inode (dir, dentry,NULL , mode, dev,NULL ,0 ,0 );fs/hfsplus/dir.c +1
-1@@ -511,7 +511,7 @@ static int hfsplus_symlink(struct mnt_idmap *idmap, struct inode *dir,return res; } -static int hfsplus_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hfsplus_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);fs/hostfs/hostfs_kern.c +1
-1@@ -719,7 +719,7 @@ static int hostfs_rmdir(struct inode *ino, struct dentry *dentry)return err; } -static int hostfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hostfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode *inode;fs/hpfs/namei.c +1
-1@@ -215,7 +215,7 @@ static int hpfs_create(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int hpfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hpfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {const unsigned char *name = dentry->d_name.name;fs/hugetlbfs/inode.c +1
-1@@ -954,7 +954,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,/* * File creation. Allocate an inode, and we're done.. */ -static int hugetlbfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int hugetlbfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode *inode;fs/jffs2/dir.c +2
-2@@ -36,7 +36,7 @@ static int jffs2_symlink (struct mnt_idmap *, struct inode *,static struct dentry *jffs2_mkdir (struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static int jffs2_rmdir (struct inode *,struct dentry *); -static int jffs2_mknod (struct mnt_idmap *,struct inode *,struct dentry *, +static int jffs2_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); static int jffs2_rename (struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *,@@ -620,7 +620,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)return ret; } -static int jffs2_mknod (struct mnt_idmap *idmap,struct inode *dir_i, +static int jffs2_mknod (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,umode_t mode,dev_t rdev) {struct jffs2_inode_info *f, *dir_f;fs/jfs/namei.c +1
-1@@ -1355,7 +1355,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir,* * FUNCTION: Create a special file (device) */ -static int jfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int jfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct jfs_inode_info *jfs_ip;fs/minix/namei.c +1
-1@@ -33,7 +33,7 @@ static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, unreturn d_splice_alias (inode, dentry); } -static int minix_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int minix_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;fs/nfs/dir.c +1
-1@@ -2448,7 +2448,7 @@ EXPORT_SYMBOL_GPL(nfs_create);* See comments for nfs_proc_create regarding failed operations. */ int -nfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +nfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct iattr attr;fs/nfs/internal.h +1
-1@@ -405,7 +405,7 @@ int nfs_unlink(struct inode *, struct dentry *);int nfs_symlink (struct mnt_idmap *,struct inode *,struct dentry *,const char *);int nfs_link (struct dentry *,struct inode *,struct dentry *); -int nfs_mknod (struct mnt_idmap *,struct inode *,struct dentry *,umode_t , +int nfs_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t );int nfs_rename (struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );fs/nilfs2/namei.c +1
-1@@ -113,7 +113,7 @@ static int nilfs_create(struct mnt_idmap *idmap, struct inode *dir, }static int -nilfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +nilfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;fs/ntfs/namei.c +1
-1@@ -1447,7 +1447,7 @@ static int ntfs_symlink(struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ntfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct super_block *sb = dir->i_sb;fs/ntfs3/namei.c +1
-1@@ -121,7 +121,7 @@ static int ntfs_create(struct mnt_idmap *idmap, struct inode *dir,/* * ntfs_mknod - inode_operations::mknod */ -static int ntfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) { return ntfs_create_inode(idmap, dir, dentry, NULL, mode, rdev, NULL, 0,fs/ocfs2/namei.c +1
-1@@ -227,7 +227,7 @@ static void ocfs2_cleanup_add_entry_failure(struct ocfs2_super *osb,iput (inode); } -static int ocfs2_mknod(struct mnt_idmap *idmap, +static int ocfs2_mknod(const struct mnt_idmap *idmap, struct inode *dir, struct dentry *dentry, umode_t mode,fs/overlayfs/dir.c +1
-1@@ -742,7 +742,7 @@ static struct dentry *ovl_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ERR_PTR (ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFDIR ,0 ,NULL )); } -static int ovl_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {/* Don't allow creation of "whiteout" on overlay */ fs/ramfs/inode.c +1
-1@@ -95,7 +95,7 @@ struct inode *ramfs_get_inode(struct super_block *sb,*/ /* SMP-safe */ static int -ramfs_mknod (struct mnt_idmap *idmap,struct inode *dir, +ramfs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode * inode =ramfs_get_inode (dir->i_sb, dir, mode, dev);fs/smb/client/cifsfs.h +1
-1@@ -64,7 +64,7 @@ struct dentry *cifs_lookup(struct inode *parent_dir_inode,int cifs_unlink (struct inode *dir,struct dentry *dentry);int cifs_hardlink (struct dentry *old_file,struct inode *inode,struct dentry *direntry); -int cifs_mknod (struct mnt_idmap *idmap,struct inode *inode, +int cifs_mknod (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode,dev_t device_number);struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode);fs/smb/client/dir.c +1
-1@@ -696,7 +696,7 @@ int cifs_create(struct mnt_idmap *idmap, struct inode *dir,return rc; } -int cifs_mknod (struct mnt_idmap *idmap,struct inode *inode, +int cifs_mknod (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode,dev_t device_number) {int rc = -EPERM ;fs/ubifs/dir.c +1
-1@@ -1077,7 +1077,7 @@ static struct dentry *ubifs_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ERR_PTR (err); } -static int ubifs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;fs/udf/namei.c +1
-1@@ -403,7 +403,7 @@ static int udf_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return finish_open_simple (file,0 ); } -static int udf_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int udf_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;fs/ufs/namei.c +1
-1@@ -85,7 +85,7 @@ static int ufs_create (struct mnt_idmap * idmap,return ufs_add_nondir (dentry, inode); } -static int ufs_mknod (struct mnt_idmap *idmap,struct inode *dir, +static int ufs_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t rdev) {struct inode *inode;fs/xfs/xfs_iops.c +1
-1@@ -279,7 +279,7 @@ xfs_generic_create( STATIC int xfs_vn_mknod( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct inode *dir, struct dentry *dentry, umode_t mode,include/linux/fs.h +1
-1@@ -2008,7 +2008,7 @@ struct inode_operations {struct dentry *(*mkdir) (struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int (*rmdir) (struct inode *,struct dentry *); -int (*mknod) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*mknod) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t );int (*rename) (struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );include/linux/lsm_hook_defs.h +1
-1@@ -94,7 +94,7 @@ LSM_HOOK(int, 0, path_mkdir, const struct path *dir, struct dentry *dentry, LSM_HOOK(int, 0, path_rmdir, const struct path *dir, struct dentry *dentry) LSM_HOOK(int, 0, path_mknod, const struct path *dir, struct dentry *dentry, umode_t mode, unsigned int dev) -LSM_HOOK(void, LSM_RET_VOID, path_post_mknod, struct mnt_idmap *idmap, +LSM_HOOK(void, LSM_RET_VOID, path_post_mknod, const struct mnt_idmap *idmap, struct dentry *dentry) LSM_HOOK(int, 0, path_truncate, const struct path *path) LSM_HOOK(int, 0, path_symlink, const struct path *dir, struct dentry *dentry,include/linux/security.h +2
-2@@ -2085,7 +2085,7 @@ int security_path_mkdir(const struct path *dir, struct dentry *dentry, umode_t mint security_path_rmdir (const struct path *dir,struct dentry *dentry);int security_path_mknod (const struct path *dir,struct dentry *dentry,umode_t mode,unsigned int dev); -void security_path_post_mknod (struct mnt_idmap *idmap,struct dentry *dentry); +void security_path_post_mknod (const struct mnt_idmap *idmap,struct dentry *dentry);int security_path_truncate (const struct path *path);int security_path_symlink (const struct path *dir,struct dentry *dentry,const char *old_name);@@ -2120,7 +2120,7 @@ static inline int security_path_mknod(const struct path *dir, struct dentry *denreturn 0 ; } -static inline void security_path_post_mknod (struct mnt_idmap *idmap, +static inline void security_path_post_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) { }mm/shmem.c +2
-2@@ -3818,7 +3818,7 @@ static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf)* File creation. Allocate an inode, and we're done.. */ static int -shmem_mknod (struct mnt_idmap *idmap,struct inode *dir, +shmem_mknod (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode,dev_t dev) {struct inode *inode;@@ -3970,7 +3970,7 @@ static int shmem_rmdir(struct inode *dir, struct dentry *dentry)return shmem_unlink (dir, dentry); } -static int shmem_whiteout (struct mnt_idmap *idmap, +static int shmem_whiteout (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry) {struct dentry *whiteout;security/integrity/evm/evm_main.c +1
-1@@ -1140,7 +1140,7 @@ static void evm_file_release(struct file *file) iint->flags &= ~EVM_NEW_FILE ; } -static void evm_post_path_mknod (struct mnt_idmap *idmap,struct dentry *dentry) +static void evm_post_path_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) {struct inode *inode =d_backing_inode (dentry);struct evm_iint_cache *iint =evm_iint_inode (inode);security/integrity/ima/ima_main.c +1
-1@@ -879,7 +879,7 @@ static void ima_post_create_tmpfile(const struct mnt_idmap *idmap,* Mark files created via the mknodat syscall as new, so that the * file data can be written later. */ -static void ima_post_path_mknod (struct mnt_idmap *idmap,struct dentry *dentry) +static void ima_post_path_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) {struct ima_iint_cache *iint;struct inode *inode = dentry->d_inode;security/security.c +1
-1@@ -1425,7 +1425,7 @@ EXPORT_SYMBOL(security_path_mknod);* * Update inode security field after a regular file has been created. */ -void security_path_post_mknod (struct mnt_idmap *idmap,struct dentry *dentry) +void security_path_post_mknod (const struct mnt_idmap *idmap,struct dentry *dentry) {if (unlikely (IS_PRIVATE (d_backing_inode (dentry))))return ;Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 18/27] fs: port ->mknod() to pass const mnt_idmap
In reply to Christian BraunerQuoted 52 lines · On Sep 1, 2026 Christian Brauner <[email protected]> wrote:
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>Reviewed-by Jan Kara <[email protected]>--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 4 ++-- fs/gfs2/inode.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/xfs/xfs_iops.c | 2 +-
Quoted 8 lines
include/linux/fs.h | 2 +- include/linux/lsm_hook_defs.h | 2 +- include/linux/security.h | 4 ++-- mm/shmem.c | 4 ++-- security/integrity/evm/evm_main.c | 2 +- security/integrity/ima/ima_main.c | 2 +- security/security.c | 2 +- 41 files changed, 46 insertions(+), 46 deletions(-)
--
paul-moore.com
Christian Brauner
maintainerPATCH 19/27 fs: port ->rename() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- drivers/android/binder/rust_binderfs.c | 2 +- drivers/android/binderfs.c | 2 +- fs/9p/v9fs.h | 2 +- fs/9p/vfs_inode.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/bad_inode.c | 2 +- fs/bfs/dir.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/exfat/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 | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/kernfs/dir.c | 2 +- fs/libfs.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/omfs/dir.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 4 ++-- mm/shmem.c | 2 +- 50 files changed, 53 insertions(+), 53 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -69,7 +69,7 @@ prototypes:: struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); - int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, + int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *, struct delayed_call *);
Documentation/filesystems/vfs.rst +1 -1
@@ -423,7 +423,7 @@ As of kernel 2.6.22, the following members are defined: struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); - int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, + int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *,
drivers/android/binder/rust_binderfs.c +1 -1
@@ -338,7 +338,7 @@ static inline bool is_binderfs_control_device(const struct dentry *dentry)return info->control_dentry == dentry; } -static int binderfs_rename (struct mnt_idmap *idmap, +static int binderfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
drivers/android/binderfs.c +1 -1
@@ -344,7 +344,7 @@ static inline bool is_binderfs_control_device(const struct dentry *dentry)return info->control_dentry == dentry; } -static int binderfs_rename (struct mnt_idmap *idmap, +static int binderfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/9p/v9fs.h +1 -1
@@ -188,7 +188,7 @@ extern struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, 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 mnt_idmap *idmap, +extern int v9fs_vfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags);
fs/9p/vfs_inode.c +1 -1
@@ -858,7 +858,7 @@ int v9fs_vfs_rmdir(struct inode *i, struct dentry *d)*/ int -v9fs_vfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +v9fs_vfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/affs/affs.h +1 -1
@@ -176,7 +176,7 @@ extern int affs_link(struct dentry *olddentry, struct inode *dir,extern int affs_symlink (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname); -extern int affs_rename2 (struct mnt_idmap *idmap, +extern int affs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags);
fs/affs/namei.c +1 -1
@@ -503,7 +503,7 @@ affs_xrename(struct inode *old_dir, struct dentry *old_dentry,return retval; } -int affs_rename2 (struct mnt_idmap *idmap,struct inode *old_dir, +int affs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/afs/dir.c +2 -2
@@ -43,7 +43,7 @@ static int afs_link(struct dentry *from, struct inode *dir, struct dentry *dentry);static int afs_symlink (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *content); -static int afs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int afs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags); static int afs_dir_writepages(struct address_space *mapping,
@@ -2067,7 +2067,7 @@ static const struct afs_operation_ops afs_rename_exchange_operation = {/* * rename a file in an AFS filesystem and/or move it between directories */ -static int afs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int afs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/bad_inode.c +1 -1
@@ -75,7 +75,7 @@ static int bad_inode_mknod(const struct mnt_idmap *idmap, struct inode *dir,return -EIO ; } -static int bad_inode_rename2 (struct mnt_idmap *idmap, +static int bad_inode_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/bfs/dir.c +1 -1
@@ -199,7 +199,7 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry)return error; } -static int bfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int bfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/btrfs/inode.c +1 -1
@@ -8835,7 +8835,7 @@ static int btrfs_rename(const struct mnt_idmap *idmap,return ret; } -static int btrfs_rename2 (struct mnt_idmap *idmap,struct inode *old_dir, +static int btrfs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/ceph/dir.c +1 -1
@@ -1478,7 +1478,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)return err; } -static int ceph_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int ceph_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/coda/dir.c +1 -1
@@ -300,7 +300,7 @@ static int coda_rmdir(struct inode *dir, struct dentry *de) }/* rename */ -static int coda_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int coda_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/ecryptfs/inode.c +1 -1
@@ -590,7 +590,7 @@ ecryptfs_mknod(const struct mnt_idmap *idmap, struct inode *dir, }static int -ecryptfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +ecryptfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/exfat/namei.c +1 -1
@@ -1263,7 +1263,7 @@ static int __exfat_rename(struct inode *old_parent_inode,return ret; } -static int exfat_rename (struct mnt_idmap *idmap, +static int exfat_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/ext2/namei.c +1 -1
@@ -316,7 +316,7 @@ static int ext2_rmdir (struct inode * dir, struct dentry *dentry)return err; } -static int ext2_rename (struct mnt_idmap * idmap, +static int ext2_rename (const struct mnt_idmap * idmap,struct inode * old_dir,struct dentry * old_dentry,struct inode * new_dir,struct dentry * new_dentry,unsigned int flags)
fs/ext4/namei.c +1 -1
@@ -4191,7 +4191,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,return retval; } -static int ext4_rename2 (struct mnt_idmap *idmap, +static int ext4_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/f2fs/namei.c +1 -1
@@ -1341,7 +1341,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,return err; } -static int f2fs_rename2 (struct mnt_idmap *idmap, +static int f2fs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/fat/namei_msdos.c +1 -1
@@ -600,7 +600,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, }/***** Rename, a wrapper for rename_same_dir & rename_diff_dir */ -static int msdos_rename (struct mnt_idmap *idmap, +static int msdos_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/fat/namei_vfat.c +1 -1
@@ -1160,7 +1160,7 @@ static int vfat_rename_exchange(struct inode *old_dir, struct dentry *old_dentry goto out; } -static int vfat_rename2 (struct mnt_idmap *idmap,struct inode *old_dir, +static int vfat_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/fuse/dir.c +1 -1
@@ -1307,7 +1307,7 @@ static int fuse_rename_common(const struct mnt_idmap *idmap, struct inode *olddireturn err; } -static int fuse_rename2 (struct mnt_idmap *idmap,struct inode *olddir, +static int fuse_rename2 (const struct mnt_idmap *idmap,struct inode *olddir,struct dentry *oldent,struct inode *newdir,struct dentry *newent,unsigned int flags) {
fs/gfs2/inode.c +1 -1
@@ -1877,7 +1877,7 @@ static int gfs2_exchange(struct inode *odir, struct dentry *odentry,return error; } -static int gfs2_rename2 (struct mnt_idmap *idmap,struct inode *odir, +static int gfs2_rename2 (const struct mnt_idmap *idmap,struct inode *odir,struct dentry *odentry,struct inode *ndir,struct dentry *ndentry,unsigned int flags) {
fs/hfs/dir.c +1 -1
@@ -281,7 +281,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)* new file/directory. * XXX: how do you handle must_be dir? */ -static int hfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int hfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/hfsplus/dir.c +1 -1
@@ -573,7 +573,7 @@ static struct dentry *hfsplus_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ERR_PTR (hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 )); } -static int hfsplus_rename (struct mnt_idmap *idmap, +static int hfsplus_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/hostfs/hostfs_kern.c +1 -1
@@ -745,7 +745,7 @@ static int hostfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return 0 ; } -static int hostfs_rename2 (struct mnt_idmap *idmap, +static int hostfs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/hpfs/namei.c +1 -1
@@ -500,7 +500,7 @@ const struct address_space_operations hpfs_symlink_aops = { .read_folio = hpfs_symlink_read_folio }; -static int hpfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int hpfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/jffs2/dir.c +2 -2
@@ -38,7 +38,7 @@ static struct dentry *jffs2_mkdir (struct mnt_idmap *, struct inode *,struct denstatic int jffs2_rmdir (struct inode *,struct dentry *);static int jffs2_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); -static int jffs2_rename (struct mnt_idmap *,struct inode *, +static int jffs2_rename (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );
@@ -769,7 +769,7 @@ static int jffs2_mknod (const struct mnt_idmap *idmap, struct inode *dir_i,return ret; } -static int jffs2_rename (struct mnt_idmap *idmap, +static int jffs2_rename (const struct mnt_idmap *idmap,struct inode *old_dir_i,struct dentry *old_dentry,struct inode *new_dir_i,struct dentry *new_dentry,unsigned int flags)
fs/jfs/namei.c +1 -1
@@ -1066,7 +1066,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip,* * FUNCTION: rename a file or directory */ -static int jfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int jfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/kernfs/dir.c +1 -1
@@ -1326,7 +1326,7 @@ static int kernfs_iop_rmdir(struct inode *dir, struct dentry *dentry)return ret; } -static int kernfs_iop_rename (struct mnt_idmap *idmap, +static int kernfs_iop_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/libfs.c +1 -1
@@ -867,7 +867,7 @@ int simple_rename_exchange(struct inode *old_dir, struct dentry *old_dentry, }EXPORT_SYMBOL_GPL (simple_rename_exchange); -int simple_rename (struct mnt_idmap *idmap,struct inode *old_dir, +int simple_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/minix/namei.c +1 -1
@@ -187,7 +187,7 @@ static int minix_rmdir(struct inode * dir, struct dentry *dentry)return err; } -static int minix_rename (struct mnt_idmap *idmap, +static int minix_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/nfs/dir.c +1 -1
@@ -2771,7 +2771,7 @@ static bool nfs_rename_is_unsafe_cross_dir(struct dentry *old_dentry,* If these conditions are met, we can drop the dentries before doing * the rename. */ -int nfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +int nfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/nfs/internal.h +1 -1
@@ -407,7 +407,7 @@ int nfs_symlink(struct mnt_idmap *, struct inode *, struct dentry *,int nfs_link (struct dentry *,struct inode *,struct dentry *);int nfs_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); -int nfs_rename (struct mnt_idmap *,struct inode *,struct dentry *, +int nfs_rename (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );#ifdef CONFIG_NFS_V4_2
fs/nilfs2/namei.c +1 -1
@@ -358,7 +358,7 @@ static int nilfs_rmdir(struct inode *dir, struct dentry *dentry)return err; } -static int nilfs_rename (struct mnt_idmap *idmap, +static int nilfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/ntfs/namei.c +1 -1
@@ -1248,7 +1248,7 @@ static int __ntfs_link(struct ntfs_inode *ni, struct ntfs_inode *dir_ni,return err; } -static int ntfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int ntfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/ntfs3/namei.c +1 -1
@@ -262,7 +262,7 @@ static int ntfs_rmdir(struct inode *dir, struct dentry *dentry)/* * ntfs_rename - inode_operations::rename */ -static int ntfs_rename (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_rename (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,struct inode *new_dir,struct dentry *new_dentry,u32 flags) {
fs/ocfs2/namei.c +1 -1
@@ -1211,7 +1211,7 @@ static void ocfs2_double_unlock(struct inode *inode1, struct inode *inode2)ocfs2_inode_unlock (inode2,1 ); } -static int ocfs2_rename(struct mnt_idmap *idmap, +static int ocfs2_rename(const struct mnt_idmap *idmap, struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir,
fs/omfs/dir.c +1 -1
@@ -370,7 +370,7 @@ static bool omfs_fill_chain(struct inode *dir, struct dir_context *ctx,return true; } -static int omfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int omfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/orangefs/namei.c +1 -1
@@ -364,7 +364,7 @@ static struct dentry *orangefs_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ret ?ERR_PTR (ret) :NULL ; } -static int orangefs_rename(struct mnt_idmap *idmap, +static int orangefs_rename(const struct mnt_idmap *idmap, struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir,
fs/overlayfs/dir.c +1 -1
@@ -1344,7 +1344,7 @@ static void ovl_rename_end(struct ovl_renamedata *ovlrd)ovl_drop_write (ovlrd->old_dentry); } -static int ovl_rename (struct mnt_idmap *idmap,struct inode *olddir, +static int ovl_rename (const struct mnt_idmap *idmap,struct inode *olddir,struct dentry *old,struct inode *newdir,struct dentry *new,unsigned int flags) {
fs/smb/client/cifsfs.h +1 -1
@@ -69,7 +69,7 @@ int cifs_mknod(const struct mnt_idmap *idmap, struct inode *inode,struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode);int cifs_rmdir (struct inode *inode,struct dentry *direntry); -int cifs_rename2 (struct mnt_idmap *idmap,struct inode *source_dir, +int cifs_rename2 (const struct mnt_idmap *idmap,struct inode *source_dir,struct dentry *source_dentry,struct inode *target_dir,struct dentry *target_dentry,unsigned int flags);int cifs_revalidate_file_attr (struct file *filp);
fs/smb/client/inode.c +1 -1
@@ -2526,7 +2526,7 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry, }int -cifs_rename2 (struct mnt_idmap *idmap,struct inode *source_dir, +cifs_rename2 (const struct mnt_idmap *idmap,struct inode *source_dir,struct dentry *source_dentry,struct inode *target_dir,struct dentry *target_dentry,unsigned int flags) {
fs/ubifs/dir.c +1 -1
@@ -1642,7 +1642,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry,return err; } -static int ubifs_rename (struct mnt_idmap *idmap, +static int ubifs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
fs/udf/namei.c +1 -1
@@ -762,7 +762,7 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir,/* Anybody can rename anything with this: the permission checks are left to the * higher-level routines. */ -static int udf_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int udf_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/ufs/namei.c +1 -1
@@ -240,7 +240,7 @@ static int ufs_rmdir (struct inode * dir, struct dentry *dentry)return err; } -static int ufs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int ufs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {
fs/vboxsf/dir.c +1 -1
@@ -382,7 +382,7 @@ static int vboxsf_dir_unlink(struct inode *parent, struct dentry *dentry)return 0 ; } -static int vboxsf_dir_rename(struct mnt_idmap *idmap, +static int vboxsf_dir_rename(const struct mnt_idmap *idmap, struct inode *old_parent, struct dentry *old_dentry, struct inode *new_parent,
fs/xfs/xfs_iops.c +1 -1
@@ -466,7 +466,7 @@ xfs_vn_symlink( STATIC int xfs_vn_rename( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct inode *odir, struct dentry *odentry, struct inode *ndir,
include/linux/fs.h +2 -2
@@ -2010,7 +2010,7 @@ struct inode_operations {int (*rmdir) (struct inode *,struct dentry *);int (*mknod) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); -int (*rename) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*rename) (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );int (*setattr) (struct mnt_idmap *,struct dentry *,struct iattr *); int (*getattr) (struct mnt_idmap *, const struct path *,
@@ -3276,7 +3276,7 @@ void simple_rename_timestamp(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry);extern int simple_rename_exchange (struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry); -extern int simple_rename (struct mnt_idmap *,struct inode *, +extern int simple_rename (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int ); extern void simple_recursive_removal(struct dentry *,
mm/shmem.c +1 -1
@@ -3991,7 +3991,7 @@ static int shmem_whiteout(const struct mnt_idmap *idmap,* it exists so that the VFS layer correctly free's it when it * gets overwritten. */ -static int shmem_rename2 (struct mnt_idmap *idmap, +static int shmem_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)
Signature · 1 line
2.53.0
Re: [PATCH 19/27] fs: port ->rename() to pass const mnt_idmap
Quoted 8 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
Quoted 7 lines
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 734 lines
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- drivers/android/binder/rust_binderfs.c | 2 +- drivers/android/binderfs.c | 2 +- fs/9p/v9fs.h | 2 +- fs/9p/vfs_inode.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/bad_inode.c | 2 +- fs/bfs/dir.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/exfat/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 | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/kernfs/dir.c | 2 +- fs/libfs.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/omfs/dir.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 4 ++-- mm/shmem.c | 2 +- 50 files changed, 53 insertions(+), 53 deletions(-)Documentation/filesystems/locking.rst +1
-1@@ -69,7 +69,7 @@ prototypes:: struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); - int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, + int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *, struct delayed_call *);Documentation/filesystems/vfs.rst +1
-1@@ -423,7 +423,7 @@ As of kernel 2.6.22, the following members are defined: struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); - int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *, + int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *,drivers/android/binder/rust_binderfs.c +1
-1@@ -338,7 +338,7 @@ static inline bool is_binderfs_control_device(const struct dentry *dentry)return info->control_dentry == dentry; } -static int binderfs_rename (struct mnt_idmap *idmap, +static int binderfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)drivers/android/binderfs.c +1
-1@@ -344,7 +344,7 @@ static inline bool is_binderfs_control_device(const struct dentry *dentry)return info->control_dentry == dentry; } -static int binderfs_rename (struct mnt_idmap *idmap, +static int binderfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/9p/v9fs.h +1
-1@@ -188,7 +188,7 @@ extern struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, 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 mnt_idmap *idmap, +extern int v9fs_vfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags);fs/9p/vfs_inode.c +1
-1@@ -858,7 +858,7 @@ int v9fs_vfs_rmdir(struct inode *i, struct dentry *d)*/ int -v9fs_vfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +v9fs_vfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/affs/affs.h +1
-1@@ -176,7 +176,7 @@ extern int affs_link(struct dentry *olddentry, struct inode *dir,extern int affs_symlink (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname); -extern int affs_rename2 (struct mnt_idmap *idmap, +extern int affs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags);fs/affs/namei.c +1
-1@@ -503,7 +503,7 @@ affs_xrename(struct inode *old_dir, struct dentry *old_dentry,return retval; } -int affs_rename2 (struct mnt_idmap *idmap,struct inode *old_dir, +int affs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/afs/dir.c +2
-2@@ -43,7 +43,7 @@ static int afs_link(struct dentry *from, struct inode *dir, struct dentry *dentry);static int afs_symlink (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *content); -static int afs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int afs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags); static int afs_dir_writepages(struct address_space *mapping,@@ -2067,7 +2067,7 @@ static const struct afs_operation_ops afs_rename_exchange_operation = {/* * rename a file in an AFS filesystem and/or move it between directories */ -static int afs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int afs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/bad_inode.c +1
-1@@ -75,7 +75,7 @@ static int bad_inode_mknod(const struct mnt_idmap *idmap, struct inode *dir,return -EIO ; } -static int bad_inode_rename2 (struct mnt_idmap *idmap, +static int bad_inode_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/bfs/dir.c +1
-1@@ -199,7 +199,7 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry)return error; } -static int bfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int bfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/btrfs/inode.c +1
-1@@ -8835,7 +8835,7 @@ static int btrfs_rename(const struct mnt_idmap *idmap,return ret; } -static int btrfs_rename2 (struct mnt_idmap *idmap,struct inode *old_dir, +static int btrfs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/ceph/dir.c +1
-1@@ -1478,7 +1478,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)return err; } -static int ceph_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int ceph_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/coda/dir.c +1
-1@@ -300,7 +300,7 @@ static int coda_rmdir(struct inode *dir, struct dentry *de) }/* rename */ -static int coda_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int coda_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/ecryptfs/inode.c +1
-1@@ -590,7 +590,7 @@ ecryptfs_mknod(const struct mnt_idmap *idmap, struct inode *dir, }static int -ecryptfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +ecryptfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/exfat/namei.c +1
-1@@ -1263,7 +1263,7 @@ static int __exfat_rename(struct inode *old_parent_inode,return ret; } -static int exfat_rename (struct mnt_idmap *idmap, +static int exfat_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/ext2/namei.c +1
-1@@ -316,7 +316,7 @@ static int ext2_rmdir (struct inode * dir, struct dentry *dentry)return err; } -static int ext2_rename (struct mnt_idmap * idmap, +static int ext2_rename (const struct mnt_idmap * idmap,struct inode * old_dir,struct dentry * old_dentry,struct inode * new_dir,struct dentry * new_dentry,unsigned int flags)fs/ext4/namei.c +1
-1@@ -4191,7 +4191,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,return retval; } -static int ext4_rename2 (struct mnt_idmap *idmap, +static int ext4_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/f2fs/namei.c +1
-1@@ -1341,7 +1341,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,return err; } -static int f2fs_rename2 (struct mnt_idmap *idmap, +static int f2fs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/fat/namei_msdos.c +1
-1@@ -600,7 +600,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, }/***** Rename, a wrapper for rename_same_dir & rename_diff_dir */ -static int msdos_rename (struct mnt_idmap *idmap, +static int msdos_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/fat/namei_vfat.c +1
-1@@ -1160,7 +1160,7 @@ static int vfat_rename_exchange(struct inode *old_dir, struct dentry *old_dentry goto out; } -static int vfat_rename2 (struct mnt_idmap *idmap,struct inode *old_dir, +static int vfat_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/fuse/dir.c +1
-1@@ -1307,7 +1307,7 @@ static int fuse_rename_common(const struct mnt_idmap *idmap, struct inode *olddireturn err; } -static int fuse_rename2 (struct mnt_idmap *idmap,struct inode *olddir, +static int fuse_rename2 (const struct mnt_idmap *idmap,struct inode *olddir,struct dentry *oldent,struct inode *newdir,struct dentry *newent,unsigned int flags) {fs/gfs2/inode.c +1
-1@@ -1877,7 +1877,7 @@ static int gfs2_exchange(struct inode *odir, struct dentry *odentry,return error; } -static int gfs2_rename2 (struct mnt_idmap *idmap,struct inode *odir, +static int gfs2_rename2 (const struct mnt_idmap *idmap,struct inode *odir,struct dentry *odentry,struct inode *ndir,struct dentry *ndentry,unsigned int flags) {fs/hfs/dir.c +1
-1@@ -281,7 +281,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)* new file/directory. * XXX: how do you handle must_be dir? */ -static int hfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int hfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/hfsplus/dir.c +1
-1@@ -573,7 +573,7 @@ static struct dentry *hfsplus_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ERR_PTR (hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 )); } -static int hfsplus_rename (struct mnt_idmap *idmap, +static int hfsplus_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/hostfs/hostfs_kern.c +1
-1@@ -745,7 +745,7 @@ static int hostfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return 0 ; } -static int hostfs_rename2 (struct mnt_idmap *idmap, +static int hostfs_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/hpfs/namei.c +1
-1@@ -500,7 +500,7 @@ const struct address_space_operations hpfs_symlink_aops = { .read_folio = hpfs_symlink_read_folio }; -static int hpfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int hpfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/jffs2/dir.c +2
-2@@ -38,7 +38,7 @@ static struct dentry *jffs2_mkdir (struct mnt_idmap *, struct inode *,struct denstatic int jffs2_rmdir (struct inode *,struct dentry *);static int jffs2_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); -static int jffs2_rename (struct mnt_idmap *,struct inode *, +static int jffs2_rename (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );@@ -769,7 +769,7 @@ static int jffs2_mknod (const struct mnt_idmap *idmap, struct inode *dir_i,return ret; } -static int jffs2_rename (struct mnt_idmap *idmap, +static int jffs2_rename (const struct mnt_idmap *idmap,struct inode *old_dir_i,struct dentry *old_dentry,struct inode *new_dir_i,struct dentry *new_dentry,unsigned int flags)fs/jfs/namei.c +1
-1@@ -1066,7 +1066,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip,* * FUNCTION: rename a file or directory */ -static int jfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int jfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/kernfs/dir.c +1
-1@@ -1326,7 +1326,7 @@ static int kernfs_iop_rmdir(struct inode *dir, struct dentry *dentry)return ret; } -static int kernfs_iop_rename (struct mnt_idmap *idmap, +static int kernfs_iop_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/libfs.c +1
-1@@ -867,7 +867,7 @@ int simple_rename_exchange(struct inode *old_dir, struct dentry *old_dentry, }EXPORT_SYMBOL_GPL (simple_rename_exchange); -int simple_rename (struct mnt_idmap *idmap,struct inode *old_dir, +int simple_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/minix/namei.c +1
-1@@ -187,7 +187,7 @@ static int minix_rmdir(struct inode * dir, struct dentry *dentry)return err; } -static int minix_rename (struct mnt_idmap *idmap, +static int minix_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/nfs/dir.c +1
-1@@ -2771,7 +2771,7 @@ static bool nfs_rename_is_unsafe_cross_dir(struct dentry *old_dentry,* If these conditions are met, we can drop the dentries before doing * the rename. */ -int nfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +int nfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/nfs/internal.h +1
-1@@ -407,7 +407,7 @@ int nfs_symlink(struct mnt_idmap *, struct inode *, struct dentry *,int nfs_link (struct dentry *,struct inode *,struct dentry *);int nfs_mknod (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); -int nfs_rename (struct mnt_idmap *,struct inode *,struct dentry *, +int nfs_rename (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );#ifdef CONFIG_NFS_V4_2 fs/nilfs2/namei.c +1
-1@@ -358,7 +358,7 @@ static int nilfs_rmdir(struct inode *dir, struct dentry *dentry)return err; } -static int nilfs_rename (struct mnt_idmap *idmap, +static int nilfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/ntfs/namei.c +1
-1@@ -1248,7 +1248,7 @@ static int __ntfs_link(struct ntfs_inode *ni, struct ntfs_inode *dir_ni,return err; } -static int ntfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int ntfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/ntfs3/namei.c +1
-1@@ -262,7 +262,7 @@ static int ntfs_rmdir(struct inode *dir, struct dentry *dentry)/* * ntfs_rename - inode_operations::rename */ -static int ntfs_rename (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_rename (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,struct inode *new_dir,struct dentry *new_dentry,u32 flags) {fs/ocfs2/namei.c +1
-1@@ -1211,7 +1211,7 @@ static void ocfs2_double_unlock(struct inode *inode1, struct inode *inode2)ocfs2_inode_unlock (inode2,1 ); } -static int ocfs2_rename(struct mnt_idmap *idmap, +static int ocfs2_rename(const struct mnt_idmap *idmap, struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir,fs/omfs/dir.c +1
-1@@ -370,7 +370,7 @@ static bool omfs_fill_chain(struct inode *dir, struct dir_context *ctx,return true; } -static int omfs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int omfs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/orangefs/namei.c +1
-1@@ -364,7 +364,7 @@ static struct dentry *orangefs_mkdir(struct mnt_idmap *idmap, struct inode *dir,return ret ?ERR_PTR (ret) :NULL ; } -static int orangefs_rename(struct mnt_idmap *idmap, +static int orangefs_rename(const struct mnt_idmap *idmap, struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir,fs/overlayfs/dir.c +1
-1@@ -1344,7 +1344,7 @@ static void ovl_rename_end(struct ovl_renamedata *ovlrd)ovl_drop_write (ovlrd->old_dentry); } -static int ovl_rename (struct mnt_idmap *idmap,struct inode *olddir, +static int ovl_rename (const struct mnt_idmap *idmap,struct inode *olddir,struct dentry *old,struct inode *newdir,struct dentry *new,unsigned int flags) {fs/smb/client/cifsfs.h +1
-1@@ -69,7 +69,7 @@ int cifs_mknod(const struct mnt_idmap *idmap, struct inode *inode,struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode);int cifs_rmdir (struct inode *inode,struct dentry *direntry); -int cifs_rename2 (struct mnt_idmap *idmap,struct inode *source_dir, +int cifs_rename2 (const struct mnt_idmap *idmap,struct inode *source_dir,struct dentry *source_dentry,struct inode *target_dir,struct dentry *target_dentry,unsigned int flags);int cifs_revalidate_file_attr (struct file *filp);fs/smb/client/inode.c +1
-1@@ -2526,7 +2526,7 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry, }int -cifs_rename2 (struct mnt_idmap *idmap,struct inode *source_dir, +cifs_rename2 (const struct mnt_idmap *idmap,struct inode *source_dir,struct dentry *source_dentry,struct inode *target_dir,struct dentry *target_dentry,unsigned int flags) {fs/ubifs/dir.c +1
-1@@ -1642,7 +1642,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry,return err; } -static int ubifs_rename (struct mnt_idmap *idmap, +static int ubifs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)fs/udf/namei.c +1
-1@@ -762,7 +762,7 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir,/* Anybody can rename anything with this: the permission checks are left to the * higher-level routines. */ -static int udf_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int udf_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/ufs/namei.c +1
-1@@ -240,7 +240,7 @@ static int ufs_rmdir (struct inode * dir, struct dentry *dentry)return err; } -static int ufs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int ufs_rename (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags) {fs/vboxsf/dir.c +1
-1@@ -382,7 +382,7 @@ static int vboxsf_dir_unlink(struct inode *parent, struct dentry *dentry)return 0 ; } -static int vboxsf_dir_rename(struct mnt_idmap *idmap, +static int vboxsf_dir_rename(const struct mnt_idmap *idmap, struct inode *old_parent, struct dentry *old_dentry, struct inode *new_parent,fs/xfs/xfs_iops.c +1
-1@@ -466,7 +466,7 @@ xfs_vn_symlink( STATIC int xfs_vn_rename( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct inode *odir, struct dentry *odentry, struct inode *ndir,include/linux/fs.h +2
-2@@ -2010,7 +2010,7 @@ struct inode_operations {int (*rmdir) (struct inode *,struct dentry *);int (*mknod) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t ,dev_t ); -int (*rename) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*rename) (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );int (*setattr) (struct mnt_idmap *,struct dentry *,struct iattr *); int (*getattr) (struct mnt_idmap *, const struct path *,@@ -3276,7 +3276,7 @@ void simple_rename_timestamp(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry);extern int simple_rename_exchange (struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry); -extern int simple_rename (struct mnt_idmap *,struct inode *, +extern int simple_rename (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int ); extern void simple_recursive_removal(struct dentry *,mm/shmem.c +1
-1@@ -3991,7 +3991,7 @@ static int shmem_whiteout(const struct mnt_idmap *idmap,* it exists so that the VFS layer correctly free's it when it * gets overwritten. */ -static int shmem_rename2 (struct mnt_idmap *idmap, +static int shmem_rename2 (const struct mnt_idmap *idmap,struct inode *old_dir,struct dentry *old_dentry,struct inode *new_dir,struct dentry *new_dentry,unsigned int flags)Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Christian Brauner
maintainerPATCH 20/27 fs: port ->mkdir() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/autofs/root.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/configfs/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/exfat/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 | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/kernfs/dir.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/omfs/dir.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/tracefs/inode.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- kernel/bpf/inode.c | 2 +- mm/shmem.c | 2 +- security/apparmor/apparmorfs.c | 2 +- 54 files changed, 57 insertions(+), 57 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -66,7 +66,7 @@ prototypes:: int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); - struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); + struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *,
Documentation/filesystems/vfs.rst +1 -1
@@ -420,7 +420,7 @@ As of kernel 2.6.22, the following members are defined: int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); - struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); + struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *,
fs/9p/vfs_inode.c +1 -1
@@ -679,7 +679,7 @@ v9fs_vfs_create(struct mnt_idmap *idmap, struct inode *dir,* */ -static struct dentry *v9fs_vfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *v9fs_vfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {u32 perm;
fs/9p/vfs_inode_dotl.c +1 -1
@@ -344,7 +344,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,* */ -static struct dentry *v9fs_vfs_mkdir_dotl (struct mnt_idmap *idmap, +static struct dentry *v9fs_vfs_mkdir_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode) {
fs/affs/affs.h +1 -1
@@ -168,7 +168,7 @@ extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsiextern int affs_unlink (struct inode *dir,struct dentry *dentry);extern int affs_create (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode); -extern struct dentry *affs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +extern struct dentry *affs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);extern int affs_rmdir (struct inode *dir,struct dentry *dentry); extern int affs_link(struct dentry *olddentry, struct inode *dir,
fs/affs/namei.c +1 -1
@@ -274,7 +274,7 @@ affs_create(struct mnt_idmap *idmap, struct inode *dir, }struct dentry * -affs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +affs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/afs/dir.c +2 -2
@@ -35,7 +35,7 @@ static bool afs_lookup_filldir(struct dir_context *ctx, const char *name, int nl#define AFS_LOOKUP ((filldir_t)0x137UL)static int afs_create (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode); -static struct dentry *afs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *afs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);static int afs_rmdir (struct inode *dir,struct dentry *dentry);static int afs_unlink (struct inode *dir,struct dentry *dentry);
@@ -1310,7 +1310,7 @@ static const struct afs_operation_ops afs_mkdir_operation = {/* * create a directory on an AFS filesystem */ -static struct dentry *afs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *afs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct afs_operation *op;
fs/autofs/root.c +2 -2
@@ -16,7 +16,7 @@ static int autofs_dir_symlink(struct mnt_idmap *, struct inode *, struct dentry *, const char *);static int autofs_dir_unlink (struct inode *,struct dentry *);static int autofs_dir_rmdir (struct inode *,struct dentry *); -static struct dentry *autofs_dir_mkdir (struct mnt_idmap *,struct inode *, +static struct dentry *autofs_dir_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static long autofs_root_ioctl (struct file *,unsigned int ,unsigned long );#ifdef CONFIG_COMPAT
@@ -724,7 +724,7 @@ static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry)return 0 ; } -static struct dentry *autofs_dir_mkdir (struct mnt_idmap *idmap, +static struct dentry *autofs_dir_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {
fs/bad_inode.c +1 -1
@@ -58,7 +58,7 @@ static int bad_inode_symlink(struct mnt_idmap *idmap,return -EIO ; } -static struct dentry *bad_inode_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *bad_inode_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (-EIO );
fs/btrfs/inode.c +1 -1
@@ -7115,7 +7115,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,return ret; } -static struct dentry *btrfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *btrfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/ceph/dir.c +1 -1
@@ -1106,7 +1106,7 @@ static int ceph_symlink(struct mnt_idmap *idmap, struct inode *dir,return err; } -static struct dentry *ceph_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ceph_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct ceph_mds_client *mdsc =ceph_sb_to_mdsc (dir->i_sb);
fs/coda/dir.c +1 -1
@@ -166,7 +166,7 @@ static int coda_create(struct mnt_idmap *idmap, struct inode *dir,return error; } -static struct dentry *coda_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *coda_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *de,umode_t mode) {struct inode *inode;
fs/configfs/dir.c +1 -1
@@ -1286,7 +1286,7 @@ int configfs_depend_item_unlocked(struct configfs_subsystem *caller_subsys, }EXPORT_SYMBOL (configfs_depend_item_unlocked); -static struct dentry *configfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *configfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int ret =0 ;
fs/ecryptfs/inode.c +1 -1
@@ -503,7 +503,7 @@ static int ecryptfs_symlink(struct mnt_idmap *idmap,return rc; } -static struct dentry *ecryptfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ecryptfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int rc;
fs/exfat/namei.c +1 -1
@@ -825,7 +825,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *exfat_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *exfat_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/ext2/namei.c +1 -1
@@ -223,7 +223,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,return err; } -static struct dentry *ext2_mkdir (struct mnt_idmap * idmap, +static struct dentry *ext2_mkdir (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {
fs/ext4/namei.c +1 -1
@@ -2994,7 +2994,7 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,return err; } -static struct dentry *ext4_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ext4_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {handle_t *handle;
fs/f2fs/namei.c +1 -1
@@ -751,7 +751,7 @@ static int f2fs_symlink(struct mnt_idmap *idmap, struct inode *dir, goto out; } -static struct dentry *f2fs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *f2fs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);
fs/fat/namei_msdos.c +1 -1
@@ -345,7 +345,7 @@ static int msdos_rmdir(struct inode *dir, struct dentry *dentry) }/***** Make a directory */ -static struct dentry *msdos_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *msdos_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/fat/namei_vfat.c +1 -1
@@ -846,7 +846,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *vfat_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *vfat_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/fuse/dir.c +1 -1
@@ -1116,7 +1116,7 @@ static int fuse_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static struct dentry *fuse_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *fuse_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,umode_t mode) {struct fuse_mkdir_in inarg;
fs/gfs2/inode.c +1 -1
@@ -1345,7 +1345,7 @@ static int gfs2_symlink(struct mnt_idmap *idmap, struct inode *dir,* Returns: the dentry, or ERR_PTR(errno) */ -static struct dentry *gfs2_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *gfs2_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {unsigned dsize =gfs2_max_stuffed_size (GFS2_I (dir));
fs/hfs/dir.c +1 -1
@@ -213,7 +213,7 @@ static int hfs_create(struct mnt_idmap *idmap, struct inode *dir,* in a directory, given the inode for the parent directory and the * name (and its length) of the new directory. */ -static struct dentry *hfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/hfsplus/dir.c +1 -1
@@ -567,7 +567,7 @@ static int hfsplus_create(struct mnt_idmap *idmap, struct inode *dir,return hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 ); } -static struct dentry *hfsplus_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hfsplus_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 ));
fs/hostfs/hostfs_kern.c +1 -1
@@ -686,7 +686,7 @@ static int hostfs_symlink(struct mnt_idmap *idmap, struct inode *ino,return err; } -static struct dentry *hostfs_mkdir (struct mnt_idmap *idmap,struct inode *ino, +static struct dentry *hostfs_mkdir (const struct mnt_idmap *idmap,struct inode *ino,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/hpfs/namei.c +1 -1
@@ -19,7 +19,7 @@ static void hpfs_update_directory_times(struct inode *dir)hpfs_write_inode_nolock (dir); } -static struct dentry *hpfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hpfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {const unsigned char *name = dentry->d_name.name;
fs/hugetlbfs/inode.c +1 -1
@@ -967,7 +967,7 @@ static int hugetlbfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return 0 ; } -static struct dentry *hugetlbfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hugetlbfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) { int retval = hugetlbfs_mknod(idmap, dir, dentry,
fs/jffs2/dir.c +2 -2
@@ -33,7 +33,7 @@ static int jffs2_link (struct dentry *,struct inode *,struct dentry *);static int jffs2_unlink (struct inode *,struct dentry *);static int jffs2_symlink (struct mnt_idmap *,struct inode *,struct dentry *,const char *); -static struct dentry *jffs2_mkdir (struct mnt_idmap *,struct inode *,struct dentry *, +static struct dentry *jffs2_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static int jffs2_rmdir (struct inode *,struct dentry *); static int jffs2_mknod (const struct mnt_idmap *, struct inode *,struct dentry *,
@@ -448,7 +448,7 @@ static int jffs2_symlink (struct mnt_idmap *idmap, struct inode *dir_i, } -static struct dentry *jffs2_mkdir (struct mnt_idmap *idmap,struct inode *dir_i, +static struct dentry *jffs2_mkdir (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,umode_t mode) {struct jffs2_inode_info *f, *dir_f;
fs/jfs/namei.c +1 -1
@@ -193,7 +193,7 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip,* note: * EACCES: user needs search+write permission on the parent directory */ -static struct dentry *jfs_mkdir (struct mnt_idmap *idmap,struct inode *dip, +static struct dentry *jfs_mkdir (const struct mnt_idmap *idmap,struct inode *dip,struct dentry *dentry,umode_t mode) {int rc =0 ;
fs/kernfs/dir.c +1 -1
@@ -1288,7 +1288,7 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,return d_splice_alias (inode, dentry); } -static struct dentry *kernfs_iop_mkdir (struct mnt_idmap *idmap, +static struct dentry *kernfs_iop_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {
fs/minix/namei.c +1 -1
@@ -104,7 +104,7 @@ static int minix_link(struct dentry * old_dentry, struct inode * dir,return add_nondir (dentry, inode); } -static struct dentry *minix_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *minix_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode * inode;
fs/nfs/dir.c +1 -1
@@ -2475,7 +2475,7 @@ EXPORT_SYMBOL_GPL(nfs_mknod);/* * See comments for nfs_proc_create regarding failed operations. */ -struct dentry *nfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +struct dentry *nfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct iattr attr;
fs/nfs/internal.h +1 -1
@@ -398,7 +398,7 @@ struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);void nfs_d_prune_case_insensitive_aliases (struct inode *inode);int nfs_create (struct mnt_idmap *,struct inode *,struct dentry *,umode_t ); -struct dentry *nfs_mkdir (struct mnt_idmap *,struct inode *,struct dentry *, +struct dentry *nfs_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int nfs_rmdir (struct inode *,struct dentry *);int nfs_unlink (struct inode *,struct dentry *);
fs/nilfs2/namei.c +1 -1
@@ -218,7 +218,7 @@ static int nilfs_link(struct dentry *old_dentry, struct inode *dir,return err; } -static struct dentry *nilfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *nilfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/ntfs/namei.c +1 -1
@@ -1049,7 +1049,7 @@ static int ntfs_unlink(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *ntfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ntfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/ntfs3/namei.c +1 -1
@@ -228,7 +228,7 @@ static int ntfs_symlink(struct mnt_idmap *idmap, struct inode *dir,/* * ntfs_mkdir - inode_operations::mkdir */ -static struct dentry *ntfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ntfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) { return ERR_PTR(ntfs_create_inode(idmap, dir, dentry, NULL,
fs/ocfs2/dlmfs/dlmfs.c +1 -1
@@ -402,7 +402,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent,* File creation. Allocate an inode, and we're done.. */ /* SMP-safe */ -static struct dentry *dlmfs_mkdir (struct mnt_idmap * idmap, +static struct dentry *dlmfs_mkdir (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode)
fs/ocfs2/namei.c +1 -1
@@ -655,7 +655,7 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, suballoc_loc, suballoc_bit); } -static struct dentry *ocfs2_mkdir (struct mnt_idmap *idmap, +static struct dentry *ocfs2_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)
fs/omfs/dir.c +1 -1
@@ -279,7 +279,7 @@ static int omfs_add_node(struct inode *dir, struct dentry *dentry, umode_t mode)return err; } -static struct dentry *omfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *omfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (omfs_add_node (dir, dentry, mode));
fs/orangefs/namei.c +1 -1
@@ -296,7 +296,7 @@ static int orangefs_symlink(struct mnt_idmap *idmap,return ret; } -static struct dentry *orangefs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *orangefs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct orangefs_inode_s *parent =ORANGEFS_I (dir);
fs/overlayfs/dir.c +1 -1
@@ -736,7 +736,7 @@ static int ovl_create(struct mnt_idmap *idmap, struct inode *dir,return ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFREG ,0 ,NULL ); } -static struct dentry *ovl_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ovl_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFDIR ,0 ,NULL ));
fs/ramfs/inode.c +1 -1
@@ -118,7 +118,7 @@ ramfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return error; } -static struct dentry *ramfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ramfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int retval =ramfs_mknod (&nop_mnt_idmap, dir, dentry, mode,0 );
fs/smb/client/cifsfs.h +1 -1
@@ -66,7 +66,7 @@ int cifs_hardlink(struct dentry *old_file, struct inode *inode, struct dentry *direntry);int cifs_mknod (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode,dev_t device_number); -struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode, +struct dentry *cifs_mkdir (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode);int cifs_rmdir (struct inode *inode,struct dentry *direntry); int cifs_rename2(const struct mnt_idmap *idmap, struct inode *source_dir,
fs/smb/client/inode.c +1 -1
@@ -2276,7 +2276,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode, }#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ -struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode, +struct dentry *cifs_mkdir (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode) {int rc =0 ;
fs/tracefs/inode.c +1 -1
@@ -94,7 +94,7 @@ static struct tracefs_dir_ops {int (*rmdir)(const char *name); } tracefs_ops__ro_after_init ; -static struct dentry *tracefs_syscall_mkdir (struct mnt_idmap *idmap, +static struct dentry *tracefs_syscall_mkdir (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *dentry,umode_t mode) {
fs/ubifs/dir.c +1 -1
@@ -1002,7 +1002,7 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *ubifs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ubifs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/udf/namei.c +1 -1
@@ -419,7 +419,7 @@ static int udf_mknod(const struct mnt_idmap *idmap, struct inode *dir,return udf_add_nondir (dentry, inode); } -static struct dentry *udf_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *udf_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/ufs/namei.c +1 -1
@@ -165,7 +165,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir,return error; } -static struct dentry *ufs_mkdir (struct mnt_idmap * idmap,struct inode * dir, +static struct dentry *ufs_mkdir (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {struct inode * inode;
fs/vboxsf/dir.c +1 -1
@@ -303,7 +303,7 @@ static int vboxsf_dir_mkfile(struct mnt_idmap *idmap,return vboxsf_dir_create (parent, dentry, mode, false, true,NULL ); } -static struct dentry *vboxsf_dir_mkdir (struct mnt_idmap *idmap, +static struct dentry *vboxsf_dir_mkdir (const struct mnt_idmap *idmap,struct inode *parent,struct dentry *dentry,umode_t mode) {
fs/xfs/xfs_iops.c +1 -1
@@ -300,7 +300,7 @@ xfs_vn_create( STATIC struct dentry *xfs_vn_mkdir ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)
include/linux/fs.h +1 -1
@@ -2005,7 +2005,7 @@ struct inode_operations {int (*unlink) (struct inode *,struct dentry *);int (*symlink) (struct mnt_idmap *,struct inode *,struct dentry *,const char *); -struct dentry *(*mkdir) (struct mnt_idmap *,struct inode *, +struct dentry *(*mkdir) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,
kernel/bpf/inode.c +1 -1
@@ -176,7 +176,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode,inode_set_mtime_to_ts (dir,inode_set_ctime_current (dir)); } -static struct dentry *bpf_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *bpf_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
mm/shmem.c +1 -1
@@ -3885,7 +3885,7 @@ shmem_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return error; } -static struct dentry *shmem_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *shmem_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int error;
security/apparmor/apparmorfs.c +1 -1
@@ -2073,7 +2073,7 @@ int __aafs_profile_mkdir(struct aa_profile *profile, struct dentry *parent)return error; } -static struct dentry *ns_mkdir_op (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ns_mkdir_op (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct aa_ns *ns, *parent;
Signature · 1 line
2.53.0
Re: [PATCH 20/27] fs: port ->mkdir() to pass const mnt_idmap
Quoted 8 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
Quoted 7 lines
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 790 lines
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/autofs/root.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/configfs/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/exfat/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 | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/kernfs/dir.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/omfs/dir.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/tracefs/inode.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- kernel/bpf/inode.c | 2 +- mm/shmem.c | 2 +- security/apparmor/apparmorfs.c | 2 +- 54 files changed, 57 insertions(+), 57 deletions(-)Documentation/filesystems/locking.rst +1
-1@@ -66,7 +66,7 @@ prototypes:: int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); - struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); + struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *,Documentation/filesystems/vfs.rst +1
-1@@ -420,7 +420,7 @@ As of kernel 2.6.22, the following members are defined: int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); - struct dentry *(*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); + struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (const struct mnt_idmap *, struct inode *, struct dentry *,fs/9p/vfs_inode.c +1
-1@@ -679,7 +679,7 @@ v9fs_vfs_create(struct mnt_idmap *idmap, struct inode *dir,* */ -static struct dentry *v9fs_vfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *v9fs_vfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {u32 perm;fs/9p/vfs_inode_dotl.c +1
-1@@ -344,7 +344,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,* */ -static struct dentry *v9fs_vfs_mkdir_dotl (struct mnt_idmap *idmap, +static struct dentry *v9fs_vfs_mkdir_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode) {fs/affs/affs.h +1
-1@@ -168,7 +168,7 @@ extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsiextern int affs_unlink (struct inode *dir,struct dentry *dentry);extern int affs_create (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode); -extern struct dentry *affs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +extern struct dentry *affs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);extern int affs_rmdir (struct inode *dir,struct dentry *dentry); extern int affs_link(struct dentry *olddentry, struct inode *dir,fs/affs/namei.c +1
-1@@ -274,7 +274,7 @@ affs_create(struct mnt_idmap *idmap, struct inode *dir, }struct dentry * -affs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +affs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/afs/dir.c +2
-2@@ -35,7 +35,7 @@ static bool afs_lookup_filldir(struct dir_context *ctx, const char *name, int nl#define AFS_LOOKUP ((filldir_t)0x137UL)static int afs_create (struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode); -static struct dentry *afs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *afs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);static int afs_rmdir (struct inode *dir,struct dentry *dentry);static int afs_unlink (struct inode *dir,struct dentry *dentry);@@ -1310,7 +1310,7 @@ static const struct afs_operation_ops afs_mkdir_operation = {/* * create a directory on an AFS filesystem */ -static struct dentry *afs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *afs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct afs_operation *op;fs/autofs/root.c +2
-2@@ -16,7 +16,7 @@ static int autofs_dir_symlink(struct mnt_idmap *, struct inode *, struct dentry *, const char *);static int autofs_dir_unlink (struct inode *,struct dentry *);static int autofs_dir_rmdir (struct inode *,struct dentry *); -static struct dentry *autofs_dir_mkdir (struct mnt_idmap *,struct inode *, +static struct dentry *autofs_dir_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static long autofs_root_ioctl (struct file *,unsigned int ,unsigned long );#ifdef CONFIG_COMPAT @@ -724,7 +724,7 @@ static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry)return 0 ; } -static struct dentry *autofs_dir_mkdir (struct mnt_idmap *idmap, +static struct dentry *autofs_dir_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {fs/bad_inode.c +1
-1@@ -58,7 +58,7 @@ static int bad_inode_symlink(struct mnt_idmap *idmap,return -EIO ; } -static struct dentry *bad_inode_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *bad_inode_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (-EIO );fs/btrfs/inode.c +1
-1@@ -7115,7 +7115,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,return ret; } -static struct dentry *btrfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *btrfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/ceph/dir.c +1
-1@@ -1106,7 +1106,7 @@ static int ceph_symlink(struct mnt_idmap *idmap, struct inode *dir,return err; } -static struct dentry *ceph_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ceph_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct ceph_mds_client *mdsc =ceph_sb_to_mdsc (dir->i_sb);fs/coda/dir.c +1
-1@@ -166,7 +166,7 @@ static int coda_create(struct mnt_idmap *idmap, struct inode *dir,return error; } -static struct dentry *coda_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *coda_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *de,umode_t mode) {struct inode *inode;fs/configfs/dir.c +1
-1@@ -1286,7 +1286,7 @@ int configfs_depend_item_unlocked(struct configfs_subsystem *caller_subsys, }EXPORT_SYMBOL (configfs_depend_item_unlocked); -static struct dentry *configfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *configfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int ret =0 ;fs/ecryptfs/inode.c +1
-1@@ -503,7 +503,7 @@ static int ecryptfs_symlink(struct mnt_idmap *idmap,return rc; } -static struct dentry *ecryptfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ecryptfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int rc;fs/exfat/namei.c +1
-1@@ -825,7 +825,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *exfat_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *exfat_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/ext2/namei.c +1
-1@@ -223,7 +223,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,return err; } -static struct dentry *ext2_mkdir (struct mnt_idmap * idmap, +static struct dentry *ext2_mkdir (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {fs/ext4/namei.c +1
-1@@ -2994,7 +2994,7 @@ int ext4_init_new_dir(handle_t *handle, struct inode *dir,return err; } -static struct dentry *ext4_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ext4_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {handle_t *handle;fs/f2fs/namei.c +1
-1@@ -751,7 +751,7 @@ static int f2fs_symlink(struct mnt_idmap *idmap, struct inode *dir, goto out; } -static struct dentry *f2fs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *f2fs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);fs/fat/namei_msdos.c +1
-1@@ -345,7 +345,7 @@ static int msdos_rmdir(struct inode *dir, struct dentry *dentry) }/***** Make a directory */ -static struct dentry *msdos_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *msdos_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/fat/namei_vfat.c +1
-1@@ -846,7 +846,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *vfat_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *vfat_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/fuse/dir.c +1
-1@@ -1116,7 +1116,7 @@ static int fuse_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static struct dentry *fuse_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *fuse_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,umode_t mode) {struct fuse_mkdir_in inarg;fs/gfs2/inode.c +1
-1@@ -1345,7 +1345,7 @@ static int gfs2_symlink(struct mnt_idmap *idmap, struct inode *dir,* Returns: the dentry, or ERR_PTR(errno) */ -static struct dentry *gfs2_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *gfs2_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {unsigned dsize =gfs2_max_stuffed_size (GFS2_I (dir));fs/hfs/dir.c +1
-1@@ -213,7 +213,7 @@ static int hfs_create(struct mnt_idmap *idmap, struct inode *dir,* in a directory, given the inode for the parent directory and the * name (and its length) of the new directory. */ -static struct dentry *hfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/hfsplus/dir.c +1
-1@@ -567,7 +567,7 @@ static int hfsplus_create(struct mnt_idmap *idmap, struct inode *dir,return hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 ); } -static struct dentry *hfsplus_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hfsplus_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 ));fs/hostfs/hostfs_kern.c +1
-1@@ -686,7 +686,7 @@ static int hostfs_symlink(struct mnt_idmap *idmap, struct inode *ino,return err; } -static struct dentry *hostfs_mkdir (struct mnt_idmap *idmap,struct inode *ino, +static struct dentry *hostfs_mkdir (const struct mnt_idmap *idmap,struct inode *ino,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/hpfs/namei.c +1
-1@@ -19,7 +19,7 @@ static void hpfs_update_directory_times(struct inode *dir)hpfs_write_inode_nolock (dir); } -static struct dentry *hpfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hpfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {const unsigned char *name = dentry->d_name.name;fs/hugetlbfs/inode.c +1
-1@@ -967,7 +967,7 @@ static int hugetlbfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return 0 ; } -static struct dentry *hugetlbfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *hugetlbfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) { int retval = hugetlbfs_mknod(idmap, dir, dentry,fs/jffs2/dir.c +2
-2@@ -33,7 +33,7 @@ static int jffs2_link (struct dentry *,struct inode *,struct dentry *);static int jffs2_unlink (struct inode *,struct dentry *);static int jffs2_symlink (struct mnt_idmap *,struct inode *,struct dentry *,const char *); -static struct dentry *jffs2_mkdir (struct mnt_idmap *,struct inode *,struct dentry *, +static struct dentry *jffs2_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static int jffs2_rmdir (struct inode *,struct dentry *); static int jffs2_mknod (const struct mnt_idmap *, struct inode *,struct dentry *,@@ -448,7 +448,7 @@ static int jffs2_symlink (struct mnt_idmap *idmap, struct inode *dir_i, } -static struct dentry *jffs2_mkdir (struct mnt_idmap *idmap,struct inode *dir_i, +static struct dentry *jffs2_mkdir (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,umode_t mode) {struct jffs2_inode_info *f, *dir_f;fs/jfs/namei.c +1
-1@@ -193,7 +193,7 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip,* note: * EACCES: user needs search+write permission on the parent directory */ -static struct dentry *jfs_mkdir (struct mnt_idmap *idmap,struct inode *dip, +static struct dentry *jfs_mkdir (const struct mnt_idmap *idmap,struct inode *dip,struct dentry *dentry,umode_t mode) {int rc =0 ;fs/kernfs/dir.c +1
-1@@ -1288,7 +1288,7 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,return d_splice_alias (inode, dentry); } -static struct dentry *kernfs_iop_mkdir (struct mnt_idmap *idmap, +static struct dentry *kernfs_iop_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {fs/minix/namei.c +1
-1@@ -104,7 +104,7 @@ static int minix_link(struct dentry * old_dentry, struct inode * dir,return add_nondir (dentry, inode); } -static struct dentry *minix_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *minix_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode * inode;fs/nfs/dir.c +1
-1@@ -2475,7 +2475,7 @@ EXPORT_SYMBOL_GPL(nfs_mknod);/* * See comments for nfs_proc_create regarding failed operations. */ -struct dentry *nfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +struct dentry *nfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct iattr attr;fs/nfs/internal.h +1
-1@@ -398,7 +398,7 @@ struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);void nfs_d_prune_case_insensitive_aliases (struct inode *inode);int nfs_create (struct mnt_idmap *,struct inode *,struct dentry *,umode_t ); -struct dentry *nfs_mkdir (struct mnt_idmap *,struct inode *,struct dentry *, +struct dentry *nfs_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int nfs_rmdir (struct inode *,struct dentry *);int nfs_unlink (struct inode *,struct dentry *);fs/nilfs2/namei.c +1
-1@@ -218,7 +218,7 @@ static int nilfs_link(struct dentry *old_dentry, struct inode *dir,return err; } -static struct dentry *nilfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *nilfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/ntfs/namei.c +1
-1@@ -1049,7 +1049,7 @@ static int ntfs_unlink(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *ntfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ntfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/ntfs3/namei.c +1
-1@@ -228,7 +228,7 @@ static int ntfs_symlink(struct mnt_idmap *idmap, struct inode *dir,/* * ntfs_mkdir - inode_operations::mkdir */ -static struct dentry *ntfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ntfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) { return ERR_PTR(ntfs_create_inode(idmap, dir, dentry, NULL,fs/ocfs2/dlmfs/dlmfs.c +1
-1@@ -402,7 +402,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent,* File creation. Allocate an inode, and we're done.. */ /* SMP-safe */ -static struct dentry *dlmfs_mkdir (struct mnt_idmap * idmap, +static struct dentry *dlmfs_mkdir (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode)fs/ocfs2/namei.c +1
-1@@ -655,7 +655,7 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, suballoc_loc, suballoc_bit); } -static struct dentry *ocfs2_mkdir (struct mnt_idmap *idmap, +static struct dentry *ocfs2_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)fs/omfs/dir.c +1
-1@@ -279,7 +279,7 @@ static int omfs_add_node(struct inode *dir, struct dentry *dentry, umode_t mode)return err; } -static struct dentry *omfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *omfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (omfs_add_node (dir, dentry, mode));fs/orangefs/namei.c +1
-1@@ -296,7 +296,7 @@ static int orangefs_symlink(struct mnt_idmap *idmap,return ret; } -static struct dentry *orangefs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *orangefs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct orangefs_inode_s *parent =ORANGEFS_I (dir);fs/overlayfs/dir.c +1
-1@@ -736,7 +736,7 @@ static int ovl_create(struct mnt_idmap *idmap, struct inode *dir,return ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFREG ,0 ,NULL ); } -static struct dentry *ovl_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ovl_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ERR_PTR (ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFDIR ,0 ,NULL ));fs/ramfs/inode.c +1
-1@@ -118,7 +118,7 @@ ramfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return error; } -static struct dentry *ramfs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ramfs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int retval =ramfs_mknod (&nop_mnt_idmap, dir, dentry, mode,0 );fs/smb/client/cifsfs.h +1
-1@@ -66,7 +66,7 @@ int cifs_hardlink(struct dentry *old_file, struct inode *inode, struct dentry *direntry);int cifs_mknod (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode,dev_t device_number); -struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode, +struct dentry *cifs_mkdir (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode);int cifs_rmdir (struct inode *inode,struct dentry *direntry); int cifs_rename2(const struct mnt_idmap *idmap, struct inode *source_dir,fs/smb/client/inode.c +1
-1@@ -2276,7 +2276,7 @@ cifs_posix_mkdir(struct inode *inode, struct dentry *dentry, umode_t mode, }#endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ -struct dentry *cifs_mkdir (struct mnt_idmap *idmap,struct inode *inode, +struct dentry *cifs_mkdir (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,umode_t mode) {int rc =0 ;fs/tracefs/inode.c +1
-1@@ -94,7 +94,7 @@ static struct tracefs_dir_ops {int (*rmdir)(const char *name); } tracefs_ops__ro_after_init ; -static struct dentry *tracefs_syscall_mkdir (struct mnt_idmap *idmap, +static struct dentry *tracefs_syscall_mkdir (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *dentry,umode_t mode) {fs/ubifs/dir.c +1
-1@@ -1002,7 +1002,7 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)return err; } -static struct dentry *ubifs_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ubifs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/udf/namei.c +1
-1@@ -419,7 +419,7 @@ static int udf_mknod(const struct mnt_idmap *idmap, struct inode *dir,return udf_add_nondir (dentry, inode); } -static struct dentry *udf_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *udf_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/ufs/namei.c +1
-1@@ -165,7 +165,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir,return error; } -static struct dentry *ufs_mkdir (struct mnt_idmap * idmap,struct inode * dir, +static struct dentry *ufs_mkdir (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {struct inode * inode;fs/vboxsf/dir.c +1
-1@@ -303,7 +303,7 @@ static int vboxsf_dir_mkfile(struct mnt_idmap *idmap,return vboxsf_dir_create (parent, dentry, mode, false, true,NULL ); } -static struct dentry *vboxsf_dir_mkdir (struct mnt_idmap *idmap, +static struct dentry *vboxsf_dir_mkdir (const struct mnt_idmap *idmap,struct inode *parent,struct dentry *dentry,umode_t mode) {fs/xfs/xfs_iops.c +1
-1@@ -300,7 +300,7 @@ xfs_vn_create( STATIC struct dentry *xfs_vn_mkdir ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)include/linux/fs.h +1
-1@@ -2005,7 +2005,7 @@ struct inode_operations {int (*unlink) (struct inode *,struct dentry *);int (*symlink) (struct mnt_idmap *,struct inode *,struct dentry *,const char *); -struct dentry *(*mkdir) (struct mnt_idmap *,struct inode *, +struct dentry *(*mkdir) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,kernel/bpf/inode.c +1
-1@@ -176,7 +176,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode,inode_set_mtime_to_ts (dir,inode_set_ctime_current (dir)); } -static struct dentry *bpf_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *bpf_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;mm/shmem.c +1
-1@@ -3885,7 +3885,7 @@ shmem_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return error; } -static struct dentry *shmem_mkdir (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *shmem_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int error;security/apparmor/apparmorfs.c +1
-1@@ -2073,7 +2073,7 @@ int __aafs_profile_mkdir(struct aa_profile *profile, struct dentry *parent)return error; } -static struct dentry *ns_mkdir_op (struct mnt_idmap *idmap,struct inode *dir, +static struct dentry *ns_mkdir_op (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct aa_ns *ns, *parent;Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Christian Brauner
maintainerPATCH 21/27 fs: port ->symlink() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/autofs/root.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/configfs/configfs_internal.h | 2 +- fs/configfs/symlink.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/link.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- kernel/bpf/inode.c | 2 +- mm/shmem.c | 2 +- 46 files changed, 49 insertions(+), 49 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -65,7 +65,7 @@ prototypes:: 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 mnt_idmap *, struct inode *,struct dentry *,const char *); + int (*symlink) (const struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t);
Documentation/filesystems/vfs.rst +1 -1
@@ -419,7 +419,7 @@ As of kernel 2.6.22, the following members are defined: 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 mnt_idmap *, struct inode *,struct dentry *,const char *); + int (*symlink) (const struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t);
fs/9p/vfs_inode.c +1 -1
@@ -1249,7 +1249,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,*/ static int -v9fs_vfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) { p9_debug(P9_DEBUG_VFS, " %llu,%pd,%s\n",
fs/9p/vfs_inode_dotl.c +1 -1
@@ -682,7 +682,7 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, }static int -v9fs_vfs_symlink_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_symlink_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int err;
fs/affs/affs.h +1 -1
@@ -173,7 +173,7 @@ extern struct dentry *affs_mkdir(const struct mnt_idmap *idmap, struct inode *diextern int affs_rmdir (struct inode *dir,struct dentry *dentry);extern int affs_link (struct dentry *olddentry,struct inode *dir,struct dentry *dentry); -extern int affs_symlink (struct mnt_idmap *idmap, +extern int affs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname); extern int affs_rename2(const struct mnt_idmap *idmap,
fs/affs/namei.c +1 -1
@@ -313,7 +313,7 @@ affs_rmdir(struct inode *dir, struct dentry *dentry) }int -affs_symlink (struct mnt_idmap *idmap,struct inode *dir, +affs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct super_block *sb = dir->i_sb;
fs/afs/dir.c +2 -2
@@ -41,7 +41,7 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry);static int afs_unlink (struct inode *dir,struct dentry *dentry);static int afs_link (struct dentry *from,struct inode *dir,struct dentry *dentry); -static int afs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int afs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *content); static int afs_rename(const struct mnt_idmap *idmap, struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir,
@@ -1779,7 +1779,7 @@ static const struct afs_operation_ops afs_symlink_operation = {/* * create a symlink in an AFS filesystem */ -static int afs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int afs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *content) {struct afs_operation *op;
fs/autofs/root.c +2 -2
@@ -12,7 +12,7 @@#include "autofs_i.h" static int autofs_dir_permission (const struct mnt_idmap *,struct inode *,int ); -static int autofs_dir_symlink (struct mnt_idmap *,struct inode *, +static int autofs_dir_symlink (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);static int autofs_dir_unlink (struct inode *,struct dentry *);static int autofs_dir_rmdir (struct inode *,struct dentry *);
@@ -572,7 +572,7 @@ static int autofs_dir_permission(const struct mnt_idmap *idmap,return generic_permission (idmap, inode, mask); } -static int autofs_dir_symlink (struct mnt_idmap *idmap, +static int autofs_dir_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {
fs/bad_inode.c +1 -1
@@ -51,7 +51,7 @@ static int bad_inode_unlink(struct inode *dir, struct dentry *dentry)return -EIO ; } -static int bad_inode_symlink (struct mnt_idmap *idmap, +static int bad_inode_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {
fs/btrfs/inode.c +1 -1
@@ -9023,7 +9023,7 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, long nr,return ret; } -static int btrfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct btrfs_fs_info *fs_info =inode_to_fs_info (dir);
fs/ceph/dir.c +1 -1
@@ -1032,7 +1032,7 @@ static int prep_encrypted_symlink_target(struct ceph_mds_request *req, }#endif -static int ceph_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ceph_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *dest) {struct ceph_mds_client *mdsc =ceph_sb_to_mdsc (dir->i_sb);
fs/coda/dir.c +1 -1
@@ -233,7 +233,7 @@ static int coda_link(struct dentry *source_de, struct inode *dir_inode, } -static int coda_symlink (struct mnt_idmap *idmap, +static int coda_symlink (const struct mnt_idmap *idmap,struct inode *dir_inode,struct dentry *de,const char *symname) {
fs/configfs/configfs_internal.h +1 -1
@@ -90,7 +90,7 @@ extern const struct inode_operations configfs_root_inode_operations;extern const struct inode_operations configfs_symlink_inode_operations;extern const struct dentry_operations configfs_dentry_ops; -extern int configfs_symlink (struct mnt_idmap *idmap, +extern int configfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname);extern int configfs_unlink (struct inode *dir,struct dentry *dentry);
fs/configfs/symlink.c +1 -1
@@ -132,7 +132,7 @@ static int get_target(const char *symname, struct config_item **target, } -int configfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +int configfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int ret;
fs/ecryptfs/inode.c +1 -1
@@ -462,7 +462,7 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry)return ecryptfs_do_unlink (dir, dentry,d_inode (dentry)); } -static int ecryptfs_symlink (struct mnt_idmap *idmap, +static int ecryptfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {
fs/ext2/namei.c +1 -1
@@ -152,7 +152,7 @@ static int ext2_mknod (const struct mnt_idmap * idmap, struct inode * dir,return err; } -static int ext2_symlink (struct mnt_idmap * idmap,struct inode * dir, +static int ext2_symlink (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,const char * symname) {struct super_block * sb = dir->i_sb;
fs/ext4/namei.c +1 -1
@@ -3360,7 +3360,7 @@ static int ext4_init_symlink_block(handle_t *handle, struct inode *inode,return err; } -static int ext4_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {handle_t *handle;
fs/f2fs/namei.c +1 -1
@@ -662,7 +662,7 @@ static const char *f2fs_get_link(struct dentry *dentry,return link; } -static int f2fs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);
fs/fuse/dir.c +1 -1
@@ -1146,7 +1146,7 @@ static struct dentry *fuse_mkdir(const struct mnt_idmap *idmap, struct inode *direturn create_new_entry (idmap, fm, &args, dir, entry,S_IFDIR ); } -static int fuse_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,const char *link) {struct fuse_mount *fm =get_fuse_mount (dir);
fs/gfs2/inode.c +1 -1
@@ -1323,7 +1323,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)* Returns: errno */ -static int gfs2_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int gfs2_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {unsigned int size;
fs/hfsplus/dir.c +1 -1
@@ -460,7 +460,7 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)return res; } -static int hfsplus_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int hfsplus_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);
fs/hostfs/hostfs_kern.c +1 -1
@@ -673,7 +673,7 @@ static int hostfs_unlink(struct inode *ino, struct dentry *dentry)return err; } -static int hostfs_symlink (struct mnt_idmap *idmap,struct inode *ino, +static int hostfs_symlink (const struct mnt_idmap *idmap,struct inode *ino,struct dentry *dentry,const char *to) {char *file;
fs/hpfs/namei.c +1 -1
@@ -289,7 +289,7 @@ static int hpfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int hpfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int hpfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symlink) {const unsigned char *name = dentry->d_name.name;
fs/hugetlbfs/inode.c +1 -1
@@ -998,7 +998,7 @@ static int hugetlbfs_tmpfile(const struct mnt_idmap *idmap,return finish_open_simple (file,0 ); } -static int hugetlbfs_symlink (struct mnt_idmap *idmap, +static int hugetlbfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {
fs/jffs2/dir.c +2 -2
@@ -31,7 +31,7 @@ static struct dentry *jffs2_lookup (struct inode *,struct dentry *, unsigned int);static int jffs2_link (struct dentry *,struct inode *,struct dentry *);static int jffs2_unlink (struct inode *,struct dentry *); -static int jffs2_symlink (struct mnt_idmap *,struct inode *, +static int jffs2_symlink (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);static struct dentry *jffs2_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );
@@ -284,7 +284,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de/***********************************************************************/ -static int jffs2_symlink (struct mnt_idmap *idmap,struct inode *dir_i, +static int jffs2_symlink (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,const char *target) {struct jffs2_inode_info *f, *dir_f;
fs/jfs/namei.c +1 -1
@@ -876,7 +876,7 @@ static int jfs_link(struct dentry *old_dentry,* an intermediate result whose length exceeds PATH_MAX [XPG4.2] */ -static int jfs_symlink (struct mnt_idmap *idmap,struct inode *dip, +static int jfs_symlink (const struct mnt_idmap *idmap,struct inode *dip,struct dentry *dentry,const char *name) {int rc;
fs/minix/namei.c +1 -1
@@ -69,7 +69,7 @@ static int minix_create(struct mnt_idmap *idmap, struct inode *dir,return minix_mknod (&nop_mnt_idmap, dir, dentry, mode,0 ); } -static int minix_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int minix_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int i =strlen (symname)+1 ;
fs/nfs/dir.c +1 -1
@@ -2641,7 +2641,7 @@ EXPORT_SYMBOL_GPL(nfs_unlink);* now have a new file handle and can instantiate an in-core NFS inode * and move the raw page into its mapping. */ -int nfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +int nfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct folio *folio;
fs/nfs/internal.h +1 -1
@@ -402,7 +402,7 @@ struct dentry *nfs_mkdir(const struct mnt_idmap *, struct inode *, struct dentry umode_t);int nfs_rmdir (struct inode *,struct dentry *);int nfs_unlink (struct inode *,struct dentry *); -int nfs_symlink (struct mnt_idmap *,struct inode *,struct dentry *, +int nfs_symlink (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);int nfs_link (struct dentry *,struct inode *,struct dentry *); int nfs_mknod(const struct mnt_idmap *, struct inode *, struct dentry *, umode_t,
fs/nilfs2/namei.c +1 -1
@@ -138,7 +138,7 @@ nilfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int nilfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int nilfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct nilfs_transaction_info ti;
fs/ntfs/namei.c +1 -1
@@ -1399,7 +1399,7 @@ static int ntfs_rename(const struct mnt_idmap *idmap, struct inode *old_dir,return err; } -static int ntfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct super_block *sb = dir->i_sb;
fs/ntfs3/namei.c +1 -1
@@ -209,7 +209,7 @@ static int ntfs_unlink(struct inode *dir, struct dentry *dentry)/* * ntfs_symlink - inode_operations::symlink */ -static int ntfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {u32 size =strlen (symname);
fs/ocfs2/namei.c +1 -1
@@ -1815,7 +1815,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb,return status; } -static int ocfs2_symlink (struct mnt_idmap *idmap, +static int ocfs2_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname)
fs/orangefs/namei.c +1 -1
@@ -211,7 +211,7 @@ static int orangefs_unlink(struct inode *dir, struct dentry *dentry)return ret; } -static int orangefs_symlink (struct mnt_idmap *idmap, +static int orangefs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname)
fs/overlayfs/dir.c +1 -1
@@ -752,7 +752,7 @@ static int ovl_mknod(const struct mnt_idmap *idmap, struct inode *dir,return ovl_create_object (idmap, dentry, mode, rdev,NULL ); } -static int ovl_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *link) {return ovl_create_object (idmap, dentry,S_IFLNK ,0 , link);
fs/ramfs/inode.c +1 -1
@@ -133,7 +133,7 @@ static int ramfs_create(struct mnt_idmap *idmap, struct inode *dir,return ramfs_mknod (&nop_mnt_idmap, dir, dentry, mode |S_IFREG ,0 ); } -static int ramfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ramfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct inode *inode;
fs/smb/client/cifsfs.h +1 -1
@@ -129,7 +129,7 @@ struct vfsmount *cifs_d_automount(struct path *path);/* Functions related to symlinks */ const char *cifs_get_link (struct dentry *dentry,struct inode *inode,struct delayed_call *done); -int cifs_symlink (struct mnt_idmap *idmap,struct inode *inode, +int cifs_symlink (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,const char *symname);#ifdef CONFIG_CIFS_XATTR
fs/smb/client/link.c +1 -1
@@ -533,7 +533,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, }int -cifs_symlink (struct mnt_idmap *idmap,struct inode *inode, +cifs_symlink (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,const char *symname) {struct cifs_sb_info *cifs_sb =CIFS_SB (inode);
fs/ubifs/dir.c +1 -1
@@ -1170,7 +1170,7 @@ static int ubifs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ubifs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct inode *inode;
fs/udf/namei.c +1 -1
@@ -567,7 +567,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)return ret; } -static int udf_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int udf_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct inode *inode;
fs/ufs/namei.c +1 -1
@@ -105,7 +105,7 @@ static int ufs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ufs_symlink (struct mnt_idmap * idmap,struct inode * dir, +static int ufs_symlink (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,const char * symname) {struct super_block * sb = dir->i_sb;
fs/vboxsf/dir.c +1 -1
@@ -425,7 +425,7 @@ static int vboxsf_dir_rename(const struct mnt_idmap *idmap,return err; } -static int vboxsf_dir_symlink (struct mnt_idmap *idmap, +static int vboxsf_dir_symlink (const struct mnt_idmap *idmap,struct inode *parent,struct dentry *dentry,const char *symname) {
fs/xfs/xfs_iops.c +1 -1
@@ -425,7 +425,7 @@ xfs_vn_unlink( STATIC intxfs_vn_symlink ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname)
include/linux/fs.h +1 -1
@@ -2003,7 +2003,7 @@ struct inode_operations { umode_t);int (*link) (struct dentry *,struct inode *,struct dentry *);int (*unlink) (struct inode *,struct dentry *); -int (*symlink) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*symlink) (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);struct dentry *(*mkdir) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );
kernel/bpf/inode.c +1 -1
@@ -424,7 +424,7 @@ bpf_lookup(struct inode *dir, struct dentry *dentry, unsigned flags)return simple_lookup (dir, dentry, flags); } -static int bpf_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int bpf_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *target) {struct inode *inode;
mm/shmem.c +1 -1
@@ -4047,7 +4047,7 @@ static int shmem_rename2(const struct mnt_idmap *idmap,return 0 ; } -static int shmem_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int shmem_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int error;
Signature · 1 line
2.53.0
Re: [PATCH 21/27] fs: port ->symlink() to pass const mnt_idmap
Quoted 8 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
Quoted 7 lines
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 678 lines
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/autofs/root.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/configfs/configfs_internal.h | 2 +- fs/configfs/symlink.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ext2/namei.c | 2 +- fs/ext4/namei.c | 2 +- fs/f2fs/namei.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/link.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- kernel/bpf/inode.c | 2 +- mm/shmem.c | 2 +- 46 files changed, 49 insertions(+), 49 deletions(-)Documentation/filesystems/locking.rst +1
-1@@ -65,7 +65,7 @@ prototypes:: 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 mnt_idmap *, struct inode *,struct dentry *,const char *); + int (*symlink) (const struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t);Documentation/filesystems/vfs.rst +1
-1@@ -419,7 +419,7 @@ As of kernel 2.6.22, the following members are defined: 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 mnt_idmap *, struct inode *,struct dentry *,const char *); + int (*symlink) (const struct mnt_idmap *, struct inode *,struct dentry *,const char *); struct dentry *(*mkdir) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t);fs/9p/vfs_inode.c +1
-1@@ -1249,7 +1249,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry,*/ static int -v9fs_vfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) { p9_debug(P9_DEBUG_VFS, " %llu,%pd,%s\n",fs/9p/vfs_inode_dotl.c +1
-1@@ -682,7 +682,7 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, }static int -v9fs_vfs_symlink_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_symlink_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int err;fs/affs/affs.h +1
-1@@ -173,7 +173,7 @@ extern struct dentry *affs_mkdir(const struct mnt_idmap *idmap, struct inode *diextern int affs_rmdir (struct inode *dir,struct dentry *dentry);extern int affs_link (struct dentry *olddentry,struct inode *dir,struct dentry *dentry); -extern int affs_symlink (struct mnt_idmap *idmap, +extern int affs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname); extern int affs_rename2(const struct mnt_idmap *idmap,fs/affs/namei.c +1
-1@@ -313,7 +313,7 @@ affs_rmdir(struct inode *dir, struct dentry *dentry) }int -affs_symlink (struct mnt_idmap *idmap,struct inode *dir, +affs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct super_block *sb = dir->i_sb;fs/afs/dir.c +2
-2@@ -41,7 +41,7 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry);static int afs_unlink (struct inode *dir,struct dentry *dentry);static int afs_link (struct dentry *from,struct inode *dir,struct dentry *dentry); -static int afs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int afs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *content); static int afs_rename(const struct mnt_idmap *idmap, struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir,@@ -1779,7 +1779,7 @@ static const struct afs_operation_ops afs_symlink_operation = {/* * create a symlink in an AFS filesystem */ -static int afs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int afs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *content) {struct afs_operation *op;fs/autofs/root.c +2
-2@@ -12,7 +12,7 @@#include "autofs_i.h" static int autofs_dir_permission (const struct mnt_idmap *,struct inode *,int ); -static int autofs_dir_symlink (struct mnt_idmap *,struct inode *, +static int autofs_dir_symlink (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);static int autofs_dir_unlink (struct inode *,struct dentry *);static int autofs_dir_rmdir (struct inode *,struct dentry *);@@ -572,7 +572,7 @@ static int autofs_dir_permission(const struct mnt_idmap *idmap,return generic_permission (idmap, inode, mask); } -static int autofs_dir_symlink (struct mnt_idmap *idmap, +static int autofs_dir_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {fs/bad_inode.c +1
-1@@ -51,7 +51,7 @@ static int bad_inode_unlink(struct inode *dir, struct dentry *dentry)return -EIO ; } -static int bad_inode_symlink (struct mnt_idmap *idmap, +static int bad_inode_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {fs/btrfs/inode.c +1
-1@@ -9023,7 +9023,7 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, long nr,return ret; } -static int btrfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct btrfs_fs_info *fs_info =inode_to_fs_info (dir);fs/ceph/dir.c +1
-1@@ -1032,7 +1032,7 @@ static int prep_encrypted_symlink_target(struct ceph_mds_request *req, }#endif -static int ceph_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ceph_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *dest) {struct ceph_mds_client *mdsc =ceph_sb_to_mdsc (dir->i_sb);fs/coda/dir.c +1
-1@@ -233,7 +233,7 @@ static int coda_link(struct dentry *source_de, struct inode *dir_inode, } -static int coda_symlink (struct mnt_idmap *idmap, +static int coda_symlink (const struct mnt_idmap *idmap,struct inode *dir_inode,struct dentry *de,const char *symname) {fs/configfs/configfs_internal.h +1
-1@@ -90,7 +90,7 @@ extern const struct inode_operations configfs_root_inode_operations;extern const struct inode_operations configfs_symlink_inode_operations;extern const struct dentry_operations configfs_dentry_ops; -extern int configfs_symlink (struct mnt_idmap *idmap, +extern int configfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname);extern int configfs_unlink (struct inode *dir,struct dentry *dentry);fs/configfs/symlink.c +1
-1@@ -132,7 +132,7 @@ static int get_target(const char *symname, struct config_item **target, } -int configfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +int configfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int ret;fs/ecryptfs/inode.c +1
-1@@ -462,7 +462,7 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry)return ecryptfs_do_unlink (dir, dentry,d_inode (dentry)); } -static int ecryptfs_symlink (struct mnt_idmap *idmap, +static int ecryptfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {fs/ext2/namei.c +1
-1@@ -152,7 +152,7 @@ static int ext2_mknod (const struct mnt_idmap * idmap, struct inode * dir,return err; } -static int ext2_symlink (struct mnt_idmap * idmap,struct inode * dir, +static int ext2_symlink (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,const char * symname) {struct super_block * sb = dir->i_sb;fs/ext4/namei.c +1
-1@@ -3360,7 +3360,7 @@ static int ext4_init_symlink_block(handle_t *handle, struct inode *inode,return err; } -static int ext4_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {handle_t *handle;fs/f2fs/namei.c +1
-1@@ -662,7 +662,7 @@ static const char *f2fs_get_link(struct dentry *dentry,return link; } -static int f2fs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);fs/fuse/dir.c +1
-1@@ -1146,7 +1146,7 @@ static struct dentry *fuse_mkdir(const struct mnt_idmap *idmap, struct inode *direturn create_new_entry (idmap, fm, &args, dir, entry,S_IFDIR ); } -static int fuse_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,const char *link) {struct fuse_mount *fm =get_fuse_mount (dir);fs/gfs2/inode.c +1
-1@@ -1323,7 +1323,7 @@ static int gfs2_unlink(struct inode *dir, struct dentry *dentry)* Returns: errno */ -static int gfs2_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int gfs2_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {unsigned int size;fs/hfsplus/dir.c +1
-1@@ -460,7 +460,7 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)return res; } -static int hfsplus_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int hfsplus_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct hfsplus_sb_info *sbi =HFSPLUS_SB (dir->i_sb);fs/hostfs/hostfs_kern.c +1
-1@@ -673,7 +673,7 @@ static int hostfs_unlink(struct inode *ino, struct dentry *dentry)return err; } -static int hostfs_symlink (struct mnt_idmap *idmap,struct inode *ino, +static int hostfs_symlink (const struct mnt_idmap *idmap,struct inode *ino,struct dentry *dentry,const char *to) {char *file;fs/hpfs/namei.c +1
-1@@ -289,7 +289,7 @@ static int hpfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int hpfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int hpfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symlink) {const unsigned char *name = dentry->d_name.name;fs/hugetlbfs/inode.c +1
-1@@ -998,7 +998,7 @@ static int hugetlbfs_tmpfile(const struct mnt_idmap *idmap,return finish_open_simple (file,0 ); } -static int hugetlbfs_symlink (struct mnt_idmap *idmap, +static int hugetlbfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {fs/jffs2/dir.c +2
-2@@ -31,7 +31,7 @@ static struct dentry *jffs2_lookup (struct inode *,struct dentry *, unsigned int);static int jffs2_link (struct dentry *,struct inode *,struct dentry *);static int jffs2_unlink (struct inode *,struct dentry *); -static int jffs2_symlink (struct mnt_idmap *,struct inode *, +static int jffs2_symlink (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);static struct dentry *jffs2_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );@@ -284,7 +284,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de/***********************************************************************/ -static int jffs2_symlink (struct mnt_idmap *idmap,struct inode *dir_i, +static int jffs2_symlink (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,const char *target) {struct jffs2_inode_info *f, *dir_f;fs/jfs/namei.c +1
-1@@ -876,7 +876,7 @@ static int jfs_link(struct dentry *old_dentry,* an intermediate result whose length exceeds PATH_MAX [XPG4.2] */ -static int jfs_symlink (struct mnt_idmap *idmap,struct inode *dip, +static int jfs_symlink (const struct mnt_idmap *idmap,struct inode *dip,struct dentry *dentry,const char *name) {int rc;fs/minix/namei.c +1
-1@@ -69,7 +69,7 @@ static int minix_create(struct mnt_idmap *idmap, struct inode *dir,return minix_mknod (&nop_mnt_idmap, dir, dentry, mode,0 ); } -static int minix_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int minix_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int i =strlen (symname)+1 ;fs/nfs/dir.c +1
-1@@ -2641,7 +2641,7 @@ EXPORT_SYMBOL_GPL(nfs_unlink);* now have a new file handle and can instantiate an in-core NFS inode * and move the raw page into its mapping. */ -int nfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +int nfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct folio *folio;fs/nfs/internal.h +1
-1@@ -402,7 +402,7 @@ struct dentry *nfs_mkdir(const struct mnt_idmap *, struct inode *, struct dentry umode_t);int nfs_rmdir (struct inode *,struct dentry *);int nfs_unlink (struct inode *,struct dentry *); -int nfs_symlink (struct mnt_idmap *,struct inode *,struct dentry *, +int nfs_symlink (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);int nfs_link (struct dentry *,struct inode *,struct dentry *); int nfs_mknod(const struct mnt_idmap *, struct inode *, struct dentry *, umode_t,fs/nilfs2/namei.c +1
-1@@ -138,7 +138,7 @@ nilfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int nilfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int nilfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct nilfs_transaction_info ti;fs/ntfs/namei.c +1
-1@@ -1399,7 +1399,7 @@ static int ntfs_rename(const struct mnt_idmap *idmap, struct inode *old_dir,return err; } -static int ntfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct super_block *sb = dir->i_sb;fs/ntfs3/namei.c +1
-1@@ -209,7 +209,7 @@ static int ntfs_unlink(struct inode *dir, struct dentry *dentry)/* * ntfs_symlink - inode_operations::symlink */ -static int ntfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {u32 size =strlen (symname);fs/ocfs2/namei.c +1
-1@@ -1815,7 +1815,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb,return status; } -static int ocfs2_symlink (struct mnt_idmap *idmap, +static int ocfs2_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname)fs/orangefs/namei.c +1
-1@@ -211,7 +211,7 @@ static int orangefs_unlink(struct inode *dir, struct dentry *dentry)return ret; } -static int orangefs_symlink (struct mnt_idmap *idmap, +static int orangefs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname)fs/overlayfs/dir.c +1
-1@@ -752,7 +752,7 @@ static int ovl_mknod(const struct mnt_idmap *idmap, struct inode *dir,return ovl_create_object (idmap, dentry, mode, rdev,NULL ); } -static int ovl_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *link) {return ovl_create_object (idmap, dentry,S_IFLNK ,0 , link);fs/ramfs/inode.c +1
-1@@ -133,7 +133,7 @@ static int ramfs_create(struct mnt_idmap *idmap, struct inode *dir,return ramfs_mknod (&nop_mnt_idmap, dir, dentry, mode |S_IFREG ,0 ); } -static int ramfs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ramfs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct inode *inode;fs/smb/client/cifsfs.h +1
-1@@ -129,7 +129,7 @@ struct vfsmount *cifs_d_automount(struct path *path);/* Functions related to symlinks */ const char *cifs_get_link (struct dentry *dentry,struct inode *inode,struct delayed_call *done); -int cifs_symlink (struct mnt_idmap *idmap,struct inode *inode, +int cifs_symlink (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,const char *symname);#ifdef CONFIG_CIFS_XATTR fs/smb/client/link.c +1
-1@@ -533,7 +533,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, }int -cifs_symlink (struct mnt_idmap *idmap,struct inode *inode, +cifs_symlink (const struct mnt_idmap *idmap,struct inode *inode,struct dentry *direntry,const char *symname) {struct cifs_sb_info *cifs_sb =CIFS_SB (inode);fs/ubifs/dir.c +1
-1@@ -1170,7 +1170,7 @@ static int ubifs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ubifs_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct inode *inode;fs/udf/namei.c +1
-1@@ -567,7 +567,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)return ret; } -static int udf_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int udf_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {struct inode *inode;fs/ufs/namei.c +1
-1@@ -105,7 +105,7 @@ static int ufs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ufs_symlink (struct mnt_idmap * idmap,struct inode * dir, +static int ufs_symlink (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,const char * symname) {struct super_block * sb = dir->i_sb;fs/vboxsf/dir.c +1
-1@@ -425,7 +425,7 @@ static int vboxsf_dir_rename(const struct mnt_idmap *idmap,return err; } -static int vboxsf_dir_symlink (struct mnt_idmap *idmap, +static int vboxsf_dir_symlink (const struct mnt_idmap *idmap,struct inode *parent,struct dentry *dentry,const char *symname) {fs/xfs/xfs_iops.c +1
-1@@ -425,7 +425,7 @@ xfs_vn_unlink( STATIC intxfs_vn_symlink ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname)include/linux/fs.h +1
-1@@ -2003,7 +2003,7 @@ struct inode_operations { umode_t);int (*link) (struct dentry *,struct inode *,struct dentry *);int (*unlink) (struct inode *,struct dentry *); -int (*symlink) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*symlink) (const struct mnt_idmap *,struct inode *,struct dentry *,const char *);struct dentry *(*mkdir) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );kernel/bpf/inode.c +1
-1@@ -424,7 +424,7 @@ bpf_lookup(struct inode *dir, struct dentry *dentry, unsigned flags)return simple_lookup (dir, dentry, flags); } -static int bpf_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int bpf_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *target) {struct inode *inode;mm/shmem.c +1
-1@@ -4047,7 +4047,7 @@ static int shmem_rename2(const struct mnt_idmap *idmap,return 0 ; } -static int shmem_symlink (struct mnt_idmap *idmap,struct inode *dir, +static int shmem_symlink (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const char *symname) {int error;Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Christian Brauner
maintainerPATCH 22/27 fs: port ->create() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/bad_inode.c | 2 +- fs/bfs/dir.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/efivarfs/inode.c | 2 +- fs/exfat/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 | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/omfs/dir.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- ipc/mqueue.c | 2 +- mm/shmem.c | 2 +- 51 files changed, 53 insertions(+), 53 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -61,7 +61,7 @@ inode_operations prototypes:: - int (*create) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); + int (*create) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *);
Documentation/filesystems/vfs.rst +1 -1
@@ -415,7 +415,7 @@ As of kernel 2.6.22, the following members are defined: .. code-block:: c struct inode_operations { - int (*create) (struct mnt_idmap *, struct inode *,struct dentry *, umode_t); + int (*create) (const struct mnt_idmap *, struct inode *,struct dentry *, umode_t); struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *);
fs/9p/vfs_inode.c +1 -1
@@ -652,7 +652,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,*/ static int -v9fs_vfs_create (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct v9fs_session_info *v9ses =v9fs_inode2v9ses (dir);
fs/9p/vfs_inode_dotl.c +1 -1
@@ -216,7 +216,7 @@ int v9fs_open_to_dotl_flags(int flags)* */ static int -v9fs_vfs_create_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_create_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode) {return v9fs_vfs_mknod_dotl (idmap, dir, dentry, omode,0 );
fs/affs/affs.h +1 -1
@@ -166,7 +166,7 @@ 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 );extern int affs_unlink (struct inode *dir,struct dentry *dentry); -extern int affs_create (struct mnt_idmap *idmap,struct inode *dir, +extern int affs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);extern struct dentry *affs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);
fs/affs/namei.c +1 -1
@@ -242,7 +242,7 @@ affs_unlink(struct inode *dir, struct dentry *dentry) }int -affs_create (struct mnt_idmap *idmap,struct inode *dir, +affs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/afs/dir.c +2 -2
@@ -33,7 +33,7 @@ static bool afs_lookup_one_filldir(struct dir_context *ctx, const char *name, instatic bool afs_lookup_filldir (struct dir_context *ctx,const char *name,int nlen,u64 ino,u32 uniquifier);#define AFS_LOOKUP ((filldir_t)0x137UL) -static int afs_create (struct mnt_idmap *idmap,struct inode *dir, +static int afs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);static struct dentry *afs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);
@@ -1632,7 +1632,7 @@ static const struct afs_operation_ops afs_create_operation = {/* * create a regular file on an AFS filesystem */ -static int afs_create (struct mnt_idmap *idmap,struct inode *dir, +static int afs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct afs_operation *op;
fs/bad_inode.c +1 -1
@@ -27,7 +27,7 @@ static const struct file_operations bad_file_ops = .open = bad_file_open, }; -static int bad_inode_create (struct mnt_idmap *idmap, +static int bad_inode_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {
fs/bfs/dir.c +1 -1
@@ -75,7 +75,7 @@ const struct file_operations bfs_dir_operations = { .llseek = generic_file_llseek, }; -static int bfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int bfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int err;
fs/btrfs/inode.c +1 -1
@@ -7018,7 +7018,7 @@ static int btrfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return btrfs_create_common (dir, dentry, inode); } -static int btrfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/ceph/dir.c +1 -1
@@ -988,7 +988,7 @@ static int ceph_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ceph_create (struct mnt_idmap *idmap,struct inode *dir, +static int ceph_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ceph_mknod (idmap, dir, dentry, mode,0 );
fs/coda/dir.c +1 -1
@@ -133,7 +133,7 @@ static inline void coda_dir_drop_nlink(struct inode *dir) }/* creation routines: create, mknod, mkdir, link, symlink */ -static int coda_create (struct mnt_idmap *idmap,struct inode *dir, +static int coda_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *de,umode_t mode) {int error;
fs/ecryptfs/inode.c +1 -1
@@ -266,7 +266,7 @@ int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry,* Returns zero on success; non-zero on error condition */ static int -ecryptfs_create (struct mnt_idmap *idmap, +ecryptfs_create (const struct mnt_idmap *idmap,struct inode *directory_inode,struct dentry *ecryptfs_dentry,umode_t mode) {
fs/efivarfs/inode.c +1 -1
@@ -74,7 +74,7 @@ static bool efivarfs_valid_name(const char *str, int len)return uuid_is_valid (s); } -static int efivarfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int efivarfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode =NULL ;
fs/exfat/namei.c +1 -1
@@ -552,7 +552,7 @@ static int exfat_add_entry(struct inode *inode, const char *path,return ret; } -static int exfat_create (struct mnt_idmap *idmap,struct inode *dir, +static int exfat_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/ext2/namei.c +1 -1
@@ -97,7 +97,7 @@ struct dentry *ext2_get_parent(struct dentry *child)* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int ext2_create (struct mnt_idmap * idmap, +static int ext2_create (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {
fs/ext4/namei.c +1 -1
@@ -2812,7 +2812,7 @@ static int ext4_add_nondir(handle_t *handle,* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int ext4_create (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {handle_t *handle;
fs/f2fs/namei.c +1 -1
@@ -365,7 +365,7 @@ static struct inode *f2fs_new_inode(const struct mnt_idmap *idmap,return ERR_PTR (err); } -static int f2fs_create (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);
fs/fat/namei_msdos.c +1 -1
@@ -263,7 +263,7 @@ static int msdos_add_entry(struct inode *dir, const unsigned char *name, }/***** Create a file */ -static int msdos_create (struct mnt_idmap *idmap,struct inode *dir, +static int msdos_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/fat/namei_vfat.c +1 -1
@@ -753,7 +753,7 @@ static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry,return ERR_PTR (err); } -static int vfat_create (struct mnt_idmap *idmap,struct inode *dir, +static int vfat_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;
fs/fuse/dir.c +1 -1
@@ -1092,7 +1092,7 @@ static int fuse_mknod(const struct mnt_idmap *idmap, struct inode *dir,return create_new_nondir (idmap, fm, &args, dir, entry, mode); } -static int fuse_create (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,umode_t mode) {return fuse_mknod (idmap, dir, entry, mode,0 );
fs/gfs2/inode.c +1 -1
@@ -967,7 +967,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,* Returns: errno */ -static int gfs2_create (struct mnt_idmap *idmap,struct inode *dir, +static int gfs2_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return gfs2_create_inode (dir, dentry,NULL ,S_IFREG | mode,0 ,NULL ,0 ,1 );
fs/hfs/dir.c +1 -1
@@ -183,7 +183,7 @@ static int hfs_dir_release(struct inode *inode, struct file *file)* a directory and return a corresponding inode, given the inode for * the directory and the name (and its length) of the new file. */ -static int hfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int hfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/hfsplus/dir.c +1 -1
@@ -561,7 +561,7 @@ static int hfsplus_mknod(const struct mnt_idmap *idmap, struct inode *dir,return res; } -static int hfsplus_create (struct mnt_idmap *idmap,struct inode *dir, +static int hfsplus_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 );
fs/hostfs/hostfs_kern.c +1 -1
@@ -592,7 +592,7 @@ static struct inode *hostfs_iget(struct super_block *sb, char *name)return inode; } -static int hostfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int hostfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/hpfs/namei.c +1 -1
@@ -128,7 +128,7 @@ static struct dentry *hpfs_mkdir(const struct mnt_idmap *idmap, struct inode *direturn ERR_PTR (err); } -static int hpfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int hpfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {const unsigned char *name = dentry->d_name.name;
fs/hugetlbfs/inode.c +1 -1
@@ -977,7 +977,7 @@ static struct dentry *hugetlbfs_mkdir(const struct mnt_idmap *idmap, struct inodreturn ERR_PTR (retval); } -static int hugetlbfs_create (struct mnt_idmap *idmap, +static int hugetlbfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {
fs/jffs2/dir.c +2 -2
@@ -25,7 +25,7 @@static int jffs2_readdir (struct file *,struct dir_context *); -static int jffs2_create (struct mnt_idmap *,struct inode *, +static int jffs2_create (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static struct dentry *jffs2_lookup (struct inode *,struct dentry *,unsigned int );
@@ -162,7 +162,7 @@ static int jffs2_readdir(struct file *file, struct dir_context *ctx)/***********************************************************************/ -static int jffs2_create (struct mnt_idmap *idmap,struct inode *dir_i, +static int jffs2_create (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,umode_t mode) {struct jffs2_raw_inode *ri;
fs/jfs/namei.c +1 -1
@@ -60,7 +60,7 @@ static inline void free_ea_wmap(struct inode *inode)* RETURN: Errors from subroutines * */ -static int jfs_create (struct mnt_idmap *idmap,struct inode *dip, +static int jfs_create (const struct mnt_idmap *idmap,struct inode *dip,struct dentry *dentry,umode_t mode) {int rc =0 ;
fs/minix/namei.c +1 -1
@@ -63,7 +63,7 @@ static int minix_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return finish_open_simple (file,0 ); } -static int minix_create (struct mnt_idmap *idmap,struct inode *dir, +static int minix_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return minix_mknod (&nop_mnt_idmap, dir, dentry, mode,0 );
fs/nfs/dir.c +1 -1
@@ -2437,7 +2437,7 @@ static int nfs_do_create(struct inode *dir, struct dentry *dentry,return error; } -int nfs_create (struct mnt_idmap *idmap,struct inode *dir, +int nfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return nfs_do_create (dir, dentry, mode,O_EXCL );
fs/nfs/internal.h +1 -1
@@ -396,7 +396,7 @@ extern unsigned long nfs_access_cache_scan(struct shrinker *shrink, struct shrink_control *sc);struct dentry *nfs_lookup (struct inode *,struct dentry *,unsigned int );void nfs_d_prune_case_insensitive_aliases (struct inode *inode); -int nfs_create (struct mnt_idmap *,struct inode *,struct dentry *, +int nfs_create (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );struct dentry *nfs_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );
fs/nilfs2/namei.c +1 -1
@@ -85,7 +85,7 @@ nilfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int nilfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int nilfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/ntfs/namei.c +1 -1
@@ -732,7 +732,7 @@ static struct ntfs_inode *__ntfs_create(const struct mnt_idmap *idmap, struct inreturn ERR_PTR (err); } -static int ntfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct ntfs_volume *vol =NTFS_SB (dir->i_sb);
fs/ntfs3/namei.c +1 -1
@@ -111,7 +111,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,/* * ntfs_create - inode_operations::create */ -static int ntfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) { return ntfs_create_inode(idmap, dir, dentry, NULL, S_IFREG | mode, 0,
fs/ocfs2/dlmfs/dlmfs.c +1 -1
@@ -450,7 +450,7 @@ static struct dentry *dlmfs_mkdir(const struct mnt_idmap * idmap,return ERR_PTR (status); } -static int dlmfs_create (struct mnt_idmap *idmap, +static int dlmfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)
fs/ocfs2/namei.c +1 -1
@@ -671,7 +671,7 @@ static struct dentry *ocfs2_mkdir(const struct mnt_idmap *idmap,return ERR_PTR (ret); } -static int ocfs2_create (struct mnt_idmap *idmap, +static int ocfs2_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)
fs/omfs/dir.c +1 -1
@@ -285,7 +285,7 @@ static struct dentry *omfs_mkdir(const struct mnt_idmap *idmap, struct inode *direturn ERR_PTR (omfs_add_node (dir, dentry, mode)); } -static int omfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int omfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return omfs_add_node (dir, dentry, mode |S_IFREG );
fs/orangefs/namei.c +1 -1
@@ -15,7 +15,7 @@/* * Get a newly allocated inode to go with a negative dentry. */ -static int orangefs_create (struct mnt_idmap *idmap, +static int orangefs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)
fs/overlayfs/dir.c +1 -1
@@ -730,7 +730,7 @@ static int ovl_create_object(const struct mnt_idmap *idmap, struct dentry *dentrreturn err; } -static int ovl_create (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFREG ,0 ,NULL );
fs/ramfs/inode.c +1 -1
@@ -127,7 +127,7 @@ static struct dentry *ramfs_mkdir(const struct mnt_idmap *idmap, struct inode *dreturn ERR_PTR (retval); } -static int ramfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ramfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ramfs_mknod (&nop_mnt_idmap, dir, dentry, mode |S_IFREG ,0 );
fs/smb/client/cifsfs.h +1 -1
@@ -53,7 +53,7 @@ void cifs_sb_deactive(struct super_block *sb);/* Functions related to inodes */ extern const struct inode_operations cifs_dir_inode_ops;struct inode *cifs_root_iget (struct super_block *sb); -int cifs_create (struct mnt_idmap *idmap,struct inode *dir, +int cifs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *direntry,umode_t mode);int cifs_atomic_open (struct inode *dir,struct dentry *direntry,struct file *file,unsigned int oflags,umode_t mode);
fs/smb/client/dir.c +1 -1
@@ -640,7 +640,7 @@ int cifs_atomic_open(struct inode *dir, struct dentry *direntry,* The initial dentry state is hashed-negative. On success, dentry will become * hashed-positive by calling d_instantiate(). */ -int cifs_create (struct mnt_idmap *idmap,struct inode *dir, +int cifs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *direntry,umode_t mode) {struct cifs_sb_info *cifs_sb =CIFS_SB (dir);
fs/ubifs/dir.c +1 -1
@@ -302,7 +302,7 @@ static int ubifs_prepare_create(struct inode *dir, struct dentry *dentry,return fscrypt_setup_filename (dir, &dentry->d_name,0 , nm); } -static int ubifs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;
fs/udf/namei.c +1 -1
@@ -370,7 +370,7 @@ static int udf_add_nondir(struct dentry *dentry, struct inode *inode)return 0 ; } -static int udf_create (struct mnt_idmap *idmap,struct inode *dir, +static int udf_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode =udf_new_inode (dir, mode);
fs/ufs/namei.c +1 -1
@@ -69,7 +69,7 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, unsi* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int ufs_create (struct mnt_idmap * idmap, +static int ufs_create (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {struct inode *inode;
fs/vboxsf/dir.c +1 -1
@@ -296,7 +296,7 @@ static int vboxsf_dir_create(struct inode *parent, struct dentry *dentry,return err; } -static int vboxsf_dir_mkfile (struct mnt_idmap *idmap, +static int vboxsf_dir_mkfile (const struct mnt_idmap *idmap,struct inode *parent,struct dentry *dentry,umode_t mode) {
fs/xfs/xfs_iops.c +1 -1
@@ -290,7 +290,7 @@ xfs_vn_mknod( STATIC intxfs_vn_create ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)
include/linux/fs.h +1 -1
@@ -1999,7 +1999,7 @@ struct inode_operations {int (*readlink) (struct dentry *,char __user *,int ); -int (*create) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*create) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int (*link) (struct dentry *,struct inode *,struct dentry *);int (*unlink) (struct inode *,struct dentry *);
ipc/mqueue.c +1 -1
@@ -607,7 +607,7 @@ static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg)return error; } -static int mqueue_create (struct mnt_idmap *idmap,struct inode *dir, +static int mqueue_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return mqueue_create_attr (dentry, mode,NULL );
mm/shmem.c +1 -1
@@ -3897,7 +3897,7 @@ static struct dentry *shmem_mkdir(const struct mnt_idmap *idmap, struct inode *dreturn NULL ; } -static int shmem_create (struct mnt_idmap *idmap,struct inode *dir, +static int shmem_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return shmem_mknod (idmap, dir, dentry, mode |S_IFREG ,0 );
Signature · 1 line
2.53.0
Re: [PATCH 22/27] fs: port ->create() to pass const mnt_idmap
Quoted 8 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
Quoted 7 lines
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 739 lines
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/namei.c | 2 +- fs/afs/dir.c | 4 ++-- fs/bad_inode.c | 2 +- fs/bfs/dir.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/dir.c | 2 +- fs/coda/dir.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/efivarfs/inode.c | 2 +- fs/exfat/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 | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/dir.c | 2 +- fs/hfsplus/dir.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/namei.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/jffs2/dir.c | 4 ++-- fs/jfs/namei.c | 2 +- fs/minix/namei.c | 2 +- fs/nfs/dir.c | 2 +- fs/nfs/internal.h | 2 +- fs/nilfs2/namei.c | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/namei.c | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/omfs/dir.c | 2 +- fs/orangefs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/ramfs/inode.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/dir.c | 2 +- fs/ubifs/dir.c | 2 +- fs/udf/namei.c | 2 +- fs/ufs/namei.c | 2 +- fs/vboxsf/dir.c | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 2 +- ipc/mqueue.c | 2 +- mm/shmem.c | 2 +- 51 files changed, 53 insertions(+), 53 deletions(-)Documentation/filesystems/locking.rst +1
-1@@ -61,7 +61,7 @@ inode_operations prototypes:: - int (*create) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); + int (*create) (const struct mnt_idmap *, struct inode *,struct dentry *,umode_t); struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *);Documentation/filesystems/vfs.rst +1
-1@@ -415,7 +415,7 @@ As of kernel 2.6.22, the following members are defined: .. code-block:: c struct inode_operations { - int (*create) (struct mnt_idmap *, struct inode *,struct dentry *, umode_t); + int (*create) (const struct mnt_idmap *, struct inode *,struct dentry *, umode_t); struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *);fs/9p/vfs_inode.c +1
-1@@ -652,7 +652,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,*/ static int -v9fs_vfs_create (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct v9fs_session_info *v9ses =v9fs_inode2v9ses (dir);fs/9p/vfs_inode_dotl.c +1
-1@@ -216,7 +216,7 @@ int v9fs_open_to_dotl_flags(int flags)* */ static int -v9fs_vfs_create_dotl (struct mnt_idmap *idmap,struct inode *dir, +v9fs_vfs_create_dotl (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t omode) {return v9fs_vfs_mknod_dotl (idmap, dir, dentry, omode,0 );fs/affs/affs.h +1
-1@@ -166,7 +166,7 @@ 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 );extern int affs_unlink (struct inode *dir,struct dentry *dentry); -extern int affs_create (struct mnt_idmap *idmap,struct inode *dir, +extern int affs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);extern struct dentry *affs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);fs/affs/namei.c +1
-1@@ -242,7 +242,7 @@ affs_unlink(struct inode *dir, struct dentry *dentry) }int -affs_create (struct mnt_idmap *idmap,struct inode *dir, +affs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/afs/dir.c +2
-2@@ -33,7 +33,7 @@ static bool afs_lookup_one_filldir(struct dir_context *ctx, const char *name, instatic bool afs_lookup_filldir (struct dir_context *ctx,const char *name,int nlen,u64 ino,u32 uniquifier);#define AFS_LOOKUP ((filldir_t)0x137UL) -static int afs_create (struct mnt_idmap *idmap,struct inode *dir, +static int afs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);static struct dentry *afs_mkdir (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode);@@ -1632,7 +1632,7 @@ static const struct afs_operation_ops afs_create_operation = {/* * create a regular file on an AFS filesystem */ -static int afs_create (struct mnt_idmap *idmap,struct inode *dir, +static int afs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct afs_operation *op;fs/bad_inode.c +1
-1@@ -27,7 +27,7 @@ static const struct file_operations bad_file_ops = .open = bad_file_open, }; -static int bad_inode_create (struct mnt_idmap *idmap, +static int bad_inode_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {fs/bfs/dir.c +1
-1@@ -75,7 +75,7 @@ const struct file_operations bfs_dir_operations = { .llseek = generic_file_llseek, }; -static int bfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int bfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {int err;fs/btrfs/inode.c +1
-1@@ -7018,7 +7018,7 @@ static int btrfs_mknod(const struct mnt_idmap *idmap, struct inode *dir,return btrfs_create_common (dir, dentry, inode); } -static int btrfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int btrfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/ceph/dir.c +1
-1@@ -988,7 +988,7 @@ static int ceph_mknod(const struct mnt_idmap *idmap, struct inode *dir,return err; } -static int ceph_create (struct mnt_idmap *idmap,struct inode *dir, +static int ceph_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ceph_mknod (idmap, dir, dentry, mode,0 );fs/coda/dir.c +1
-1@@ -133,7 +133,7 @@ static inline void coda_dir_drop_nlink(struct inode *dir) }/* creation routines: create, mknod, mkdir, link, symlink */ -static int coda_create (struct mnt_idmap *idmap,struct inode *dir, +static int coda_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *de,umode_t mode) {int error;fs/ecryptfs/inode.c +1
-1@@ -266,7 +266,7 @@ int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry,* Returns zero on success; non-zero on error condition */ static int -ecryptfs_create (struct mnt_idmap *idmap, +ecryptfs_create (const struct mnt_idmap *idmap,struct inode *directory_inode,struct dentry *ecryptfs_dentry,umode_t mode) {fs/efivarfs/inode.c +1
-1@@ -74,7 +74,7 @@ static bool efivarfs_valid_name(const char *str, int len)return uuid_is_valid (s); } -static int efivarfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int efivarfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode =NULL ;fs/exfat/namei.c +1
-1@@ -552,7 +552,7 @@ static int exfat_add_entry(struct inode *inode, const char *path,return ret; } -static int exfat_create (struct mnt_idmap *idmap,struct inode *dir, +static int exfat_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/ext2/namei.c +1
-1@@ -97,7 +97,7 @@ struct dentry *ext2_get_parent(struct dentry *child)* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int ext2_create (struct mnt_idmap * idmap, +static int ext2_create (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {fs/ext4/namei.c +1
-1@@ -2812,7 +2812,7 @@ static int ext4_add_nondir(handle_t *handle,* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int ext4_create (struct mnt_idmap *idmap,struct inode *dir, +static int ext4_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {handle_t *handle;fs/f2fs/namei.c +1
-1@@ -365,7 +365,7 @@ static struct inode *f2fs_new_inode(const struct mnt_idmap *idmap,return ERR_PTR (err); } -static int f2fs_create (struct mnt_idmap *idmap,struct inode *dir, +static int f2fs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct f2fs_sb_info *sbi =F2FS_I_SB (dir);fs/fat/namei_msdos.c +1
-1@@ -263,7 +263,7 @@ static int msdos_add_entry(struct inode *dir, const unsigned char *name, }/***** Create a file */ -static int msdos_create (struct mnt_idmap *idmap,struct inode *dir, +static int msdos_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/fat/namei_vfat.c +1
-1@@ -753,7 +753,7 @@ static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry,return ERR_PTR (err); } -static int vfat_create (struct mnt_idmap *idmap,struct inode *dir, +static int vfat_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct super_block *sb = dir->i_sb;fs/fuse/dir.c +1
-1@@ -1092,7 +1092,7 @@ static int fuse_mknod(const struct mnt_idmap *idmap, struct inode *dir,return create_new_nondir (idmap, fm, &args, dir, entry, mode); } -static int fuse_create (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,umode_t mode) {return fuse_mknod (idmap, dir, entry, mode,0 );fs/gfs2/inode.c +1
-1@@ -967,7 +967,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,* Returns: errno */ -static int gfs2_create (struct mnt_idmap *idmap,struct inode *dir, +static int gfs2_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return gfs2_create_inode (dir, dentry,NULL ,S_IFREG | mode,0 ,NULL ,0 ,1 );fs/hfs/dir.c +1
-1@@ -183,7 +183,7 @@ static int hfs_dir_release(struct inode *inode, struct file *file)* a directory and return a corresponding inode, given the inode for * the directory and the name (and its length) of the new file. */ -static int hfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int hfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/hfsplus/dir.c +1
-1@@ -561,7 +561,7 @@ static int hfsplus_mknod(const struct mnt_idmap *idmap, struct inode *dir,return res; } -static int hfsplus_create (struct mnt_idmap *idmap,struct inode *dir, +static int hfsplus_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return hfsplus_mknod (&nop_mnt_idmap, dir, dentry, mode,0 );fs/hostfs/hostfs_kern.c +1
-1@@ -592,7 +592,7 @@ static struct inode *hostfs_iget(struct super_block *sb, char *name)return inode; } -static int hostfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int hostfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/hpfs/namei.c +1
-1@@ -128,7 +128,7 @@ static struct dentry *hpfs_mkdir(const struct mnt_idmap *idmap, struct inode *direturn ERR_PTR (err); } -static int hpfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int hpfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {const unsigned char *name = dentry->d_name.name;fs/hugetlbfs/inode.c +1
-1@@ -977,7 +977,7 @@ static struct dentry *hugetlbfs_mkdir(const struct mnt_idmap *idmap, struct inodreturn ERR_PTR (retval); } -static int hugetlbfs_create (struct mnt_idmap *idmap, +static int hugetlbfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {fs/jffs2/dir.c +2
-2@@ -25,7 +25,7 @@static int jffs2_readdir (struct file *,struct dir_context *); -static int jffs2_create (struct mnt_idmap *,struct inode *, +static int jffs2_create (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );static struct dentry *jffs2_lookup (struct inode *,struct dentry *,unsigned int );@@ -162,7 +162,7 @@ static int jffs2_readdir(struct file *file, struct dir_context *ctx)/***********************************************************************/ -static int jffs2_create (struct mnt_idmap *idmap,struct inode *dir_i, +static int jffs2_create (const struct mnt_idmap *idmap,struct inode *dir_i,struct dentry *dentry,umode_t mode) {struct jffs2_raw_inode *ri;fs/jfs/namei.c +1
-1@@ -60,7 +60,7 @@ static inline void free_ea_wmap(struct inode *inode)* RETURN: Errors from subroutines * */ -static int jfs_create (struct mnt_idmap *idmap,struct inode *dip, +static int jfs_create (const struct mnt_idmap *idmap,struct inode *dip,struct dentry *dentry,umode_t mode) {int rc =0 ;fs/minix/namei.c +1
-1@@ -63,7 +63,7 @@ static int minix_tmpfile(const struct mnt_idmap *idmap, struct inode *dir,return finish_open_simple (file,0 ); } -static int minix_create (struct mnt_idmap *idmap,struct inode *dir, +static int minix_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return minix_mknod (&nop_mnt_idmap, dir, dentry, mode,0 );fs/nfs/dir.c +1
-1@@ -2437,7 +2437,7 @@ static int nfs_do_create(struct inode *dir, struct dentry *dentry,return error; } -int nfs_create (struct mnt_idmap *idmap,struct inode *dir, +int nfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return nfs_do_create (dir, dentry, mode,O_EXCL );fs/nfs/internal.h +1
-1@@ -396,7 +396,7 @@ extern unsigned long nfs_access_cache_scan(struct shrinker *shrink, struct shrink_control *sc);struct dentry *nfs_lookup (struct inode *,struct dentry *,unsigned int );void nfs_d_prune_case_insensitive_aliases (struct inode *inode); -int nfs_create (struct mnt_idmap *,struct inode *,struct dentry *, +int nfs_create (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );struct dentry *nfs_mkdir (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );fs/nilfs2/namei.c +1
-1@@ -85,7 +85,7 @@ nilfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int nilfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int nilfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/ntfs/namei.c +1
-1@@ -732,7 +732,7 @@ static struct ntfs_inode *__ntfs_create(const struct mnt_idmap *idmap, struct inreturn ERR_PTR (err); } -static int ntfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct ntfs_volume *vol =NTFS_SB (dir->i_sb);fs/ntfs3/namei.c +1
-1@@ -111,7 +111,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,/* * ntfs_create - inode_operations::create */ -static int ntfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ntfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) { return ntfs_create_inode(idmap, dir, dentry, NULL, S_IFREG | mode, 0,fs/ocfs2/dlmfs/dlmfs.c +1
-1@@ -450,7 +450,7 @@ static struct dentry *dlmfs_mkdir(const struct mnt_idmap * idmap,return ERR_PTR (status); } -static int dlmfs_create (struct mnt_idmap *idmap, +static int dlmfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)fs/ocfs2/namei.c +1
-1@@ -671,7 +671,7 @@ static struct dentry *ocfs2_mkdir(const struct mnt_idmap *idmap,return ERR_PTR (ret); } -static int ocfs2_create (struct mnt_idmap *idmap, +static int ocfs2_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)fs/omfs/dir.c +1
-1@@ -285,7 +285,7 @@ static struct dentry *omfs_mkdir(const struct mnt_idmap *idmap, struct inode *direturn ERR_PTR (omfs_add_node (dir, dentry, mode)); } -static int omfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int omfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return omfs_add_node (dir, dentry, mode |S_IFREG );fs/orangefs/namei.c +1
-1@@ -15,7 +15,7 @@/* * Get a newly allocated inode to go with a negative dentry. */ -static int orangefs_create (struct mnt_idmap *idmap, +static int orangefs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)fs/overlayfs/dir.c +1
-1@@ -730,7 +730,7 @@ static int ovl_create_object(const struct mnt_idmap *idmap, struct dentry *dentrreturn err; } -static int ovl_create (struct mnt_idmap *idmap,struct inode *dir, +static int ovl_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ovl_create_object (idmap, dentry, (mode &07777 ) |S_IFREG ,0 ,NULL );fs/ramfs/inode.c +1
-1@@ -127,7 +127,7 @@ static struct dentry *ramfs_mkdir(const struct mnt_idmap *idmap, struct inode *dreturn ERR_PTR (retval); } -static int ramfs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ramfs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return ramfs_mknod (&nop_mnt_idmap, dir, dentry, mode |S_IFREG ,0 );fs/smb/client/cifsfs.h +1
-1@@ -53,7 +53,7 @@ void cifs_sb_deactive(struct super_block *sb);/* Functions related to inodes */ extern const struct inode_operations cifs_dir_inode_ops;struct inode *cifs_root_iget (struct super_block *sb); -int cifs_create (struct mnt_idmap *idmap,struct inode *dir, +int cifs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *direntry,umode_t mode);int cifs_atomic_open (struct inode *dir,struct dentry *direntry,struct file *file,unsigned int oflags,umode_t mode);fs/smb/client/dir.c +1
-1@@ -640,7 +640,7 @@ int cifs_atomic_open(struct inode *dir, struct dentry *direntry,* The initial dentry state is hashed-negative. On success, dentry will become * hashed-positive by calling d_instantiate(). */ -int cifs_create (struct mnt_idmap *idmap,struct inode *dir, +int cifs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *direntry,umode_t mode) {struct cifs_sb_info *cifs_sb =CIFS_SB (dir);fs/ubifs/dir.c +1
-1@@ -302,7 +302,7 @@ static int ubifs_prepare_create(struct inode *dir, struct dentry *dentry,return fscrypt_setup_filename (dir, &dentry->d_name,0 , nm); } -static int ubifs_create (struct mnt_idmap *idmap,struct inode *dir, +static int ubifs_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode;fs/udf/namei.c +1
-1@@ -370,7 +370,7 @@ static int udf_add_nondir(struct dentry *dentry, struct inode *inode)return 0 ; } -static int udf_create (struct mnt_idmap *idmap,struct inode *dir, +static int udf_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {struct inode *inode =udf_new_inode (dir, mode);fs/ufs/namei.c +1
-1@@ -69,7 +69,7 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, unsi* If the create succeeds, we fill in the inode information * with d_instantiate(). */ -static int ufs_create (struct mnt_idmap * idmap, +static int ufs_create (const struct mnt_idmap * idmap,struct inode * dir,struct dentry * dentry,umode_t mode) {struct inode *inode;fs/vboxsf/dir.c +1
-1@@ -296,7 +296,7 @@ static int vboxsf_dir_create(struct inode *parent, struct dentry *dentry,return err; } -static int vboxsf_dir_mkfile (struct mnt_idmap *idmap, +static int vboxsf_dir_mkfile (const struct mnt_idmap *idmap,struct inode *parent,struct dentry *dentry,umode_t mode) {fs/xfs/xfs_iops.c +1
-1@@ -290,7 +290,7 @@ xfs_vn_mknod( STATIC intxfs_vn_create ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode)include/linux/fs.h +1
-1@@ -1999,7 +1999,7 @@ struct inode_operations {int (*readlink) (struct dentry *,char __user *,int ); -int (*create) (struct mnt_idmap *,struct inode *,struct dentry *, +int (*create) (const struct mnt_idmap *,struct inode *,struct dentry *,umode_t );int (*link) (struct dentry *,struct inode *,struct dentry *);int (*unlink) (struct inode *,struct dentry *);ipc/mqueue.c +1
-1@@ -607,7 +607,7 @@ static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg)return error; } -static int mqueue_create (struct mnt_idmap *idmap,struct inode *dir, +static int mqueue_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return mqueue_create_attr (dentry, mode,NULL );mm/shmem.c +1
-1@@ -3897,7 +3897,7 @@ static struct dentry *shmem_mkdir(const struct mnt_idmap *idmap, struct inode *dreturn NULL ; } -static int shmem_create (struct mnt_idmap *idmap,struct inode *dir, +static int shmem_create (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,umode_t mode) {return shmem_mknod (idmap, dir, dentry, mode |S_IFREG ,0 );Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Christian Brauner
maintainerPATCH 23/27 fs: port ->getattr() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/afs/inode.c | 2 +- fs/afs/internal.h | 2 +- fs/anon_inodes.c | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/inode.c | 4 ++-- fs/ceph/super.h | 2 +- fs/coda/coda_linux.h | 2 +- fs/coda/inode.c | 2 +- fs/ecryptfs/inode.c | 4 ++-- fs/erofs/inode.c | 2 +- fs/erofs/internal.h | 2 +- fs/exfat/exfat_fs.h | 2 +- fs/exfat/file.c | 2 +- fs/ext2/ext2.h | 2 +- fs/ext2/inode.c | 2 +- fs/ext4/ext4.h | 4 ++-- fs/ext4/inode.c | 4 ++-- fs/ext4/symlink.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- fs/f2fs/namei.c | 2 +- fs/failfs.c | 2 +- fs/fat/fat.h | 2 +- fs/fat/file.c | 2 +- fs/fuse/dir.c | 4 ++-- fs/gfs2/inode.c | 2 +- fs/hfsplus/hfsplus_fs.h | 2 +- fs/hfsplus/inode.c | 2 +- fs/internal.h | 2 +- fs/kernfs/inode.c | 2 +- fs/kernfs/kernfs-internal.h | 2 +- fs/libfs.c | 2 +- fs/minix/inode.c | 2 +- fs/minix/minix.h | 2 +- fs/nfs/inode.c | 2 +- fs/nfs/namespace.c | 2 +- fs/ntfs/file.c | 2 +- fs/ntfs/inode.h | 2 +- fs/ntfs3/file.c | 2 +- fs/ntfs3/ntfs_fs.h | 2 +- fs/ocfs2/file.c | 2 +- fs/ocfs2/file.h | 2 +- fs/orangefs/inode.c | 2 +- fs/orangefs/orangefs-kernel.h | 2 +- fs/overlayfs/inode.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- fs/pidfs.c | 2 +- fs/proc/base.c | 4 ++-- fs/proc/fd.c | 2 +- fs/proc/generic.c | 2 +- fs/proc/internal.h | 2 +- fs/proc/proc_net.c | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/proc/root.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/stat.c | 2 +- fs/tracefs/inode.c | 2 +- fs/ubifs/dir.c | 2 +- fs/ubifs/file.c | 2 +- fs/ubifs/ubifs.h | 2 +- fs/udf/symlink.c | 2 +- fs/vboxsf/utils.c | 2 +- fs/vboxsf/vfsmod.h | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 6 +++--- include/linux/nfs_fs.h | 2 +- mm/shmem.c | 2 +- 73 files changed, 81 insertions(+), 81 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -77,7 +77,7 @@ prototypes:: int (*permission) (const struct mnt_idmap *, struct inode *, int, unsigned int); struct posix_acl * (*get_inode_acl)(struct inode *, int, bool); int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *); - int (*getattr) (struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); + int (*getattr) (const struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); ssize_t (*listxattr) (struct dentry *, char *, size_t); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); void (*update_time)(struct inode *inode, enum fs_update_time type,
Documentation/filesystems/vfs.rst +1 -1
@@ -431,7 +431,7 @@ As of kernel 2.6.22, the following members are defined: int (*permission) (const struct mnt_idmap *, struct inode *, int); struct posix_acl * (*get_inode_acl)(struct inode *, int, bool); int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *); - int (*getattr) (struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); + int (*getattr) (const struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); ssize_t (*listxattr) (struct dentry *, char *, size_t); void (*update_time)(struct inode *inode, enum fs_update_time type, int flags);
fs/9p/vfs_inode.c +1 -1
@@ -966,7 +966,7 @@ v9fs_vfs_rename(const struct mnt_idmap *idmap, struct inode *old_dir,*/ static int -v9fs_vfs_getattr (struct mnt_idmap *idmap,const struct path *path, +v9fs_vfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct dentry *dentry = path->dentry;
fs/9p/vfs_inode_dotl.c +1 -1
@@ -414,7 +414,7 @@ static struct dentry *v9fs_vfs_mkdir_dotl(const struct mnt_idmap *idmap, }static int -v9fs_vfs_getattr_dotl (struct mnt_idmap *idmap, +v9fs_vfs_getattr_dotl (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
fs/afs/inode.c +1 -1
@@ -596,7 +596,7 @@ struct inode *afs_root_iget(struct super_block *sb, struct key *key)/* * read the attributes of an inode */ -int afs_getattr (struct mnt_idmap *idmap,const struct path *path, +int afs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);
fs/afs/internal.h +1 -1
@@ -1258,7 +1258,7 @@ extern int afs_fetch_status(struct afs_vnode *, struct key *, bool, afs_access_textern int afs_ilookup5_test_by_fid (struct inode *,void *);extern struct inode *afs_iget (struct afs_operation *,struct afs_vnode_param *);extern struct inode *afs_root_iget (struct super_block *,struct key *); -extern int afs_getattr (struct mnt_idmap *idmap,const struct path *, +extern int afs_getattr (const struct mnt_idmap *idmap,const struct path *,struct kstat *,u32 ,unsigned int );extern int afs_setattr (struct mnt_idmap *idmap,struct dentry *,struct iattr *);extern void afs_evict_inode (struct inode *);
fs/anon_inodes.c +1 -1
@@ -46,7 +46,7 @@ static struct inode *anon_inode_inode __ro_after_init;* Rather than mess with our internal sane inode data, just fix it * up here in getattr() by masking off the format bits. */ -int anon_inode_getattr (struct mnt_idmap *idmap,const struct path *path, +int anon_inode_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/bad_inode.c +1 -1
@@ -95,7 +95,7 @@ static int bad_inode_permission(const struct mnt_idmap *idmap,return -EIO ; } -static int bad_inode_getattr (struct mnt_idmap *idmap, +static int bad_inode_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/btrfs/inode.c +1 -1
@@ -8224,7 +8224,7 @@ int __init btrfs_init_cachep(void)return 0 ; } -static int btrfs_getattr (struct mnt_idmap *idmap, +static int btrfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
fs/ceph/inode.c +2 -2
@@ -2398,7 +2398,7 @@ static const char *ceph_encrypted_get_link(struct dentry *dentry, done); } -static int ceph_encrypted_symlink_getattr (struct mnt_idmap *idmap, +static int ceph_encrypted_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags)
@@ -3145,7 +3145,7 @@ static int statx_to_caps(u32 want, umode_t mode)* Get all the attributes. If we have sufficient caps for the requested attrs, * then we can avoid talking to the MDS at all. */ -int ceph_getattr (struct mnt_idmap *idmap,const struct path *path, +int ceph_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct inode *inode =d_inode (path->dentry);
fs/ceph/super.h +1 -1
@@ -1177,7 +1177,7 @@ extern int __ceph_setattr(const struct mnt_idmap *idmap, struct inode *inode, struct iattr *attr, struct ceph_iattr *cia);extern int ceph_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -extern int ceph_getattr (struct mnt_idmap *idmap, +extern int ceph_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);void ceph_inode_shutdown (struct inode *inode);
fs/coda/coda_linux.h +1 -1
@@ -49,7 +49,7 @@ int coda_release(struct inode *i, struct file *f);int coda_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);int coda_revalidate_inode (struct inode *); -int coda_getattr (struct mnt_idmap *,const struct path *,struct kstat *, +int coda_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );int coda_setattr (struct mnt_idmap *,struct dentry *,struct iattr *);
fs/coda/inode.c +1 -1
@@ -294,7 +294,7 @@ static void coda_evict_inode(struct inode *inode)coda_cache_clear_inode (inode); } -int coda_getattr (struct mnt_idmap *idmap,const struct path *path, +int coda_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {int err =coda_revalidate_inode (d_inode (path->dentry));
fs/ecryptfs/inode.c +2 -2
@@ -939,7 +939,7 @@ static int ecryptfs_setattr(struct mnt_idmap *idmap,return rc; } -static int ecryptfs_getattr_link (struct mnt_idmap *idmap, +static int ecryptfs_getattr_link (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
@@ -965,7 +965,7 @@ static int ecryptfs_getattr_link(struct mnt_idmap *idmap,return rc; } -static int ecryptfs_getattr (struct mnt_idmap *idmap, +static int ecryptfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
fs/erofs/inode.c +1 -1
@@ -311,7 +311,7 @@ struct inode *erofs_iget(struct super_block *sb, erofs_nid_t nid)return inode; } -int erofs_getattr (struct mnt_idmap *idmap,const struct path *path, +int erofs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/erofs/internal.h +1 -1
@@ -421,7 +421,7 @@ void erofs_onlinefolio_init(struct folio *folio);void erofs_onlinefolio_split (struct folio *folio);void erofs_onlinefolio_end (struct folio *folio,int err,bool dirty);struct inode *erofs_iget (struct super_block *sb,erofs_nid_t nid); -int erofs_getattr (struct mnt_idmap *idmap,const struct path *path, +int erofs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags); int erofs_namei(struct inode *dir, const struct qstr *name,
fs/exfat/exfat_fs.h +1 -1
@@ -557,7 +557,7 @@ extern const struct file_operations exfat_file_operations;int __exfat_truncate (struct inode *inode);int exfat_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int exfat_getattr (struct mnt_idmap *idmap,const struct path *path, +int exfat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags);struct file_kattr ;
fs/exfat/file.c +1 -1
@@ -319,7 +319,7 @@ static void exfat_truncate(struct inode *inode)mutex_unlock (&sbi->s_lock); } -int exfat_getattr (struct mnt_idmap *idmap,const struct path *path, +int exfat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags) {
fs/ext2/ext2.h +1 -1
@@ -740,7 +740,7 @@ extern void ext2_evict_inode(struct inode *);void ext2_write_failed (struct address_space *mapping,loff_t to);extern int ext2_get_block (struct inode *,sector_t ,struct buffer_head *,int );extern int ext2_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); -extern int ext2_getattr (struct mnt_idmap *,const struct path *, +extern int ext2_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void ext2_set_inode_flags (struct inode *inode); extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
fs/ext2/inode.c +1 -1
@@ -1591,7 +1591,7 @@ int ext2_sync_inode_metadata(struct inode *inode, struct writeback_control *wbc)return err; } -int ext2_getattr (struct mnt_idmap *idmap,const struct path *path, +int ext2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);
fs/ext4/ext4.h +2 -2
@@ -3182,11 +3182,11 @@ extern int ext4_sync_inode_metadata(struct inode *, struct writeback_control *)extern int ext4_setattr (struct mnt_idmap *,struct dentry *,struct iattr *);extern u32 ext4_dio_alignment (struct inode *inode); -extern int ext4_getattr (struct mnt_idmap *,const struct path *, +extern int ext4_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void ext4_evict_inode (struct inode *);extern void ext4_clear_inode (struct inode *); -extern int ext4_file_getattr (struct mnt_idmap *,const struct path *, +extern int ext4_file_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void ext4_dirty_inode (struct inode *,int );extern int ext4_change_inode_journal_flag (struct inode *,int );
fs/ext4/inode.c +2 -2
@@ -6263,7 +6263,7 @@ u32 ext4_dio_alignment(struct inode *inode)return 1 ;/* use the iomap defaults */ } -int ext4_getattr (struct mnt_idmap *idmap,const struct path *path, +int ext4_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);
@@ -6332,7 +6332,7 @@ int ext4_getattr(struct mnt_idmap *idmap, const struct path *path,return 0 ; } -int ext4_file_getattr (struct mnt_idmap *idmap, +int ext4_file_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/ext4/symlink.c +1 -1
@@ -55,7 +55,7 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,return paddr; } -static int ext4_encrypted_symlink_getattr (struct mnt_idmap *idmap, +static int ext4_encrypted_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags)
fs/f2fs/f2fs.h +1 -1
@@ -3848,7 +3848,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync);int f2fs_do_truncate_blocks (struct inode *inode,u64 from,bool lock);int f2fs_truncate_blocks (struct inode *inode,u64 from,bool lock);int f2fs_truncate (struct inode *inode); -int f2fs_getattr (struct mnt_idmap *idmap,const struct path *path, +int f2fs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int f2fs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);
fs/f2fs/file.c +1 -1
@@ -1032,7 +1032,7 @@ static bool f2fs_force_buffered_io(struct inode *inode, int rw)return false; } -int f2fs_getattr (struct mnt_idmap *idmap,const struct path *path, +int f2fs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);
fs/f2fs/namei.c +1 -1
@@ -1394,7 +1394,7 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,return target; } -static int f2fs_encrypted_symlink_getattr (struct mnt_idmap *idmap, +static int f2fs_encrypted_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags)
fs/failfs.c +1 -1
@@ -35,7 +35,7 @@ static struct dentry *failfs_lookup(struct inode *dir, struct dentry *dentry,return ERR_PTR (-EOPNOTSUPP ); } -static int failfs_getattr (struct mnt_idmap *idmap,const struct path *path, +static int failfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/fat/fat.h +1 -1
@@ -407,7 +407,7 @@ extern const struct inode_operations fat_file_inode_operations;extern int fat_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);extern void fat_truncate_blocks (struct inode *inode,loff_t offset); -extern int fat_getattr (struct mnt_idmap *idmap, +extern int fat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int fat_fileattr_get (struct dentry *dentry,struct file_kattr *fa);
fs/fat/file.c +1 -1
@@ -432,7 +432,7 @@ int fat_fileattr_get(struct dentry *dentry, struct file_kattr *fa) }EXPORT_SYMBOL_GPL (fat_fileattr_get); -int fat_getattr (struct mnt_idmap *idmap,const struct path *path, +int fat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct inode *inode =d_inode (path->dentry);
fs/fuse/dir.c +2 -2
@@ -1537,7 +1537,7 @@ static int fuse_do_getattr(const struct mnt_idmap *idmap, struct inode *inode,return err; } -static int fuse_update_get_attr (struct mnt_idmap *idmap,struct inode *inode, +static int fuse_update_get_attr (const struct mnt_idmap *idmap,struct inode *inode,struct file *file,struct kstat *stat,u32 request_mask,unsigned int flags) {
@@ -2387,7 +2387,7 @@ static int fuse_setattr(struct mnt_idmap *idmap, struct dentry *entry,return ret; } -static int fuse_getattr (struct mnt_idmap *idmap, +static int fuse_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
fs/gfs2/inode.c +1 -1
@@ -2156,7 +2156,7 @@ static int gfs2_setattr(struct mnt_idmap *idmap,* Returns: errno */ -static int gfs2_getattr (struct mnt_idmap *idmap, +static int gfs2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
fs/hfsplus/hfsplus_fs.h +1 -1
@@ -459,7 +459,7 @@ void hfsplus_inode_write_fork(struct inode *inode, struct hfsplus_fork_raw *fork);int hfsplus_cat_read_inode (struct inode *inode,struct hfs_find_data *fd);int hfsplus_cat_write_inode (struct inode *inode); -int hfsplus_getattr (struct mnt_idmap *idmap,const struct path *path, +int hfsplus_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags); int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
fs/hfsplus/inode.c +1 -1
@@ -335,7 +335,7 @@ static int hfsplus_setattr(struct mnt_idmap *idmap,return 0 ; } -int hfsplus_getattr (struct mnt_idmap *idmap,const struct path *path, +int hfsplus_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/internal.h +1 -1
@@ -356,7 +356,7 @@ void file_f_owner_release(struct file *file);bool file_seek_cur_needs_f_lock (struct file *file);int statmount_mnt_idmap (const struct mnt_idmap *idmap,struct seq_file *seq,bool uid_map);struct dentry *find_next_child (struct dentry *parent,struct dentry *prev); -int anon_inode_getattr (struct mnt_idmap *idmap,const struct path *path, +int anon_inode_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags); int anon_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/kernfs/inode.c +1 -1
@@ -181,7 +181,7 @@ static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode)set_nlink (inode, kn->dir.subdirs +2 ); } -int kernfs_iop_getattr (struct mnt_idmap *idmap, +int kernfs_iop_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/kernfs/kernfs-internal.h +1 -1
@@ -175,7 +175,7 @@ int kernfs_iop_permission(const struct mnt_idmap *idmap, struct inode *inode, int mask);int kernfs_iop_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr); -int kernfs_iop_getattr (struct mnt_idmap *idmap, +int kernfs_iop_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags);ssize_t kernfs_iop_listxattr (struct dentry *dentry,char *buf,size_t size);
fs/libfs.c +1 -1
@@ -29,7 +29,7 @@#include "internal.h" -int simple_getattr (struct mnt_idmap *idmap,const struct path *path, +int simple_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/minix/inode.c +1 -1
@@ -724,7 +724,7 @@ static int minix_sync_inode_metadata(struct inode *inode,return err; } -int minix_getattr (struct mnt_idmap *idmap,const struct path *path, +int minix_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct super_block *sb = path->dentry->d_sb;
fs/minix/minix.h +1 -1
@@ -55,7 +55,7 @@ unsigned long minix_count_free_inodes(struct super_block *sb);int minix_new_block (struct inode *inode);void minix_free_block (struct inode *inode,unsigned long block);unsigned long minix_count_free_blocks (struct super_block *sb); -int minix_getattr (struct mnt_idmap *,const struct path *, +int minix_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );int minix_prepare_chunk (struct folio *folio,loff_t pos,unsigned len);struct mapping_metadata_bhs *minix_get_metadata_bhs (struct inode *inode);
fs/nfs/inode.c +1 -1
@@ -955,7 +955,7 @@ static u32 nfs_get_valid_attrmask(struct inode *inode)return reply_mask; } -int nfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int nfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);
fs/nfs/namespace.c +1 -1
@@ -222,7 +222,7 @@ struct vfsmount *nfs_d_automount(struct path *path) }static int -nfs_namespace_getattr (struct mnt_idmap *idmap, +nfs_namespace_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/ntfs/file.c +1 -1
@@ -364,7 +364,7 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return err; } -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags) {
fs/ntfs/inode.h +1 -1
@@ -332,7 +332,7 @@ int ntfs_truncate_vfs(struct inode *vi, loff_t new_size, loff_t i_size);int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags);
fs/ntfs3/file.c +1 -1
@@ -261,7 +261,7 @@ long ntfs_compat_ioctl(struct file *filp, u32 cmd, unsigned long arg)/* * ntfs_getattr - inode_operations::getattr */ -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,u32 flags) {struct inode *inode =d_inode (path->dentry);
fs/ntfs3/ntfs_fs.h +1 -1
@@ -553,7 +553,7 @@ extern const struct file_operations ntfs_dir_operations;int ntfs_fileattr_get (struct dentry *dentry,struct file_kattr *fa);int ntfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa); -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,u32 flags);int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);
fs/ocfs2/file.c +1 -1
@@ -1317,7 +1317,7 @@ int ocfs2_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return status; } -int ocfs2_getattr (struct mnt_idmap *idmap,const struct path *path, +int ocfs2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct inode *inode =d_inode (path->dentry);
fs/ocfs2/file.h +1 -1
@@ -52,7 +52,7 @@ int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh, loff_t zero_to);int ocfs2_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int ocfs2_getattr (struct mnt_idmap *idmap,const struct path *path, +int ocfs2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); int ocfs2_permission(const struct mnt_idmap *idmap, struct inode *inode,
fs/orangefs/inode.c +1 -1
@@ -848,7 +848,7 @@ int orangefs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,/* * Obtain attributes of an object given a dentry */ -int orangefs_getattr (struct mnt_idmap *idmap,const struct path *path, +int orangefs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {int ret;
fs/orangefs/orangefs-kernel.h +1 -1
@@ -354,7 +354,7 @@ int __orangefs_setattr(struct inode *, struct iattr *);int __orangefs_setattr_mode (struct dentry *dentry,struct iattr *iattr);int orangefs_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); -int orangefs_getattr (struct mnt_idmap *idmap,const struct path *path, +int orangefs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); int orangefs_permission(const struct mnt_idmap *idmap,
fs/overlayfs/inode.c +1 -1
@@ -168,7 +168,7 @@ static inline int ovl_real_getattr_nosec(struct super_block *sb,return vfs_getattr_nosec (path, stat, request_mask, flags); } -int ovl_getattr (struct mnt_idmap *idmap,const struct path *path, +int ovl_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct dentry *dentry = path->dentry;
fs/overlayfs/overlayfs.h +1 -1
@@ -950,6 +950,6 @@ static inline bool ovl_force_readonly(struct ovl_fs *ofs)const struct xattr_handler *const *ovl_xattr_handlers (struct ovl_fs *ofs);int ovl_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int ovl_getattr (struct mnt_idmap *idmap,const struct path *path, +int ovl_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);ssize_t ovl_listxattr (struct dentry *dentry,char *list,size_t size);
fs/pidfs.c +1 -1
@@ -829,7 +829,7 @@ static int pidfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return anon_inode_setattr (idmap, dentry, attr); } -static int pidfs_getattr (struct mnt_idmap *idmap,const struct path *path, +static int pidfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/proc/base.c +2 -2
@@ -1994,7 +1994,7 @@ static struct inode *proc_pid_make_base_inode(struct super_block *sb,return inode; } -int pid_getattr (struct mnt_idmap *idmap,const struct path *path, +int pid_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);
@@ -3936,7 +3936,7 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx)return 0 ; } -static int proc_task_getattr (struct mnt_idmap *idmap, +static int proc_task_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/proc/fd.c +1 -1
@@ -342,7 +342,7 @@ int proc_fd_permission(const struct mnt_idmap *idmap,return rv; } -static int proc_fd_getattr (struct mnt_idmap *idmap, +static int proc_fd_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/proc/generic.c +1 -1
@@ -135,7 +135,7 @@ static int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return 0 ; } -static int proc_getattr (struct mnt_idmap *idmap, +static int proc_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/proc/internal.h +1 -1
@@ -258,7 +258,7 @@ extern int proc_pid_statm(struct seq_file *, struct pid_namespace *,* base.c */ extern const struct dentry_operations pid_dentry_operations; -extern int pid_getattr (struct mnt_idmap *,const struct path *, +extern int pid_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );int proc_nochmod_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);
fs/proc/proc_net.c +1 -1
@@ -308,7 +308,7 @@ static struct dentry *proc_tgid_net_lookup(struct inode *dir,return de; } -static int proc_tgid_net_getattr (struct mnt_idmap *idmap, +static int proc_tgid_net_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/proc/proc_sysctl.c +1 -1
@@ -834,7 +834,7 @@ static int proc_sys_setattr(struct mnt_idmap *idmap,return 0 ; } -static int proc_sys_getattr (struct mnt_idmap *idmap, +static int proc_sys_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/proc/root.c +1 -1
@@ -402,7 +402,7 @@ void __init proc_root_init(void)register_filesystem (&proc_fs_type); } -static int proc_root_getattr (struct mnt_idmap *idmap, +static int proc_root_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/smb/client/cifsfs.h +1 -1
@@ -78,7 +78,7 @@ int cifs_revalidate_file(struct file *filp);int cifs_revalidate_dentry (struct dentry *dentry);int cifs_revalidate_mapping (struct inode *inode);int cifs_zap_mapping (struct inode *inode); -int cifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int cifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int cifs_setattr (struct mnt_idmap *idmap,struct dentry *direntry,struct iattr *attrs);
fs/smb/client/inode.c +1 -1
@@ -2932,7 +2932,7 @@ int cifs_revalidate_dentry(struct dentry *dentry)return cifs_revalidate_mapping (inode); } -int cifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int cifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct cifs_sb_info *cifs_sb =CIFS_SB (path->dentry);
fs/stat.c +1 -1
@@ -79,7 +79,7 @@ EXPORT_SYMBOL(fill_mg_cmtime);* uid and gid filds. On non-idmapped mounts or if permission checking is to be * performed on the raw inode simply pass @nop_mnt_idmap. */ -void generic_fillattr (struct mnt_idmap *idmap,u32 request_mask, +void generic_fillattr (const struct mnt_idmap *idmap,u32 request_mask,struct inode *inode,struct kstat *stat) {vfsuid_t vfsuid =i_uid_into_vfsuid (idmap, inode);
fs/tracefs/inode.c +1 -1
@@ -196,7 +196,7 @@ static int tracefs_permission(const struct mnt_idmap *idmap,return generic_permission (idmap, inode, mask); } -static int tracefs_getattr (struct mnt_idmap *idmap, +static int tracefs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
fs/ubifs/dir.c +1 -1
@@ -1667,7 +1667,7 @@ static int ubifs_rename(const struct mnt_idmap *idmap,return do_rename (old_dir, old_dentry, new_dir, new_dentry, flags); } -int ubifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ubifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {loff_t size;
fs/ubifs/file.c +1 -1
@@ -1611,7 +1611,7 @@ static const char *ubifs_get_link(struct dentry *dentry,return fscrypt_get_symlink (inode, ui->data, ui->data_len, done); } -static int ubifs_symlink_getattr (struct mnt_idmap *idmap, +static int ubifs_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
fs/ubifs/ubifs.h +1 -1
@@ -2028,7 +2028,7 @@ int ubifs_update_time(struct inode *inode, enum fs_update_time type,/* dir.c */ struct inode *ubifs_new_inode (struct ubifs_info *c,struct inode *dir,umode_t mode,bool is_xattr); -int ubifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ubifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int ubifs_check_dir_empty (struct inode *dir);
fs/udf/symlink.c +1 -1
@@ -133,7 +133,7 @@ static int udf_symlink_filler(struct file *file, struct folio *folio)return err; } -static int udf_symlink_getattr (struct mnt_idmap *idmap, +static int udf_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {
fs/vboxsf/utils.c +1 -1
@@ -233,7 +233,7 @@ int vboxsf_inode_revalidate(struct dentry *dentry)return 0 ; } -int vboxsf_getattr (struct mnt_idmap *idmap,const struct path *path, +int vboxsf_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *kstat,u32 request_mask,unsigned int flags) {int err;
fs/vboxsf/vfsmod.h +1 -1
@@ -98,7 +98,7 @@ int vboxsf_stat(struct vboxsf_sbi *sbi, struct shfl_string *path, struct shfl_fsobjinfo *info);int vboxsf_stat_dentry (struct dentry *dentry,struct shfl_fsobjinfo *info);int vboxsf_inode_revalidate (struct dentry *dentry); -int vboxsf_getattr (struct mnt_idmap *idmap,const struct path *path, +int vboxsf_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *kstat,u32 request_mask,unsigned int query_flags); int vboxsf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
fs/xfs/xfs_iops.c +1 -1
@@ -679,7 +679,7 @@ xfs_report_atomic_write( STATIC int xfs_vn_getattr( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, u32 request_mask,
include/linux/fs.h +3 -3
@@ -2013,7 +2013,7 @@ struct inode_operations {int (*rename) (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );int (*setattr) (struct mnt_idmap *,struct dentry *,struct iattr *); -int (*getattr) (struct mnt_idmap *,const struct path *, +int (*getattr) (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );ssize_t (*listxattr) (struct dentry *,char *,size_t ); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
@@ -3204,7 +3204,7 @@ extern int page_symlink(struct inode *inode, const char *symname, int len);extern const struct inode_operations page_symlink_inode_operations;extern void kfree_link (void *);void fill_mg_cmtime (struct kstat *stat,u32 request_mask,struct inode *inode); -void generic_fillattr (struct mnt_idmap *,u32 ,struct inode *,struct kstat *); +void generic_fillattr (const struct mnt_idmap *,u32 ,struct inode *,struct kstat *);void generic_fill_statx_attr (struct inode *inode,struct kstat *stat); void generic_fill_statx_atomic_writes(struct kstat *stat, unsigned int unit_min,
@@ -3263,7 +3263,7 @@ extern loff_t dcache_dir_lseek(struct file *, loff_t, int);extern int dcache_readdir (struct file *,struct dir_context *);extern int simple_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); -extern int simple_getattr (struct mnt_idmap *,const struct path *, +extern int simple_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern int simple_statfs (struct dentry *,struct kstatfs *);extern int simple_open (struct inode *inode,struct file *file);
include/linux/nfs_fs.h +1 -1
@@ -437,7 +437,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);extern int nfs_post_op_update_inode (struct inode *inode,struct nfs_fattr *fattr);extern int nfs_post_op_update_inode_force_wcc (struct inode *inode,struct nfs_fattr *fattr);extern int nfs_post_op_update_inode_force_wcc_locked (struct inode *inode,struct nfs_fattr *fattr); -extern int nfs_getattr (struct mnt_idmap *,const struct path *, +extern int nfs_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void nfs_access_add_cache (struct inode *,struct nfs_access_entry *,const struct cred *);extern void nfs_access_set_mask (struct nfs_access_entry *,u32 );
mm/shmem.c +1 -1
@@ -1292,7 +1292,7 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, uoff_t lend) }EXPORT_SYMBOL_GPL (shmem_truncate_range); -static int shmem_getattr (struct mnt_idmap *idmap, +static int shmem_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {
Signature · 1 line
2.53.0
Re: [PATCH 23/27] fs: port ->getattr() to pass const mnt_idmap
Quoted 8 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
Quoted 7 lines
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 1,096 lines
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/afs/inode.c | 2 +- fs/afs/internal.h | 2 +- fs/anon_inodes.c | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/inode.c | 4 ++-- fs/ceph/super.h | 2 +- fs/coda/coda_linux.h | 2 +- fs/coda/inode.c | 2 +- fs/ecryptfs/inode.c | 4 ++-- fs/erofs/inode.c | 2 +- fs/erofs/internal.h | 2 +- fs/exfat/exfat_fs.h | 2 +- fs/exfat/file.c | 2 +- fs/ext2/ext2.h | 2 +- fs/ext2/inode.c | 2 +- fs/ext4/ext4.h | 4 ++-- fs/ext4/inode.c | 4 ++-- fs/ext4/symlink.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- fs/f2fs/namei.c | 2 +- fs/failfs.c | 2 +- fs/fat/fat.h | 2 +- fs/fat/file.c | 2 +- fs/fuse/dir.c | 4 ++-- fs/gfs2/inode.c | 2 +- fs/hfsplus/hfsplus_fs.h | 2 +- fs/hfsplus/inode.c | 2 +- fs/internal.h | 2 +- fs/kernfs/inode.c | 2 +- fs/kernfs/kernfs-internal.h | 2 +- fs/libfs.c | 2 +- fs/minix/inode.c | 2 +- fs/minix/minix.h | 2 +- fs/nfs/inode.c | 2 +- fs/nfs/namespace.c | 2 +- fs/ntfs/file.c | 2 +- fs/ntfs/inode.h | 2 +- fs/ntfs3/file.c | 2 +- fs/ntfs3/ntfs_fs.h | 2 +- fs/ocfs2/file.c | 2 +- fs/ocfs2/file.h | 2 +- fs/orangefs/inode.c | 2 +- fs/orangefs/orangefs-kernel.h | 2 +- fs/overlayfs/inode.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- fs/pidfs.c | 2 +- fs/proc/base.c | 4 ++-- fs/proc/fd.c | 2 +- fs/proc/generic.c | 2 +- fs/proc/internal.h | 2 +- fs/proc/proc_net.c | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/proc/root.c | 2 +- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/stat.c | 2 +- fs/tracefs/inode.c | 2 +- fs/ubifs/dir.c | 2 +- fs/ubifs/file.c | 2 +- fs/ubifs/ubifs.h | 2 +- fs/udf/symlink.c | 2 +- fs/vboxsf/utils.c | 2 +- fs/vboxsf/vfsmod.h | 2 +- fs/xfs/xfs_iops.c | 2 +- include/linux/fs.h | 6 +++--- include/linux/nfs_fs.h | 2 +- mm/shmem.c | 2 +- 73 files changed, 81 insertions(+), 81 deletions(-)Documentation/filesystems/locking.rst +1
-1@@ -77,7 +77,7 @@ prototypes:: int (*permission) (const struct mnt_idmap *, struct inode *, int, unsigned int); struct posix_acl * (*get_inode_acl)(struct inode *, int, bool); int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *); - int (*getattr) (struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); + int (*getattr) (const struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); ssize_t (*listxattr) (struct dentry *, char *, size_t); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); void (*update_time)(struct inode *inode, enum fs_update_time type,Documentation/filesystems/vfs.rst +1
-1@@ -431,7 +431,7 @@ As of kernel 2.6.22, the following members are defined: int (*permission) (const struct mnt_idmap *, struct inode *, int); struct posix_acl * (*get_inode_acl)(struct inode *, int, bool); int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *); - int (*getattr) (struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); + int (*getattr) (const struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); ssize_t (*listxattr) (struct dentry *, char *, size_t); void (*update_time)(struct inode *inode, enum fs_update_time type, int flags);fs/9p/vfs_inode.c +1
-1@@ -966,7 +966,7 @@ v9fs_vfs_rename(const struct mnt_idmap *idmap, struct inode *old_dir,*/ static int -v9fs_vfs_getattr (struct mnt_idmap *idmap,const struct path *path, +v9fs_vfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct dentry *dentry = path->dentry;fs/9p/vfs_inode_dotl.c +1
-1@@ -414,7 +414,7 @@ static struct dentry *v9fs_vfs_mkdir_dotl(const struct mnt_idmap *idmap, }static int -v9fs_vfs_getattr_dotl (struct mnt_idmap *idmap, +v9fs_vfs_getattr_dotl (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {fs/afs/inode.c +1
-1@@ -596,7 +596,7 @@ struct inode *afs_root_iget(struct super_block *sb, struct key *key)/* * read the attributes of an inode */ -int afs_getattr (struct mnt_idmap *idmap,const struct path *path, +int afs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);fs/afs/internal.h +1
-1@@ -1258,7 +1258,7 @@ extern int afs_fetch_status(struct afs_vnode *, struct key *, bool, afs_access_textern int afs_ilookup5_test_by_fid (struct inode *,void *);extern struct inode *afs_iget (struct afs_operation *,struct afs_vnode_param *);extern struct inode *afs_root_iget (struct super_block *,struct key *); -extern int afs_getattr (struct mnt_idmap *idmap,const struct path *, +extern int afs_getattr (const struct mnt_idmap *idmap,const struct path *,struct kstat *,u32 ,unsigned int );extern int afs_setattr (struct mnt_idmap *idmap,struct dentry *,struct iattr *);extern void afs_evict_inode (struct inode *);fs/anon_inodes.c +1
-1@@ -46,7 +46,7 @@ static struct inode *anon_inode_inode __ro_after_init;* Rather than mess with our internal sane inode data, just fix it * up here in getattr() by masking off the format bits. */ -int anon_inode_getattr (struct mnt_idmap *idmap,const struct path *path, +int anon_inode_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/bad_inode.c +1
-1@@ -95,7 +95,7 @@ static int bad_inode_permission(const struct mnt_idmap *idmap,return -EIO ; } -static int bad_inode_getattr (struct mnt_idmap *idmap, +static int bad_inode_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/btrfs/inode.c +1
-1@@ -8224,7 +8224,7 @@ int __init btrfs_init_cachep(void)return 0 ; } -static int btrfs_getattr (struct mnt_idmap *idmap, +static int btrfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {fs/ceph/inode.c +2
-2@@ -2398,7 +2398,7 @@ static const char *ceph_encrypted_get_link(struct dentry *dentry, done); } -static int ceph_encrypted_symlink_getattr (struct mnt_idmap *idmap, +static int ceph_encrypted_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags)@@ -3145,7 +3145,7 @@ static int statx_to_caps(u32 want, umode_t mode)* Get all the attributes. If we have sufficient caps for the requested attrs, * then we can avoid talking to the MDS at all. */ -int ceph_getattr (struct mnt_idmap *idmap,const struct path *path, +int ceph_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct inode *inode =d_inode (path->dentry);fs/ceph/super.h +1
-1@@ -1177,7 +1177,7 @@ extern int __ceph_setattr(const struct mnt_idmap *idmap, struct inode *inode, struct iattr *attr, struct ceph_iattr *cia);extern int ceph_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -extern int ceph_getattr (struct mnt_idmap *idmap, +extern int ceph_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);void ceph_inode_shutdown (struct inode *inode);fs/coda/coda_linux.h +1
-1@@ -49,7 +49,7 @@ int coda_release(struct inode *i, struct file *f);int coda_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);int coda_revalidate_inode (struct inode *); -int coda_getattr (struct mnt_idmap *,const struct path *,struct kstat *, +int coda_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );int coda_setattr (struct mnt_idmap *,struct dentry *,struct iattr *);fs/coda/inode.c +1
-1@@ -294,7 +294,7 @@ static void coda_evict_inode(struct inode *inode)coda_cache_clear_inode (inode); } -int coda_getattr (struct mnt_idmap *idmap,const struct path *path, +int coda_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {int err =coda_revalidate_inode (d_inode (path->dentry));fs/ecryptfs/inode.c +2
-2@@ -939,7 +939,7 @@ static int ecryptfs_setattr(struct mnt_idmap *idmap,return rc; } -static int ecryptfs_getattr_link (struct mnt_idmap *idmap, +static int ecryptfs_getattr_link (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {@@ -965,7 +965,7 @@ static int ecryptfs_getattr_link(struct mnt_idmap *idmap,return rc; } -static int ecryptfs_getattr (struct mnt_idmap *idmap, +static int ecryptfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {fs/erofs/inode.c +1
-1@@ -311,7 +311,7 @@ struct inode *erofs_iget(struct super_block *sb, erofs_nid_t nid)return inode; } -int erofs_getattr (struct mnt_idmap *idmap,const struct path *path, +int erofs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/erofs/internal.h +1
-1@@ -421,7 +421,7 @@ void erofs_onlinefolio_init(struct folio *folio);void erofs_onlinefolio_split (struct folio *folio);void erofs_onlinefolio_end (struct folio *folio,int err,bool dirty);struct inode *erofs_iget (struct super_block *sb,erofs_nid_t nid); -int erofs_getattr (struct mnt_idmap *idmap,const struct path *path, +int erofs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags); int erofs_namei(struct inode *dir, const struct qstr *name,fs/exfat/exfat_fs.h +1
-1@@ -557,7 +557,7 @@ extern const struct file_operations exfat_file_operations;int __exfat_truncate (struct inode *inode);int exfat_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int exfat_getattr (struct mnt_idmap *idmap,const struct path *path, +int exfat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags);struct file_kattr ;fs/exfat/file.c +1
-1@@ -319,7 +319,7 @@ static void exfat_truncate(struct inode *inode)mutex_unlock (&sbi->s_lock); } -int exfat_getattr (struct mnt_idmap *idmap,const struct path *path, +int exfat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags) {fs/ext2/ext2.h +1
-1@@ -740,7 +740,7 @@ extern void ext2_evict_inode(struct inode *);void ext2_write_failed (struct address_space *mapping,loff_t to);extern int ext2_get_block (struct inode *,sector_t ,struct buffer_head *,int );extern int ext2_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); -extern int ext2_getattr (struct mnt_idmap *,const struct path *, +extern int ext2_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void ext2_set_inode_flags (struct inode *inode); extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,fs/ext2/inode.c +1
-1@@ -1591,7 +1591,7 @@ int ext2_sync_inode_metadata(struct inode *inode, struct writeback_control *wbc)return err; } -int ext2_getattr (struct mnt_idmap *idmap,const struct path *path, +int ext2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);fs/ext4/ext4.h +2
-2@@ -3182,11 +3182,11 @@ extern int ext4_sync_inode_metadata(struct inode *, struct writeback_control *)extern int ext4_setattr (struct mnt_idmap *,struct dentry *,struct iattr *);extern u32 ext4_dio_alignment (struct inode *inode); -extern int ext4_getattr (struct mnt_idmap *,const struct path *, +extern int ext4_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void ext4_evict_inode (struct inode *);extern void ext4_clear_inode (struct inode *); -extern int ext4_file_getattr (struct mnt_idmap *,const struct path *, +extern int ext4_file_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void ext4_dirty_inode (struct inode *,int );extern int ext4_change_inode_journal_flag (struct inode *,int );fs/ext4/inode.c +2
-2@@ -6263,7 +6263,7 @@ u32 ext4_dio_alignment(struct inode *inode)return 1 ;/* use the iomap defaults */ } -int ext4_getattr (struct mnt_idmap *idmap,const struct path *path, +int ext4_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);@@ -6332,7 +6332,7 @@ int ext4_getattr(struct mnt_idmap *idmap, const struct path *path,return 0 ; } -int ext4_file_getattr (struct mnt_idmap *idmap, +int ext4_file_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/ext4/symlink.c +1
-1@@ -55,7 +55,7 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,return paddr; } -static int ext4_encrypted_symlink_getattr (struct mnt_idmap *idmap, +static int ext4_encrypted_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags)fs/f2fs/f2fs.h +1
-1@@ -3848,7 +3848,7 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync);int f2fs_do_truncate_blocks (struct inode *inode,u64 from,bool lock);int f2fs_truncate_blocks (struct inode *inode,u64 from,bool lock);int f2fs_truncate (struct inode *inode); -int f2fs_getattr (struct mnt_idmap *idmap,const struct path *path, +int f2fs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int f2fs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);fs/f2fs/file.c +1
-1@@ -1032,7 +1032,7 @@ static bool f2fs_force_buffered_io(struct inode *inode, int rw)return false; } -int f2fs_getattr (struct mnt_idmap *idmap,const struct path *path, +int f2fs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);fs/f2fs/namei.c +1
-1@@ -1394,7 +1394,7 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,return target; } -static int f2fs_encrypted_symlink_getattr (struct mnt_idmap *idmap, +static int f2fs_encrypted_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags)fs/failfs.c +1
-1@@ -35,7 +35,7 @@ static struct dentry *failfs_lookup(struct inode *dir, struct dentry *dentry,return ERR_PTR (-EOPNOTSUPP ); } -static int failfs_getattr (struct mnt_idmap *idmap,const struct path *path, +static int failfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/fat/fat.h +1
-1@@ -407,7 +407,7 @@ extern const struct inode_operations fat_file_inode_operations;extern int fat_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);extern void fat_truncate_blocks (struct inode *inode,loff_t offset); -extern int fat_getattr (struct mnt_idmap *idmap, +extern int fat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int fat_fileattr_get (struct dentry *dentry,struct file_kattr *fa);fs/fat/file.c +1
-1@@ -432,7 +432,7 @@ int fat_fileattr_get(struct dentry *dentry, struct file_kattr *fa) }EXPORT_SYMBOL_GPL (fat_fileattr_get); -int fat_getattr (struct mnt_idmap *idmap,const struct path *path, +int fat_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct inode *inode =d_inode (path->dentry);fs/fuse/dir.c +2
-2@@ -1537,7 +1537,7 @@ static int fuse_do_getattr(const struct mnt_idmap *idmap, struct inode *inode,return err; } -static int fuse_update_get_attr (struct mnt_idmap *idmap,struct inode *inode, +static int fuse_update_get_attr (const struct mnt_idmap *idmap,struct inode *inode,struct file *file,struct kstat *stat,u32 request_mask,unsigned int flags) {@@ -2387,7 +2387,7 @@ static int fuse_setattr(struct mnt_idmap *idmap, struct dentry *entry,return ret; } -static int fuse_getattr (struct mnt_idmap *idmap, +static int fuse_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {fs/gfs2/inode.c +1
-1@@ -2156,7 +2156,7 @@ static int gfs2_setattr(struct mnt_idmap *idmap,* Returns: errno */ -static int gfs2_getattr (struct mnt_idmap *idmap, +static int gfs2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {fs/hfsplus/hfsplus_fs.h +1
-1@@ -459,7 +459,7 @@ void hfsplus_inode_write_fork(struct inode *inode, struct hfsplus_fork_raw *fork);int hfsplus_cat_read_inode (struct inode *inode,struct hfs_find_data *fd);int hfsplus_cat_write_inode (struct inode *inode); -int hfsplus_getattr (struct mnt_idmap *idmap,const struct path *path, +int hfsplus_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags); int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,fs/hfsplus/inode.c +1
-1@@ -335,7 +335,7 @@ static int hfsplus_setattr(struct mnt_idmap *idmap,return 0 ; } -int hfsplus_getattr (struct mnt_idmap *idmap,const struct path *path, +int hfsplus_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/internal.h +1
-1@@ -356,7 +356,7 @@ void file_f_owner_release(struct file *file);bool file_seek_cur_needs_f_lock (struct file *file);int statmount_mnt_idmap (const struct mnt_idmap *idmap,struct seq_file *seq,bool uid_map);struct dentry *find_next_child (struct dentry *parent,struct dentry *prev); -int anon_inode_getattr (struct mnt_idmap *idmap,const struct path *path, +int anon_inode_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags); int anon_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,fs/kernfs/inode.c +1
-1@@ -181,7 +181,7 @@ static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode)set_nlink (inode, kn->dir.subdirs +2 ); } -int kernfs_iop_getattr (struct mnt_idmap *idmap, +int kernfs_iop_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/kernfs/kernfs-internal.h +1
-1@@ -175,7 +175,7 @@ int kernfs_iop_permission(const struct mnt_idmap *idmap, struct inode *inode, int mask);int kernfs_iop_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr); -int kernfs_iop_getattr (struct mnt_idmap *idmap, +int kernfs_iop_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags);ssize_t kernfs_iop_listxattr (struct dentry *dentry,char *buf,size_t size);fs/libfs.c +1
-1@@ -29,7 +29,7 @@#include "internal.h" -int simple_getattr (struct mnt_idmap *idmap,const struct path *path, +int simple_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/minix/inode.c +1
-1@@ -724,7 +724,7 @@ static int minix_sync_inode_metadata(struct inode *inode,return err; } -int minix_getattr (struct mnt_idmap *idmap,const struct path *path, +int minix_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct super_block *sb = path->dentry->d_sb;fs/minix/minix.h +1
-1@@ -55,7 +55,7 @@ unsigned long minix_count_free_inodes(struct super_block *sb);int minix_new_block (struct inode *inode);void minix_free_block (struct inode *inode,unsigned long block);unsigned long minix_count_free_blocks (struct super_block *sb); -int minix_getattr (struct mnt_idmap *,const struct path *, +int minix_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );int minix_prepare_chunk (struct folio *folio,loff_t pos,unsigned len);struct mapping_metadata_bhs *minix_get_metadata_bhs (struct inode *inode);fs/nfs/inode.c +1
-1@@ -955,7 +955,7 @@ static u32 nfs_get_valid_attrmask(struct inode *inode)return reply_mask; } -int nfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int nfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);fs/nfs/namespace.c +1
-1@@ -222,7 +222,7 @@ struct vfsmount *nfs_d_automount(struct path *path) }static int -nfs_namespace_getattr (struct mnt_idmap *idmap, +nfs_namespace_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/ntfs/file.c +1
-1@@ -364,7 +364,7 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return err; } -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags) {fs/ntfs/inode.h +1
-1@@ -332,7 +332,7 @@ int ntfs_truncate_vfs(struct inode *vi, loff_t new_size, loff_t i_size);int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,unsigned int request_mask,unsigned int query_flags);fs/ntfs3/file.c +1
-1@@ -261,7 +261,7 @@ long ntfs_compat_ioctl(struct file *filp, u32 cmd, unsigned long arg)/* * ntfs_getattr - inode_operations::getattr */ -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,u32 flags) {struct inode *inode =d_inode (path->dentry);fs/ntfs3/ntfs_fs.h +1
-1@@ -553,7 +553,7 @@ extern const struct file_operations ntfs_dir_operations;int ntfs_fileattr_get (struct dentry *dentry,struct file_kattr *fa);int ntfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa); -int ntfs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,u32 flags);int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);fs/ocfs2/file.c +1
-1@@ -1317,7 +1317,7 @@ int ocfs2_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return status; } -int ocfs2_getattr (struct mnt_idmap *idmap,const struct path *path, +int ocfs2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct inode *inode =d_inode (path->dentry);fs/ocfs2/file.h +1
-1@@ -52,7 +52,7 @@ int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh, loff_t zero_to);int ocfs2_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int ocfs2_getattr (struct mnt_idmap *idmap,const struct path *path, +int ocfs2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); int ocfs2_permission(const struct mnt_idmap *idmap, struct inode *inode,fs/orangefs/inode.c +1
-1@@ -848,7 +848,7 @@ int orangefs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,/* * Obtain attributes of an object given a dentry */ -int orangefs_getattr (struct mnt_idmap *idmap,const struct path *path, +int orangefs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {int ret;fs/orangefs/orangefs-kernel.h +1
-1@@ -354,7 +354,7 @@ int __orangefs_setattr(struct inode *, struct iattr *);int __orangefs_setattr_mode (struct dentry *dentry,struct iattr *iattr);int orangefs_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); -int orangefs_getattr (struct mnt_idmap *idmap,const struct path *path, +int orangefs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); int orangefs_permission(const struct mnt_idmap *idmap,fs/overlayfs/inode.c +1
-1@@ -168,7 +168,7 @@ static inline int ovl_real_getattr_nosec(struct super_block *sb,return vfs_getattr_nosec (path, stat, request_mask, flags); } -int ovl_getattr (struct mnt_idmap *idmap,const struct path *path, +int ovl_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct dentry *dentry = path->dentry;fs/overlayfs/overlayfs.h +1
-1@@ -950,6 +950,6 @@ static inline bool ovl_force_readonly(struct ovl_fs *ofs)const struct xattr_handler *const *ovl_xattr_handlers (struct ovl_fs *ofs);int ovl_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -int ovl_getattr (struct mnt_idmap *idmap,const struct path *path, +int ovl_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);ssize_t ovl_listxattr (struct dentry *dentry,char *list,size_t size);fs/pidfs.c +1
-1@@ -829,7 +829,7 @@ static int pidfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return anon_inode_setattr (idmap, dentry, attr); } -static int pidfs_getattr (struct mnt_idmap *idmap,const struct path *path, +static int pidfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/proc/base.c +2
-2@@ -1994,7 +1994,7 @@ static struct inode *proc_pid_make_base_inode(struct super_block *sb,return inode; } -int pid_getattr (struct mnt_idmap *idmap,const struct path *path, +int pid_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {struct inode *inode =d_inode (path->dentry);@@ -3936,7 +3936,7 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx)return 0 ; } -static int proc_task_getattr (struct mnt_idmap *idmap, +static int proc_task_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/proc/fd.c +1
-1@@ -342,7 +342,7 @@ int proc_fd_permission(const struct mnt_idmap *idmap,return rv; } -static int proc_fd_getattr (struct mnt_idmap *idmap, +static int proc_fd_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/proc/generic.c +1
-1@@ -135,7 +135,7 @@ static int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return 0 ; } -static int proc_getattr (struct mnt_idmap *idmap, +static int proc_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/proc/internal.h +1
-1@@ -258,7 +258,7 @@ extern int proc_pid_statm(struct seq_file *, struct pid_namespace *,* base.c */ extern const struct dentry_operations pid_dentry_operations; -extern int pid_getattr (struct mnt_idmap *,const struct path *, +extern int pid_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );int proc_nochmod_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);fs/proc/proc_net.c +1
-1@@ -308,7 +308,7 @@ static struct dentry *proc_tgid_net_lookup(struct inode *dir,return de; } -static int proc_tgid_net_getattr (struct mnt_idmap *idmap, +static int proc_tgid_net_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/proc/proc_sysctl.c +1
-1@@ -834,7 +834,7 @@ static int proc_sys_setattr(struct mnt_idmap *idmap,return 0 ; } -static int proc_sys_getattr (struct mnt_idmap *idmap, +static int proc_sys_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/proc/root.c +1
-1@@ -402,7 +402,7 @@ void __init proc_root_init(void)register_filesystem (&proc_fs_type); } -static int proc_root_getattr (struct mnt_idmap *idmap, +static int proc_root_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/smb/client/cifsfs.h +1
-1@@ -78,7 +78,7 @@ int cifs_revalidate_file(struct file *filp);int cifs_revalidate_dentry (struct dentry *dentry);int cifs_revalidate_mapping (struct inode *inode);int cifs_zap_mapping (struct inode *inode); -int cifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int cifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int cifs_setattr (struct mnt_idmap *idmap,struct dentry *direntry,struct iattr *attrs);fs/smb/client/inode.c +1
-1@@ -2932,7 +2932,7 @@ int cifs_revalidate_dentry(struct dentry *dentry)return cifs_revalidate_mapping (inode); } -int cifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int cifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {struct cifs_sb_info *cifs_sb =CIFS_SB (path->dentry);fs/stat.c +1
-1@@ -79,7 +79,7 @@ EXPORT_SYMBOL(fill_mg_cmtime);* uid and gid filds. On non-idmapped mounts or if permission checking is to be * performed on the raw inode simply pass @nop_mnt_idmap. */ -void generic_fillattr (struct mnt_idmap *idmap,u32 request_mask, +void generic_fillattr (const struct mnt_idmap *idmap,u32 request_mask,struct inode *inode,struct kstat *stat) {vfsuid_t vfsuid =i_uid_into_vfsuid (idmap, inode);fs/tracefs/inode.c +1
-1@@ -196,7 +196,7 @@ static int tracefs_permission(const struct mnt_idmap *idmap,return generic_permission (idmap, inode, mask); } -static int tracefs_getattr (struct mnt_idmap *idmap, +static int tracefs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {fs/ubifs/dir.c +1
-1@@ -1667,7 +1667,7 @@ static int ubifs_rename(const struct mnt_idmap *idmap,return do_rename (old_dir, old_dentry, new_dir, new_dentry, flags); } -int ubifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ubifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {loff_t size;fs/ubifs/file.c +1
-1@@ -1611,7 +1611,7 @@ static const char *ubifs_get_link(struct dentry *dentry,return fscrypt_get_symlink (inode, ui->data, ui->data_len, done); } -static int ubifs_symlink_getattr (struct mnt_idmap *idmap, +static int ubifs_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {fs/ubifs/ubifs.h +1
-1@@ -2028,7 +2028,7 @@ int ubifs_update_time(struct inode *inode, enum fs_update_time type,/* dir.c */ struct inode *ubifs_new_inode (struct ubifs_info *c,struct inode *dir,umode_t mode,bool is_xattr); -int ubifs_getattr (struct mnt_idmap *idmap,const struct path *path, +int ubifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);int ubifs_check_dir_empty (struct inode *dir);fs/udf/symlink.c +1
-1@@ -133,7 +133,7 @@ static int udf_symlink_filler(struct file *file, struct folio *folio)return err; } -static int udf_symlink_getattr (struct mnt_idmap *idmap, +static int udf_symlink_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags) {fs/vboxsf/utils.c +1
-1@@ -233,7 +233,7 @@ int vboxsf_inode_revalidate(struct dentry *dentry)return 0 ; } -int vboxsf_getattr (struct mnt_idmap *idmap,const struct path *path, +int vboxsf_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *kstat,u32 request_mask,unsigned int flags) {int err;fs/vboxsf/vfsmod.h +1
-1@@ -98,7 +98,7 @@ int vboxsf_stat(struct vboxsf_sbi *sbi, struct shfl_string *path, struct shfl_fsobjinfo *info);int vboxsf_stat_dentry (struct dentry *dentry,struct shfl_fsobjinfo *info);int vboxsf_inode_revalidate (struct dentry *dentry); -int vboxsf_getattr (struct mnt_idmap *idmap,const struct path *path, +int vboxsf_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *kstat,u32 request_mask,unsigned int query_flags); int vboxsf_setattr(struct mnt_idmap *idmap, struct dentry *dentry,fs/xfs/xfs_iops.c +1
-1@@ -679,7 +679,7 @@ xfs_report_atomic_write( STATIC int xfs_vn_getattr( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, u32 request_mask,include/linux/fs.h +3
-3@@ -2013,7 +2013,7 @@ struct inode_operations {int (*rename) (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int );int (*setattr) (struct mnt_idmap *,struct dentry *,struct iattr *); -int (*getattr) (struct mnt_idmap *,const struct path *, +int (*getattr) (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );ssize_t (*listxattr) (struct dentry *,char *,size_t ); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,@@ -3204,7 +3204,7 @@ extern int page_symlink(struct inode *inode, const char *symname, int len);extern const struct inode_operations page_symlink_inode_operations;extern void kfree_link (void *);void fill_mg_cmtime (struct kstat *stat,u32 request_mask,struct inode *inode); -void generic_fillattr (struct mnt_idmap *,u32 ,struct inode *,struct kstat *); +void generic_fillattr (const struct mnt_idmap *,u32 ,struct inode *,struct kstat *);void generic_fill_statx_attr (struct inode *inode,struct kstat *stat); void generic_fill_statx_atomic_writes(struct kstat *stat, unsigned int unit_min,@@ -3263,7 +3263,7 @@ extern loff_t dcache_dir_lseek(struct file *, loff_t, int);extern int dcache_readdir (struct file *,struct dir_context *);extern int simple_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); -extern int simple_getattr (struct mnt_idmap *,const struct path *, +extern int simple_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern int simple_statfs (struct dentry *,struct kstatfs *);extern int simple_open (struct inode *inode,struct file *file);include/linux/nfs_fs.h +1
-1@@ -437,7 +437,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);extern int nfs_post_op_update_inode (struct inode *inode,struct nfs_fattr *fattr);extern int nfs_post_op_update_inode_force_wcc (struct inode *inode,struct nfs_fattr *fattr);extern int nfs_post_op_update_inode_force_wcc_locked (struct inode *inode,struct nfs_fattr *fattr); -extern int nfs_getattr (struct mnt_idmap *,const struct path *, +extern int nfs_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void nfs_access_add_cache (struct inode *,struct nfs_access_entry *,const struct cred *);extern void nfs_access_set_mask (struct nfs_access_entry *,u32 );mm/shmem.c +1
-1@@ -1292,7 +1292,7 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, uoff_t lend) }EXPORT_SYMBOL_GPL (shmem_truncate_range); -static int shmem_getattr (struct mnt_idmap *idmap, +static int shmem_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags) {Signature · 2 lines
-- 2.53.0
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Christian Brauner
maintainerPATCH 24/27 fs: port ->setattr() to pass const mnt_idmap
In reply to Christian BraunerConvert to const struct mnt_idmap.
A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.
So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- fs/9p/v9fs_vfs.h | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/adfs/adfs.h | 2 +- fs/adfs/inode.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/inode.c | 2 +- fs/afs/inode.c | 2 +- fs/afs/internal.h | 2 +- fs/anon_inodes.c | 2 +- fs/attr.c | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/inode.c | 2 +- fs/ceph/super.h | 2 +- fs/coda/coda_linux.h | 2 +- fs/coda/inode.c | 2 +- fs/configfs/configfs_internal.h | 2 +- fs/configfs/inode.c | 2 +- fs/debugfs/inode.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/efivarfs/inode.c | 2 +- fs/exfat/exfat_fs.h | 2 +- fs/exfat/file.c | 2 +- fs/ext2/ext2.h | 2 +- fs/ext2/inode.c | 2 +- fs/ext4/ext4.h | 2 +- fs/ext4/inode.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- fs/fat/fat.h | 2 +- fs/fat/file.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/hfs_fs.h | 2 +- fs/hfs/inode.c | 2 +- fs/hfsplus/inode.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/hpfs_fn.h | 2 +- fs/hpfs/inode.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/inode.c | 2 +- fs/internal.h | 2 +- fs/jffs2/fs.c | 2 +- fs/jffs2/os-linux.h | 2 +- fs/jfs/file.c | 2 +- fs/jfs/jfs_inode.h | 2 +- fs/kernfs/inode.c | 2 +- fs/kernfs/kernfs-internal.h | 2 +- fs/libfs.c | 4 ++-- fs/minix/file.c | 2 +- fs/nfs/inode.c | 2 +- fs/nfs/namespace.c | 2 +- fs/nilfs2/inode.c | 2 +- fs/nilfs2/nilfs.h | 2 +- fs/ntfs/file.c | 2 +- fs/ntfs/inode.h | 2 +- fs/ntfs3/file.c | 2 +- fs/ntfs3/ntfs_fs.h | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/file.c | 2 +- fs/ocfs2/file.h | 2 +- fs/omfs/file.c | 2 +- fs/orangefs/inode.c | 2 +- fs/orangefs/orangefs-kernel.h | 2 +- fs/overlayfs/inode.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- fs/pidfs.c | 2 +- fs/proc/base.c | 2 +- fs/proc/generic.c | 2 +- fs/proc/internal.h | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/ramfs/file-nommu.c | 4 ++-- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/tracefs/event_inode.c | 2 +- fs/tracefs/inode.c | 2 +- fs/ubifs/file.c | 2 +- fs/ubifs/ubifs.h | 2 +- fs/udf/file.c | 2 +- fs/ufs/inode.c | 2 +- fs/ufs/ufs.h | 2 +- fs/vboxsf/utils.c | 2 +- fs/vboxsf/vfsmod.h | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/zonefs/super.c | 2 +- include/linux/fs.h | 6 +++--- include/linux/lsm_hook_defs.h | 4 ++-- include/linux/nfs_fs.h | 2 +- include/linux/security.h | 8 ++++---- mm/secretmem.c | 2 +- mm/shmem.c | 2 +- net/socket.c | 2 +- security/integrity/evm/evm_main.c | 4 ++-- security/integrity/ima/ima_appraise.c | 2 +- security/security.c | 4 ++-- security/selinux/hooks.c | 2 +- security/smack/smack_lsm.c | 2 +- virt/kvm/guest_memfd.c | 2 +- 102 files changed, 112 insertions(+), 112 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -76,7 +76,7 @@ prototypes:: void (*truncate) (struct inode *); int (*permission) (const struct mnt_idmap *, struct inode *, int, unsigned int); struct posix_acl * (*get_inode_acl)(struct inode *, int, bool); - int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *); + int (*setattr) (const struct mnt_idmap *, struct dentry *, struct iattr *); int (*getattr) (const struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); ssize_t (*listxattr) (struct dentry *, char *, size_t); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
Documentation/filesystems/vfs.rst +1 -1
@@ -430,7 +430,7 @@ As of kernel 2.6.22, the following members are defined: struct delayed_call *); int (*permission) (const struct mnt_idmap *, struct inode *, int); struct posix_acl * (*get_inode_acl)(struct inode *, int, bool); - int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *); + int (*setattr) (const struct mnt_idmap *, struct dentry *, struct iattr *); int (*getattr) (const struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int); ssize_t (*listxattr) (struct dentry *, char *, size_t); void (*update_time)(struct inode *inode, enum fs_update_time type,
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -92,7 +92,7 @@ spufs_new_inode(struct super_block *sb, umode_t mode) }static int -spufs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +spufs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/9p/v9fs_vfs.h +1 -1
@@ -74,7 +74,7 @@ int v9fs_file_open(struct inode *inode, struct file *file);int v9fs_uflags2omode (int uflags,int extended);void v9fs_blank_wstat (struct p9_wstat *wstat); -int v9fs_vfs_setattr_dotl (struct mnt_idmap *idmap, +int v9fs_vfs_setattr_dotl (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr);int v9fs_file_fsync_dotl (struct file *filp,loff_t start,loff_t end,int datasync);
fs/9p/vfs_inode.c +1 -1
@@ -1014,7 +1014,7 @@ v9fs_vfs_getattr(const struct mnt_idmap *idmap, const struct path *path,* */ -static int v9fs_vfs_setattr (struct mnt_idmap *idmap, +static int v9fs_vfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {int retval, use_dentry =0 ;
fs/9p/vfs_inode_dotl.c +1 -1
@@ -508,7 +508,7 @@ static int v9fs_mapped_iattr_valid(int iattr_valid)* */ -int v9fs_vfs_setattr_dotl (struct mnt_idmap *idmap, +int v9fs_vfs_setattr_dotl (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {int retval, use_dentry =0 ;
fs/adfs/adfs.h +1 -1
@@ -144,7 +144,7 @@ struct adfs_discmap {/* Inode stuff */ struct inode *adfs_iget (struct super_block *sb,struct object_info *obj);int adfs_write_inode (struct inode *inode,struct writeback_control *wbc); -int adfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int adfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);/* map.c */
fs/adfs/inode.c +1 -1
@@ -299,7 +299,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)* later. */ int -adfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) +adfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);struct super_block *sb = inode->i_sb;
fs/affs/affs.h +1 -1
@@ -184,7 +184,7 @@ extern int affs_rename2(const struct mnt_idmap *idmap,/* inode.c */ extern struct inode *affs_new_inode (struct inode *dir); -extern int affs_setattr (struct mnt_idmap *idmap, +extern int affs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);extern void affs_evict_inode (struct inode *inode); extern struct inode *affs_iget(struct super_block *sb,
fs/affs/inode.c +1 -1
@@ -213,7 +213,7 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc) }int -affs_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) +affs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);int error;
fs/afs/inode.c +1 -1
@@ -759,7 +759,7 @@ static const struct afs_operation_ops afs_setattr_operation = {/* * set the attributes of an inode */ -int afs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int afs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) { const unsigned int supported =
fs/afs/internal.h +1 -1
@@ -1260,7 +1260,7 @@ extern struct inode *afs_iget(struct afs_operation *, struct afs_vnode_param *);extern struct inode *afs_root_iget (struct super_block *,struct key *);extern int afs_getattr (const struct mnt_idmap *idmap,const struct path *,struct kstat *,u32 ,unsigned int ); -extern int afs_setattr (struct mnt_idmap *idmap,struct dentry *,struct iattr *); +extern int afs_setattr (const struct mnt_idmap *idmap,struct dentry *,struct iattr *);extern void afs_evict_inode (struct inode *);extern int afs_drop_inode (struct inode *);
fs/anon_inodes.c +1 -1
@@ -57,7 +57,7 @@ int anon_inode_getattr(const struct mnt_idmap *idmap, const struct path *path,return 0 ; } -int anon_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int anon_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {return -EOPNOTSUPP ;
fs/attr.c +1 -1
@@ -424,7 +424,7 @@ EXPORT_SYMBOL(may_setattr);* permissions. On non-idmapped mounts or if permission checking is to be * performed on the raw inode simply pass @nop_mnt_idmap. */ -int notify_change (struct mnt_idmap *idmap,struct dentry *dentry, +int notify_change (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr,struct delegated_inode *delegated_inode) {struct inode *inode = dentry->d_inode;
fs/bad_inode.c +1 -1
@@ -102,7 +102,7 @@ static int bad_inode_getattr(const struct mnt_idmap *idmap,return -EIO ; } -static int bad_inode_setattr (struct mnt_idmap *idmap, +static int bad_inode_setattr (const struct mnt_idmap *idmap,struct dentry *direntry,struct iattr *attrs) {return -EIO ;
fs/btrfs/inode.c +1 -1
@@ -5479,7 +5479,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)return ret; } -static int btrfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int btrfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/ceph/inode.c +1 -1
@@ -2921,7 +2921,7 @@ int __ceph_setattr(const struct mnt_idmap *idmap, struct inode *inode,/* * setattr */ -int ceph_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ceph_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/ceph/super.h +1 -1
@@ -1175,7 +1175,7 @@ struct ceph_iattr {extern int __ceph_setattr (const struct mnt_idmap *idmap,struct inode *inode,struct iattr *attr,struct ceph_iattr *cia); -extern int ceph_setattr (struct mnt_idmap *idmap, +extern int ceph_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); extern int ceph_getattr(const struct mnt_idmap *idmap, const struct path *path, struct kstat *stat,
fs/coda/coda_linux.h +1 -1
@@ -51,7 +51,7 @@ int coda_permission(const struct mnt_idmap *idmap, struct inode *inode,int coda_revalidate_inode (struct inode *);int coda_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int ); -int coda_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +int coda_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);/* this file: helpers */ char *coda_f2s (struct CodaFid *f);
fs/coda/inode.c +1 -1
@@ -304,7 +304,7 @@ int coda_getattr(const struct mnt_idmap *idmap, const struct path *path,return err; } -int coda_setattr (struct mnt_idmap *idmap,struct dentry *de, +int coda_setattr (const struct mnt_idmap *idmap,struct dentry *de,struct iattr *iattr) {struct inode *inode =d_inode (de);
fs/configfs/configfs_internal.h +1 -1
@@ -76,7 +76,7 @@ extern int configfs_make_dirent(struct configfs_dirent *, struct dentry *,extern int configfs_dirent_is_ready (struct configfs_dirent *);extern const unsigned char *configfs_get_name (struct configfs_dirent *sd); -extern int configfs_setattr (struct mnt_idmap *idmap, +extern int configfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr);extern struct dentry *configfs_pin_fs (void );
fs/configfs/inode.c +1 -1
@@ -32,7 +32,7 @@ static const struct inode_operations configfs_inode_operations ={ .setattr = configfs_setattr, }; -int configfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int configfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode * inode =d_inode (dentry);
fs/debugfs/inode.c +1 -1
@@ -42,7 +42,7 @@ static bool debugfs_enabled __ro_after_init = IS_ENABLED(CONFIG_DEBUG_FS_ALLOW_A* so that we can use the file mode as part of a heuristic to determine whether * to lock down individual files. */ -static int debugfs_setattr (struct mnt_idmap *idmap, +static int debugfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *ia) {int ret;
fs/ecryptfs/inode.c +1 -1
@@ -869,7 +869,7 @@ ecryptfs_permission(const struct mnt_idmap *idmap, struct inode *inode,* All other metadata changes will be passed right to the lower filesystem, * and we will just update our inode to look like the lower. */ -static int ecryptfs_setattr (struct mnt_idmap *idmap, +static int ecryptfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *ia) {struct inode *inode =d_inode (dentry);
fs/efivarfs/inode.c +1 -1
@@ -170,7 +170,7 @@ efivarfs_fileattr_set(const struct mnt_idmap *idmap, }/* copy of simple_setattr except that it doesn't do i_size updates */ -static int efivarfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int efivarfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
fs/exfat/exfat_fs.h +1 -1
@@ -555,7 +555,7 @@ int exfat_trim_fs(struct inode *inode, struct fstrim_range *range);/* file.c */ extern const struct file_operations exfat_file_operations;int __exfat_truncate (struct inode *inode); -int exfat_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int exfat_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); int exfat_getattr(const struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, unsigned int request_mask,
fs/exfat/file.c +1 -1
@@ -347,7 +347,7 @@ int exfat_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int exfat_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int exfat_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct exfat_sb_info *sbi =EXFAT_SB (dentry->d_sb);
fs/ext2/ext2.h +1 -1
@@ -739,7 +739,7 @@ extern int ext2_sync_inode_metadata(struct inode *, struct writeback_control *);extern void ext2_evict_inode (struct inode *);void ext2_write_failed (struct address_space *mapping,loff_t to);extern int ext2_get_block (struct inode *,sector_t ,struct buffer_head *,int ); -extern int ext2_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +extern int ext2_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);extern int ext2_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );extern void ext2_set_inode_flags (struct inode *inode);
fs/ext2/inode.c +1 -1
@@ -1617,7 +1617,7 @@ int ext2_getattr(const struct mnt_idmap *idmap, const struct path *path,return 0 ; } -int ext2_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ext2_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
fs/ext4/ext4.h +1 -1
@@ -3179,7 +3179,7 @@ extern struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,extern int ext4_write_inode (struct inode *,struct writeback_control *);extern int ext4_sync_inode_metadata (struct inode *,struct writeback_control *); -extern int ext4_setattr (struct mnt_idmap *,struct dentry *, +extern int ext4_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);extern u32 ext4_dio_alignment (struct inode *inode); extern int ext4_getattr(const struct mnt_idmap *, const struct path *,
fs/ext4/inode.c +1 -1
@@ -6006,7 +6006,7 @@ static void ext4_wait_for_tail_page_commit(struct inode *inode)* * Called with inode->i_rwsem down. */ -int ext4_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ext4_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/f2fs/f2fs.h +1 -1
@@ -3850,7 +3850,7 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock);int f2fs_truncate (struct inode *inode);int f2fs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); -int f2fs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int f2fs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);int f2fs_truncate_hole (struct inode *inode,pgoff_t pg_start,pgoff_t pg_end);void f2fs_truncate_data_blocks_range (struct dnode_of_data *dn,int count);
fs/f2fs/file.c +1 -1
@@ -1121,7 +1121,7 @@ static void __setattr_copy(const struct mnt_idmap *idmap,#define __setattr_copy setattr_copy#endif -int f2fs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int f2fs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/fat/fat.h +1 -1
@@ -404,7 +404,7 @@ extern long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);extern const struct file_operations fat_file_operations;extern const struct inode_operations fat_file_inode_operations; -extern int fat_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +extern int fat_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);extern void fat_truncate_blocks (struct inode *inode,loff_t offset); extern int fat_getattr(const struct mnt_idmap *idmap,
fs/fat/file.c +1 -1
@@ -514,7 +514,7 @@ static int fat_allow_set_time(const struct mnt_idmap *idmap,/* valid file mode bits */ #define FAT_VALID_MODE (S_IFREG | S_IFDIR | S_IRWXUGO) -int fat_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int fat_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct msdos_sb_info *sbi =MSDOS_SB (dentry->d_sb);
fs/fuse/dir.c +1 -1
@@ -2324,7 +2324,7 @@ int fuse_do_setattr(const struct mnt_idmap *idmap, struct dentry *dentry,return err; } -static int fuse_setattr (struct mnt_idmap *idmap,struct dentry *entry, +static int fuse_setattr (const struct mnt_idmap *idmap,struct dentry *entry,struct iattr *attr) {struct inode *inode =d_inode (entry);
fs/gfs2/inode.c +1 -1
@@ -2095,7 +2095,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)* Returns: errno */ -static int gfs2_setattr (struct mnt_idmap *idmap, +static int gfs2_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/hfs/hfs_fs.h +1 -1
@@ -212,7 +212,7 @@ extern struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name,extern void hfs_inode_write_fork (struct inode *inode,struct hfs_extent *ext,__be32 *log_size,__be32 *phys_size);extern int hfs_write_inode (struct inode *inode,struct writeback_control *wbc); -extern int hfs_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +extern int hfs_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); extern void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext, __be32 __log_size, __be32 phys_size,
fs/hfs/inode.c +1 -1
@@ -643,7 +643,7 @@ static int hfs_file_release(struct inode *inode, struct file *file)return 0 ; } -int hfs_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int hfs_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/hfsplus/inode.c +1 -1
@@ -305,7 +305,7 @@ static int hfsplus_file_release(struct inode *inode, struct file *file)return 0 ; } -static int hfsplus_setattr (struct mnt_idmap *idmap, +static int hfsplus_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/hostfs/hostfs_kern.c +1 -1
@@ -801,7 +801,7 @@ static int hostfs_permission(const struct mnt_idmap *idmap,return err; } -static int hostfs_setattr (struct mnt_idmap *idmap, +static int hostfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/hpfs/hpfs_fn.h +1 -1
@@ -280,7 +280,7 @@ void hpfs_init_inode(struct inode *);void hpfs_read_inode (struct inode *);void hpfs_write_inode (struct inode *);void hpfs_write_inode_nolock (struct inode *); -int hpfs_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +int hpfs_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);void hpfs_write_if_changed (struct inode *);void hpfs_evict_inode (struct inode *);
fs/hpfs/inode.c +1 -1
@@ -257,7 +257,7 @@ void hpfs_write_inode_nolock(struct inode *i)brelse (bh); } -int hpfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int hpfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/hugetlbfs/inode.c +1 -1
@@ -828,7 +828,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,return error; } -static int hugetlbfs_setattr (struct mnt_idmap *idmap, +static int hugetlbfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/inode.c +1 -1
@@ -2356,7 +2356,7 @@ int dentry_needs_remove_privs(const struct mnt_idmap *idmap,return mask; } -static int __remove_privs (struct mnt_idmap *idmap, +static int __remove_privs (const struct mnt_idmap *idmap,struct dentry *dentry,int kill) {struct iattr newattrs;
fs/internal.h +1 -1
@@ -359,7 +359,7 @@ struct dentry *find_next_child(struct dentry *parent, struct dentry *prev);int anon_inode_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int query_flags); -int anon_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int anon_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);void pidfs_get_root (struct path *path);void nsfs_get_root (struct path *path);
fs/jffs2/fs.c +1 -1
@@ -190,7 +190,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)return 0 ; } -int jffs2_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int jffs2_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
fs/jffs2/os-linux.h +1 -1
@@ -164,7 +164,7 @@ long jffs2_ioctl(struct file *, unsigned int, unsigned long);extern const struct inode_operations jffs2_symlink_inode_operations;/* fs.c */ -int jffs2_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +int jffs2_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);int jffs2_do_setattr (struct inode *,struct iattr *);struct inode *jffs2_iget (struct super_block *,unsigned long );void jffs2_evict_inode (struct inode *);
fs/jfs/file.c +1 -1
@@ -89,7 +89,7 @@ static int jfs_release(struct inode *inode, struct file *file)return 0 ; } -int jfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int jfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
fs/jfs/jfs_inode.h +1 -1
@@ -28,7 +28,7 @@ extern struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid, int fh_len, int fh_type);extern void jfs_set_inode_flags (struct inode *);extern int jfs_get_block (struct inode *,sector_t ,struct buffer_head *,int ); -extern int jfs_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +extern int jfs_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);extern const struct address_space_operations jfs_aops;extern const struct inode_operations jfs_dir_inode_operations;
fs/kernfs/inode.c +1 -1
@@ -107,7 +107,7 @@ int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr)return ret; } -int kernfs_iop_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int kernfs_iop_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
fs/kernfs/kernfs-internal.h +1 -1
@@ -173,7 +173,7 @@ extern const struct xattr_handler * const kernfs_xattr_handlers[];void kernfs_evict_inode (struct inode *inode);int kernfs_iop_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask); -int kernfs_iop_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int kernfs_iop_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr); int kernfs_iop_getattr(const struct mnt_idmap *idmap, const struct path *path, struct kstat *stat,
fs/libfs.c +2 -2
@@ -913,7 +913,7 @@ EXPORT_SYMBOL(simple_rename);* on simple regular filesystems. Anything that needs to change on-disk * or wire state on size changes needs its own setattr method. */ -int simple_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int simple_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
@@ -1727,7 +1727,7 @@ static struct dentry *empty_dir_lookup(struct inode *dir, struct dentry *dentry,return ERR_PTR (-ENOENT ); } -static int empty_dir_setattr (struct mnt_idmap *idmap, +static int empty_dir_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {return -EPERM ;
fs/minix/file.c +1 -1
@@ -23,7 +23,7 @@ const struct file_operations minix_file_operations = { .splice_read = filemap_splice_read, }; -static int minix_setattr (struct mnt_idmap *idmap, +static int minix_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/nfs/inode.c +1 -1
@@ -690,7 +690,7 @@ EXPORT_SYMBOL_GPL(nfs_update_delegated_mtime);#define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE|ATTR_OPEN)int -nfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +nfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/nfs/namespace.c +1 -1
@@ -235,7 +235,7 @@ nfs_namespace_getattr(const struct mnt_idmap *idmap, }static int -nfs_namespace_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +nfs_namespace_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {if (NFS_FH (d_inode (dentry))->size !=0 )
fs/nilfs2/inode.c +1 -1
@@ -904,7 +904,7 @@ void nilfs_evict_inode(struct inode *inode)*/ } -int nilfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int nilfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct nilfs_transaction_info ti;
fs/nilfs2/nilfs.h +1 -1
@@ -299,7 +299,7 @@ struct inode *nilfs_iget_for_shadow(struct inode *inode);extern void nilfs_update_inode (struct inode *,struct buffer_head *,int );extern void nilfs_truncate (struct inode *);extern void nilfs_evict_inode (struct inode *); -extern int nilfs_setattr (struct mnt_idmap *,struct dentry *, +extern int nilfs_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);extern void nilfs_write_failed (struct address_space *mapping,loff_t to); int nilfs_permission(const struct mnt_idmap *idmap, struct inode *inode,
fs/ntfs/file.c +1 -1
@@ -294,7 +294,7 @@ static int ntfs_setattr_size(struct inode *vi, struct iattr *attr)* NOTE: Changes in inode size are not supported yet for compressed or * encrypted files. */ -int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *vi =d_inode (dentry);
fs/ntfs/inode.h +1 -1
@@ -330,7 +330,7 @@ int ntfs_read_inode_mount(struct inode *vi);int ntfs_show_options (struct seq_file *sf,struct dentry *root);int ntfs_truncate_vfs (struct inode *vi,loff_t new_size,loff_t i_size); -int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); int ntfs_getattr(const struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, unsigned int request_mask,
fs/ntfs3/file.c +1 -1
@@ -703,7 +703,7 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)/* * ntfs_setattr - inode_operations::setattr */ -int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/ntfs3/ntfs_fs.h +1 -1
@@ -555,7 +555,7 @@ int ntfs_fileattr_set(const struct mnt_idmap *idmap, struct dentry *dentry, struct file_kattr *fa);int ntfs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,u32 flags); -int ntfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);int ntfs_file_open (struct inode *inode,struct file *file); int ntfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
fs/ocfs2/dlmfs/dlmfs.c +1 -1
@@ -188,7 +188,7 @@ static int dlmfs_file_release(struct inode *inode,* We do ->setattr() just to override size changes. Our size is the size * of the LVB and nothing else. */ -static int dlmfs_file_setattr (struct mnt_idmap *idmap, +static int dlmfs_file_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {int error;
fs/ocfs2/file.c +1 -1
@@ -1117,7 +1117,7 @@ static int ocfs2_extend_file(struct inode *inode,return ret; } -int ocfs2_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ocfs2_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {int status =0 , size_change;
fs/ocfs2/file.h +1 -1
@@ -50,7 +50,7 @@ int ocfs2_extend_no_holes(struct inode *inode, struct buffer_head *di_bh, u64 new_i_size, u64 zero_to);int ocfs2_zero_extend (struct inode *inode,struct buffer_head *di_bh,loff_t zero_to); -int ocfs2_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ocfs2_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);int ocfs2_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);
fs/omfs/file.c +1 -1
@@ -338,7 +338,7 @@ const struct file_operations omfs_file_operations = { .splice_read = filemap_splice_read, }; -static int omfs_setattr (struct mnt_idmap *idmap, +static int omfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/orangefs/inode.c +1 -1
@@ -828,7 +828,7 @@ int __orangefs_setattr_mode(struct dentry *dentry, struct iattr *iattr)/* * Change attributes of an object referenced by dentry. */ -int orangefs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int orangefs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {int ret;
fs/orangefs/orangefs-kernel.h +1 -1
@@ -352,7 +352,7 @@ struct inode *orangefs_new_inode(struct super_block *sb,int __orangefs_setattr (struct inode *,struct iattr *);int __orangefs_setattr_mode (struct dentry *dentry,struct iattr *iattr); -int orangefs_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +int orangefs_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);int orangefs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);
fs/overlayfs/inode.c +1 -1
@@ -18,7 +18,7 @@#include "overlayfs.h" -int ovl_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ovl_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {int err;
fs/overlayfs/overlayfs.h +1 -1
@@ -948,7 +948,7 @@ static inline bool ovl_force_readonly(struct ovl_fs *ofs)/* xattr.c */ const struct xattr_handler *const *ovl_xattr_handlers (struct ovl_fs *ofs); -int ovl_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ovl_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);int ovl_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags);
fs/pidfs.c +1 -1
@@ -823,7 +823,7 @@ static struct vfsmount *pidfs_mnt __ro_after_init;* implemented. Let's reject it completely until we have a clean * permission concept for pidfds. */ -static int pidfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int pidfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {return anon_inode_setattr (idmap, dentry, attr);
fs/proc/base.c +1 -1
@@ -702,7 +702,7 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,/* Here the fs part begins */ /************************************************************************/ -int proc_nochmod_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int proc_nochmod_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {int error;
fs/proc/generic.c +1 -1
@@ -117,7 +117,7 @@ static bool pde_subdir_insert(struct proc_dir_entry *dir,return true; } -static int proc_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int proc_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
fs/proc/internal.h +1 -1
@@ -260,7 +260,7 @@ extern int proc_pid_statm(struct seq_file *, struct pid_namespace *,extern const struct dentry_operations pid_dentry_operations;extern int pid_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int ); -int proc_nochmod_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int proc_nochmod_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);extern void proc_pid_evict_inode (struct proc_inode *);extern struct inode *proc_pid_make_inode (struct super_block *,struct task_struct *,umode_t );
fs/proc/proc_sysctl.c +1 -1
@@ -817,7 +817,7 @@ static int proc_sys_permission(const struct mnt_idmap *idmap,return error; } -static int proc_sys_setattr (struct mnt_idmap *idmap, +static int proc_sys_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/ramfs/file-nommu.c +2 -2
@@ -22,7 +22,7 @@#include <linux/uaccess.h> #include "internal.h" -static int ramfs_nommu_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +static int ramfs_nommu_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *); static unsigned long ramfs_nommu_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
@@ -161,7 +161,7 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)* handle a change of attributes * - we're specifically interested in a change of size */ -static int ramfs_nommu_setattr (struct mnt_idmap *idmap, +static int ramfs_nommu_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *ia) {struct inode *inode =d_inode (dentry);
fs/smb/client/cifsfs.h +1 -1
@@ -80,7 +80,7 @@ int cifs_revalidate_mapping(struct inode *inode);int cifs_zap_mapping (struct inode *inode);int cifs_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); -int cifs_setattr (struct mnt_idmap *idmap,struct dentry *direntry, +int cifs_setattr (const struct mnt_idmap *idmap,struct dentry *direntry,struct iattr *attrs);int cifs_fiemap (struct inode *inode,struct fiemap_extent_info *fei,u64 start,u64 len);
fs/smb/client/inode.c +1 -1
@@ -3549,7 +3549,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) }int -cifs_setattr (struct mnt_idmap *idmap,struct dentry *direntry, +cifs_setattr (const struct mnt_idmap *idmap,struct dentry *direntry,struct iattr *attrs) {struct cifs_sb_info *cifs_sb =CIFS_SB (direntry->d_sb);
fs/tracefs/event_inode.c +1 -1
@@ -182,7 +182,7 @@ static void update_attr(struct eventfs_attr *attr, struct iattr *iattr) } } -static int eventfs_set_attr (struct mnt_idmap *idmap,struct dentry *dentry, +static int eventfs_set_attr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {const struct eventfs_entry *entry;
fs/tracefs/inode.c +1 -1
@@ -207,7 +207,7 @@ static int tracefs_getattr(const struct mnt_idmap *idmap,return 0 ; } -static int tracefs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int tracefs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {unsigned int ia_valid = attr->ia_valid;
fs/ubifs/file.c +1 -1
@@ -1251,7 +1251,7 @@ static int do_setattr(struct ubifs_info *c, struct inode *inode,return err; } -int ubifs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ubifs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {int err;
fs/ubifs/ubifs.h +1 -1
@@ -2020,7 +2020,7 @@ int ubifs_calc_dark(const struct ubifs_info *c, int spc);/* file.c */ int ubifs_fsync (struct file *file,loff_t start,loff_t end,int datasync); -int ubifs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ubifs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);int ubifs_update_time (struct inode *inode,enum fs_update_time type,unsigned int flags);
fs/udf/file.c +1 -1
@@ -212,7 +212,7 @@ const struct file_operations udf_file_operations = { .setlease = generic_setlease, }; -static int udf_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int udf_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/ufs/inode.c +1 -1
@@ -1195,7 +1195,7 @@ static int ufs_truncate(struct inode *inode, loff_t size)return err; } -int ufs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int ufs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/ufs/ufs.h +1 -1
@@ -120,7 +120,7 @@ extern struct inode *ufs_iget(struct super_block *, unsigned long);extern int ufs_write_inode (struct inode *,struct writeback_control *);extern int ufs_sync_inode (struct inode *);extern void ufs_evict_inode (struct inode *); -extern int ufs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +extern int ufs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr);/* namei.c */
fs/vboxsf/utils.c +1 -1
@@ -258,7 +258,7 @@ int vboxsf_getattr(const struct mnt_idmap *idmap, const struct path *path,return 0 ; } -int vboxsf_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int vboxsf_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct vboxsf_inode *sf_i =VBOXSF_I (d_inode (dentry));
fs/vboxsf/vfsmod.h +1 -1
@@ -101,7 +101,7 @@ int vboxsf_inode_revalidate(struct dentry *dentry);int vboxsf_getattr (const struct mnt_idmap *idmap,const struct path *path,struct kstat *kstat,u32 request_mask,unsigned int query_flags); -int vboxsf_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int vboxsf_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr);struct shfl_string *vboxsf_path_from_dentry (struct vboxsf_sbi *sbi,struct dentry *dentry);
fs/xfs/xfs_iops.c +1 -1
@@ -1130,7 +1130,7 @@ xfs_vn_setattr_size( STATIC intxfs_vn_setattr ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {
fs/zonefs/super.c +1 -1
@@ -533,7 +533,7 @@ static int zonefs_show_options(struct seq_file *seq, struct dentry *root)return 0 ; } -static int zonefs_inode_setattr (struct mnt_idmap *idmap, +static int zonefs_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
include/linux/fs.h +3 -3
@@ -2012,7 +2012,7 @@ struct inode_operations { umode_t,dev_t);int (*rename) (const struct mnt_idmap *,struct inode *,struct dentry *,struct inode *,struct dentry *,unsigned int ); -int (*setattr) (struct mnt_idmap *,struct dentry *,struct iattr *); +int (*setattr) (const struct mnt_idmap *,struct dentry *,struct iattr *);int (*getattr) (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );ssize_t (*listxattr) (struct dentry *,char *,size_t );
@@ -2707,7 +2707,7 @@ static inline int bmap(struct inode *inode, sector_t *block) }#endif -int notify_change (struct mnt_idmap *,struct dentry *, +int notify_change (const struct mnt_idmap *,struct dentry *,struct iattr *,struct delegated_inode *);int inode_permission (const struct mnt_idmap *,struct inode *,int );int generic_permission (const struct mnt_idmap *,struct inode *,int );
@@ -3261,7 +3261,7 @@ extern int dcache_dir_open(struct inode *, struct file *);extern int dcache_dir_close (struct inode *,struct file *);extern loff_t dcache_dir_lseek (struct file *,loff_t ,int );extern int dcache_readdir (struct file *,struct dir_context *); -extern int simple_setattr (struct mnt_idmap *,struct dentry *, +extern int simple_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);extern int simple_getattr (const struct mnt_idmap *,const struct path *,struct kstat *,u32 ,unsigned int );
include/linux/lsm_hook_defs.h +2 -2
@@ -140,9 +140,9 @@ LSM_HOOK(int, 0, inode_readlink, struct dentry *dentry) LSM_HOOK(int, 0, inode_follow_link, struct dentry *dentry, struct inode *inode, bool rcu) LSM_HOOK(int, 0, inode_permission, struct inode *inode, int mask) -LSM_HOOK(int, 0, inode_setattr, struct mnt_idmap *idmap, struct dentry *dentry, +LSM_HOOK(int, 0, inode_setattr, const struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr) -LSM_HOOK(void, LSM_RET_VOID, inode_post_setattr, struct mnt_idmap *idmap, +LSM_HOOK(void, LSM_RET_VOID, inode_post_setattr, const struct mnt_idmap *idmap, struct dentry *dentry, int ia_valid) LSM_HOOK(int, 0, inode_getattr, const struct path *path) LSM_HOOK(int, 0, inode_xattr_skipcap, const char *name)
include/linux/nfs_fs.h +1 -1
@@ -450,7 +450,7 @@ extern int nfs_clear_invalid_mapping(struct address_space *mapping);extern bool nfs_mapping_need_revalidate_inode (struct inode *inode);extern int nfs_revalidate_mapping (struct inode *inode,struct address_space *mapping);extern int nfs_revalidate_mapping_rcu (struct inode *inode); -extern int nfs_setattr (struct mnt_idmap *,struct dentry *,struct iattr *); +extern int nfs_setattr (const struct mnt_idmap *,struct dentry *,struct iattr *);extern void nfs_setattr_update_inode (struct inode *inode,struct iattr *attr,struct nfs_fattr *);extern void nfs_setsecurity (struct inode *inode,struct nfs_fattr *fattr);extern struct nfs_open_context *get_nfs_open_context (struct nfs_open_context *ctx);
include/linux/security.h +4 -4
@@ -422,9 +422,9 @@ int security_inode_readlink(struct dentry *dentry);int security_inode_follow_link (struct dentry *dentry,struct inode *inode,bool rcu);int security_inode_permission (struct inode *inode,int mask); -int security_inode_setattr (struct mnt_idmap *idmap, +int security_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr); -void security_inode_post_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +void security_inode_post_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,int ia_valid);int security_inode_getattr (const struct path *path); int security_inode_setxattr(const struct mnt_idmap *idmap,
@@ -979,7 +979,7 @@ static inline int security_inode_permission(struct inode *inode, int mask)return 0 ; } -static inline int security_inode_setattr (struct mnt_idmap *idmap, +static inline int security_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {
@@ -987,7 +987,7 @@ static inline int security_inode_setattr(struct mnt_idmap *idmap, }static inline void -security_inode_post_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +security_inode_post_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,int ia_valid) { }
mm/secretmem.c +1 -1
@@ -161,7 +161,7 @@ const struct address_space_operations secretmem_aops = { .migrate_folio = secretmem_migrate_folio, }; -static int secretmem_setattr (struct mnt_idmap *idmap, +static int secretmem_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct inode *inode =d_inode (dentry);
mm/shmem.c +1 -1
@@ -1326,7 +1326,7 @@ static int shmem_getattr(const struct mnt_idmap *idmap,return 0 ; } -static int shmem_setattr (struct mnt_idmap *idmap, +static int shmem_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
net/socket.c +1 -1
@@ -670,7 +670,7 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer,return used; } -static int sockfs_setattr (struct mnt_idmap *idmap, +static int sockfs_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {int err =simple_setattr (&nop_mnt_idmap, dentry, iattr);
security/integrity/evm/evm_main.c +2 -2
@@ -956,7 +956,7 @@ static int evm_attr_change(const struct mnt_idmap *idmap,* Permit update of file attributes when files have a valid EVM signature, * except in the case of them having an immutable portable signature. */ -static int evm_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int evm_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {unsigned int ia_valid = attr->ia_valid;
@@ -1008,7 +1008,7 @@ static int evm_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,* This function is called from notify_change(), which expects the caller * to lock the inode's i_mutex. */ -static void evm_inode_post_setattr (struct mnt_idmap *idmap, +static void evm_inode_post_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,int ia_valid) {if (!evm_revalidate_status (NULL ))
security/integrity/ima/ima_appraise.c +1 -1
@@ -634,7 +634,7 @@ void ima_update_xattr(struct ima_iint_cache *iint, struct file *file)* This function is called from notify_change(), which expects the caller * to lock the inode's i_mutex. */ -static void ima_inode_post_setattr (struct mnt_idmap *idmap, +static void ima_inode_post_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,int ia_valid) {struct inode *inode =d_backing_inode (dentry);
security/security.c +2 -2
@@ -1855,7 +1855,7 @@ int security_inode_permission(struct inode *inode, int mask)* * Return: Returns 0 if permission is granted. */ -int security_inode_setattr (struct mnt_idmap *idmap, +int security_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {if (unlikely (IS_PRIVATE (d_backing_inode (dentry))))
@@ -1872,7 +1872,7 @@ EXPORT_SYMBOL_GPL(security_inode_setattr);* * Update inode security field after successful setting file attributes. */ -void security_inode_post_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +void security_inode_post_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,int ia_valid) {if (unlikely (IS_PRIVATE (d_backing_inode (dentry))))
security/selinux/hooks.c +1 -1
@@ -3297,7 +3297,7 @@ static int selinux_inode_permission(struct inode *inode, int requested)return rc; } -static int selinux_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int selinux_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {const struct cred *cred =current_cred ();
security/smack/smack_lsm.c +1 -1
@@ -1270,7 +1270,7 @@ static int smack_inode_permission(struct inode *inode, int mask)* * Returns 0 if access is permitted, an error code otherwise */ -static int smack_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int smack_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {struct smk_audit_info ad;
virt/kvm/guest_memfd.c +1 -1
@@ -506,7 +506,7 @@ static const struct address_space_operations kvm_gmem_aops = {#endif }; -static int kvm_gmem_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int kvm_gmem_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {return -EINVAL ;
Signature · 1 line
2.53.0
Casey Schaufler
maintainerRe: [PATCH 24/27] fs: port ->setattr() to pass const mnt_idmap
Quoted 119 lines · Christian Brauner
Convert to const struct
mnt_idmap.A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind
mnt_idmap_get()andmnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive.So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished.
No functional changes.
Signed-off-by Christian Brauner (Amutable) <[email protected]>--- Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 2 +- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- fs/9p/v9fs_vfs.h | 2 +- fs/9p/vfs_inode.c | 2 +- fs/9p/vfs_inode_dotl.c | 2 +- fs/adfs/adfs.h | 2 +- fs/adfs/inode.c | 2 +- fs/affs/affs.h | 2 +- fs/affs/inode.c | 2 +- fs/afs/inode.c | 2 +- fs/afs/internal.h | 2 +- fs/anon_inodes.c | 2 +- fs/attr.c | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/inode.c | 2 +- fs/ceph/super.h | 2 +- fs/coda/coda_linux.h | 2 +- fs/coda/inode.c | 2 +- fs/configfs/configfs_internal.h | 2 +- fs/configfs/inode.c | 2 +- fs/debugfs/inode.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/efivarfs/inode.c | 2 +- fs/exfat/exfat_fs.h | 2 +- fs/exfat/file.c | 2 +- fs/ext2/ext2.h | 2 +- fs/ext2/inode.c | 2 +- fs/ext4/ext4.h | 2 +- fs/ext4/inode.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- fs/fat/fat.h | 2 +- fs/fat/file.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/hfs/hfs_fs.h | 2 +- fs/hfs/inode.c | 2 +- fs/hfsplus/inode.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/hpfs_fn.h | 2 +- fs/hpfs/inode.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/inode.c | 2 +- fs/internal.h | 2 +- fs/jffs2/fs.c | 2 +- fs/jffs2/os-linux.h | 2 +- fs/jfs/file.c | 2 +- fs/jfs/jfs_inode.h | 2 +- fs/kernfs/inode.c | 2 +- fs/kernfs/kernfs-internal.h | 2 +- fs/libfs.c | 4 ++-- fs/minix/file.c | 2 +- fs/nfs/inode.c | 2 +- fs/nfs/namespace.c | 2 +- fs/nilfs2/inode.c | 2 +- fs/nilfs2/nilfs.h | 2 +- fs/ntfs/file.c | 2 +- fs/ntfs/inode.h | 2 +- fs/ntfs3/file.c | 2 +- fs/ntfs3/ntfs_fs.h | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/file.c | 2 +- fs/ocfs2/file.h | 2 +- fs/omfs/file.c | 2 +- fs/orangefs/inode.c | 2 +- fs/orangefs/orangefs-kernel.h | 2 +- fs/overlayfs/inode.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- fs/pidfs.c | 2 +- fs/proc/base.c | 2 +- fs/proc/generic.c | 2 +- fs/proc/internal.h | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/ramfs/file-nommu.c | 4 ++-- fs/smb/client/cifsfs.h | 2 +- fs/smb/client/inode.c | 2 +- fs/tracefs/event_inode.c | 2 +- fs/tracefs/inode.c | 2 +- fs/ubifs/file.c | 2 +- fs/ubifs/ubifs.h | 2 +- fs/udf/file.c | 2 +- fs/ufs/inode.c | 2 +- fs/ufs/ufs.h | 2 +- fs/vboxsf/utils.c | 2 +- fs/vboxsf/vfsmod.h | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/zonefs/super.c | 2 +- include/linux/fs.h | 6 +++--- include/linux/lsm_hook_defs.h | 4 ++-- include/linux/nfs_fs.h | 2 +- include/linux/security.h | 8 ++++---- mm/secretmem.c | 2 +- mm/shmem.c | 2 +- net/socket.c | 2 +- security/integrity/evm/evm_main.c | 4 ++-- security/integrity/ima/ima_appraise.c | 2 +- security/security.c | 4 ++-- security/selinux/hooks.c | 2 +- security/smack/smack_lsm.c | 2 +- virt/kvm/guest_memfd.c | 2 +- 102 files changed, 112 insertions(+), 112 deletions(-)
...
security/smack/smack_lsm.c static int smack_inode_permission(struct inode *inode, int mask) · line 1274
Quoted 11 lines
security/smack/smack_lsm.c +1
-1@@ -1270,7 +1270,7 @@ static int smack_inode_permission(struct inode *inode, int mask)* * Returns 0 if access is permitted, an error code otherwise */ -static int smack_inode_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int smack_inode_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr)
Please keep to 80 columns.
+static int smack_inode_setattr(const struct mnt_idmap *idmap,
+ struct dentry *dentry, struct iattr *iattr)
Note that the above may get whitespace mangled.
Quoted 3 lines
security/smack/smack_lsm.c +0
-0{struct smk_audit_info ad;