fs: port to const struct mnt_idmap
Subsystems (74)
Christian Brauner
maintainercover fs: port 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.
---
Christian Brauner (27):
userns: pass const uid_gid_map in lookup helpers
fs: port mnt_idmap_{get,put}() to const mnt_idmap
fs: port vfs{g,u}id helpers to const mnt_idmap
fs: port fs{g,u}id helpers to const mnt_idmap
fs: port i_{g,u}id_into_vfs{g,u}id() to const mnt_idmap
fs: port i_{g,u}id_{needs_}update() to const mnt_idmap
quota: port to const mnt_idmap
fs: port privilege checking helpers to const mnt_idmap
fs: port inode_owner_or_capable() to const mnt_idmap
fs: port inode_init_owner() to const mnt_idmap
fs: port acl to const mnt_idmap
fs: port ->permission() to pass const mnt_idmap
fs: port xattr to const mnt_idmap
fs: port ->fileattr_set() to pass const mnt_idmap
fs: port ->set_acl() to pass const mnt_idmap
fs: port ->get_acl() to pass const mnt_idmap
fs: port ->tmpfile() to pass const mnt_idmap
fs: port ->mknod() to pass const mnt_idmap
fs: port ->rename() to pass const mnt_idmap
fs: port ->mkdir() to pass const mnt_idmap
fs: port ->symlink() to pass const mnt_idmap
fs: port ->create() to pass const mnt_idmap
fs: port ->getattr() to pass const mnt_idmap
fs: port ->setattr() to pass const mnt_idmap
fs: port vfs_*() helpers to const mnt_idmap
fs: port mnt_idmap() and file_mnt_idmap() to const mnt_idmap
fs: make nop_mnt_idmap and invalid_mnt_idmap const
Documentation/filesystems/locking.rst | 24 +++---- Documentation/filesystems/porting.rst | 13 ++++ Documentation/filesystems/vfs.rst | 24 +++---- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- drivers/android/binder/rust_binderfs.c | 2 +- drivers/android/binderfs.c | 2 +- fs/9p/acl.c | 4 +- fs/9p/acl.h | 4 +- fs/9p/v9fs.h | 2 +- fs/9p/v9fs_vfs.h | 2 +- fs/9p/vfs_inode.c | 14 ++-- fs/9p/vfs_inode_dotl.c | 14 ++-- fs/9p/xattr.c | 2 +- fs/adfs/adfs.h | 2 +- fs/adfs/inode.c | 2 +- fs/affs/affs.h | 10 +-- fs/affs/inode.c | 2 +- fs/affs/namei.c | 8 +-- fs/afs/dir.c | 16 ++--- fs/afs/inode.c | 4 +- fs/afs/internal.h | 6 +- fs/afs/security.c | 2 +- fs/afs/xattr.c | 4 +- fs/anon_inodes.c | 4 +- fs/attr.c | 16 ++--- fs/autofs/root.c | 12 ++-- fs/backing-file.c | 2 +- fs/bad_inode.c | 20 +++--- fs/bfs/dir.c | 4 +- fs/btrfs/acl.c | 2 +- fs/btrfs/acl.h | 2 +- fs/btrfs/btrfs_inode.h | 2 +- fs/btrfs/inode.c | 24 +++---- fs/btrfs/ioctl.c | 16 ++--- fs/btrfs/ioctl.h | 2 +- fs/btrfs/xattr.c | 6 +- fs/ceph/acl.c | 2 +- fs/ceph/dir.c | 10 +-- fs/ceph/file.c | 2 +- fs/ceph/inode.c | 10 +-- fs/ceph/mds_client.h | 2 +- fs/ceph/super.h | 10 +-- fs/ceph/xattr.c | 2 +- fs/coda/coda_linux.h | 6 +- fs/coda/dir.c | 10 +-- fs/coda/inode.c | 4 +- fs/coda/pioctl.c | 4 +- fs/configfs/configfs_internal.h | 4 +- fs/configfs/dir.c | 2 +- fs/configfs/inode.c | 2 +- fs/configfs/symlink.c | 2 +- fs/coredump.c | 2 +- fs/debugfs/inode.c | 2 +- fs/ecryptfs/inode.c | 26 +++---- fs/efivarfs/inode.c | 6 +- fs/erofs/inode.c | 2 +- fs/erofs/internal.h | 2 +- fs/exec.c | 4 +- fs/exfat/exfat_fs.h | 4 +- fs/exfat/file.c | 6 +- fs/exfat/namei.c | 6 +- fs/ext2/acl.c | 2 +- fs/ext2/acl.h | 2 +- fs/ext2/ext2.h | 6 +- fs/ext2/inode.c | 4 +- fs/ext2/ioctl.c | 2 +- fs/ext2/namei.c | 12 ++-- fs/ext2/xattr_security.c | 2 +- fs/ext2/xattr_trusted.c | 2 +- fs/ext2/xattr_user.c | 2 +- fs/ext4/acl.c | 2 +- fs/ext4/acl.h | 2 +- fs/ext4/ext4.h | 10 +-- fs/ext4/ialloc.c | 2 +- fs/ext4/inode.c | 6 +- fs/ext4/ioctl.c | 6 +- fs/ext4/namei.c | 16 ++--- fs/ext4/symlink.c | 2 +- fs/ext4/xattr_hurd.c | 2 +- fs/ext4/xattr_security.c | 2 +- fs/ext4/xattr_trusted.c | 2 +- fs/ext4/xattr_user.c | 2 +- fs/f2fs/acl.c | 6 +- fs/f2fs/acl.h | 2 +- fs/f2fs/f2fs.h | 8 +-- fs/f2fs/file.c | 14 ++-- fs/f2fs/namei.c | 24 +++---- fs/f2fs/xattr.c | 4 +- fs/failfs.c | 4 +- fs/fat/fat.h | 4 +- fs/fat/file.c | 6 +- fs/fat/namei_msdos.c | 6 +- fs/fat/namei_vfat.c | 6 +- fs/fhandle.c | 2 +- fs/file_attr.c | 6 +- fs/fuse/acl.c | 4 +- fs/fuse/dir.c | 51 +++++++------- fs/fuse/file.c | 2 +- fs/fuse/fuse_i.h | 12 ++-- fs/fuse/ioctl.c | 2 +- fs/fuse/req.c | 8 ++- fs/fuse/xattr.c | 2 +- fs/gfs2/acl.c | 2 +- fs/gfs2/acl.h | 2 +- fs/gfs2/file.c | 2 +- fs/gfs2/inode.c | 16 ++--- fs/gfs2/inode.h | 4 +- fs/gfs2/xattr.c | 2 +- fs/hfs/attr.c | 2 +- fs/hfs/dir.c | 6 +- fs/hfs/hfs_fs.h | 2 +- fs/hfs/inode.c | 2 +- fs/hfsplus/dir.c | 10 +-- fs/hfsplus/hfsplus_fs.h | 4 +- fs/hfsplus/inode.c | 6 +- fs/hfsplus/xattr.c | 2 +- fs/hfsplus/xattr_security.c | 2 +- fs/hfsplus/xattr_trusted.c | 2 +- fs/hfsplus/xattr_user.c | 2 +- fs/hostfs/hostfs_kern.c | 14 ++-- fs/hpfs/hpfs_fn.h | 2 +- fs/hpfs/inode.c | 2 +- fs/hpfs/namei.c | 10 +-- fs/hugetlbfs/inode.c | 14 ++-- fs/inode.c | 12 ++-- fs/internal.h | 28 ++++---- fs/jffs2/acl.c | 2 +- fs/jffs2/acl.h | 2 +- fs/jffs2/dir.c | 20 +++--- fs/jffs2/fs.c | 2 +- fs/jffs2/os-linux.h | 2 +- fs/jffs2/security.c | 2 +- fs/jffs2/xattr_trusted.c | 2 +- fs/jffs2/xattr_user.c | 2 +- fs/jfs/acl.c | 2 +- fs/jfs/file.c | 2 +- fs/jfs/ioctl.c | 2 +- fs/jfs/jfs_acl.h | 2 +- fs/jfs/jfs_inode.h | 4 +- fs/jfs/namei.c | 10 +-- fs/jfs/xattr.c | 4 +- fs/kernfs/dir.c | 4 +- fs/kernfs/inode.c | 10 +-- fs/kernfs/kernfs-internal.h | 6 +- fs/libfs.c | 8 +-- fs/minix/file.c | 2 +- fs/minix/inode.c | 2 +- fs/minix/minix.h | 2 +- fs/minix/namei.c | 12 ++-- fs/mnt_idmapping.c | 33 +++++---- fs/namei.c | 84 +++++++++++------------ fs/namespace.c | 8 +-- fs/nfs/dir.c | 12 ++-- fs/nfs/inode.c | 4 +- fs/nfs/internal.h | 10 +-- fs/nfs/namespace.c | 4 +- fs/nfs/nfs3_fs.h | 2 +- fs/nfs/nfs3acl.c | 2 +- fs/nfs/nfs4proc.c | 10 +-- fs/nilfs2/inode.c | 4 +- fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/namei.c | 10 +-- fs/nilfs2/nilfs.h | 6 +- fs/ntfs/ea.c | 10 +-- fs/ntfs/ea.h | 6 +- fs/ntfs/file.c | 4 +- fs/ntfs/inode.h | 4 +- fs/ntfs/namei.c | 12 ++-- fs/ntfs3/file.c | 6 +- fs/ntfs3/inode.c | 2 +- fs/ntfs3/namei.c | 10 +-- fs/ntfs3/ntfs_fs.h | 16 ++--- fs/ntfs3/xattr.c | 12 ++-- fs/ocfs2/acl.c | 2 +- fs/ocfs2/acl.h | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 6 +- fs/ocfs2/file.c | 6 +- fs/ocfs2/file.h | 6 +- fs/ocfs2/ioctl.c | 2 +- fs/ocfs2/ioctl.h | 2 +- fs/ocfs2/namei.c | 10 +-- fs/ocfs2/xattr.c | 6 +- fs/omfs/dir.c | 6 +- fs/omfs/file.c | 2 +- fs/open.c | 6 +- fs/orangefs/acl.c | 2 +- fs/orangefs/inode.c | 8 +-- fs/orangefs/namei.c | 8 +-- fs/orangefs/orangefs-kernel.h | 8 +-- fs/orangefs/xattr.c | 2 +- fs/overlayfs/dir.c | 14 ++-- fs/overlayfs/file.c | 2 +- fs/overlayfs/inode.c | 16 ++--- fs/overlayfs/overlayfs.h | 14 ++-- fs/overlayfs/ovl_entry.h | 2 +- fs/overlayfs/util.c | 4 +- fs/overlayfs/xattrs.c | 4 +- fs/pidfs.c | 6 +- fs/posix_acl.c | 26 +++---- fs/proc/base.c | 10 +-- fs/proc/fd.c | 6 +- fs/proc/fd.h | 2 +- fs/proc/generic.c | 4 +- fs/proc/internal.h | 4 +- fs/proc/proc_net.c | 2 +- fs/proc/proc_sysctl.c | 6 +- fs/proc/root.c | 2 +- fs/quota/dquot.c | 2 +- fs/ramfs/file-nommu.c | 4 +- fs/ramfs/inode.c | 10 +-- fs/remap_range.c | 2 +- fs/smb/client/cifsacl.c | 4 +- fs/smb/client/cifsfs.c | 2 +- fs/smb/client/cifsfs.h | 16 ++--- fs/smb/client/cifsproto.h | 4 +- fs/smb/client/dir.c | 6 +- fs/smb/client/inode.c | 8 +-- fs/smb/client/link.c | 2 +- fs/smb/client/xattr.c | 2 +- fs/smb/server/ndr.c | 2 +- fs/smb/server/ndr.h | 2 +- fs/smb/server/oplock.c | 2 +- fs/smb/server/smb2pdu.c | 22 +++--- fs/smb/server/smb_common.c | 2 +- fs/smb/server/smbacl.c | 20 +++--- fs/smb/server/smbacl.h | 8 +-- fs/smb/server/vfs.c | 44 ++++++------ fs/smb/server/vfs.h | 28 ++++---- fs/stat.c | 4 +- fs/tracefs/event_inode.c | 2 +- fs/tracefs/inode.c | 8 +-- fs/ubifs/dir.c | 14 ++-- fs/ubifs/file.c | 4 +- fs/ubifs/ioctl.c | 2 +- fs/ubifs/ubifs.h | 6 +- fs/ubifs/xattr.c | 2 +- fs/udf/file.c | 2 +- fs/udf/namei.c | 12 ++-- fs/udf/symlink.c | 2 +- fs/ufs/inode.c | 2 +- fs/ufs/namei.c | 10 +-- fs/ufs/ufs.h | 2 +- fs/vboxsf/dir.c | 8 +-- fs/vboxsf/utils.c | 4 +- fs/vboxsf/vfsmod.h | 4 +- fs/xattr.c | 30 ++++----- fs/xfs/libxfs/xfs_inode_util.h | 2 +- fs/xfs/xfs_acl.c | 2 +- fs/xfs/xfs_acl.h | 2 +- fs/xfs/xfs_inode.c | 4 +- fs/xfs/xfs_inode.h | 2 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_ioctl.h | 2 +- fs/xfs/xfs_iops.c | 24 +++---- fs/xfs/xfs_iops.h | 2 +- fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_itable.h | 2 +- fs/xfs/xfs_symlink.c | 2 +- fs/xfs/xfs_symlink.h | 2 +- fs/xfs/xfs_xattr.c | 2 +- fs/zonefs/super.c | 2 +- include/linux/capability.h | 8 +-- include/linux/fileattr.h | 2 +- include/linux/fs.h | 108 +++++++++++++++--------------- include/linux/lsm_hook_defs.h | 24 +++---- include/linux/mnt_idmapping.h | 24 +++---- include/linux/mount.h | 4 +- include/linux/namei.h | 16 ++--- include/linux/nfs_fs.h | 6 +- include/linux/posix_acl.h | 24 +++---- include/linux/quotaops.h | 6 +- include/linux/security.h | 54 +++++++-------- include/linux/uidgid.h | 12 ++-- include/linux/xattr.h | 20 +++--- ipc/mqueue.c | 2 +- kernel/bpf/inode.c | 6 +- kernel/capability.c | 4 +- kernel/user_namespace.c | 28 ++++---- mm/secretmem.c | 2 +- mm/shmem.c | 30 ++++----- net/socket.c | 6 +- net/unix/af_unix.c | 2 +- security/apparmor/apparmorfs.c | 2 +- security/apparmor/lsm.c | 4 +- security/commoncap.c | 10 +-- security/integrity/evm/evm_main.c | 26 +++---- security/integrity/ima/ima.h | 10 +-- security/integrity/ima/ima_api.c | 2 +- security/integrity/ima/ima_appraise.c | 12 ++-- security/integrity/ima/ima_main.c | 6 +- security/integrity/ima/ima_policy.c | 4 +- security/security.c | 24 +++---- security/selinux/hooks.c | 14 ++-- security/selinux/selinuxfs.c | 2 +- security/smack/smack_lsm.c | 14 ++-- virt/kvm/guest_memfd.c | 2 +- 296 files changed, 1156 insertions(+), 1135 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260901-work-idmap-const-bafb8e12a7fa
Christian Brauner
maintainerPATCH 1/27 userns: pass const uid_gid_map in lookup helpers
map_id_down(), map_id_up() and map_id_range_up() search the extents of an idmapping and never modify it. Let all relevant helpers pass a const struct uid_gid_map. Callers can now pass pass struct mnt_idmap as const and pass down &idmap->uid_map and &idmap->gid_map.
No functional changes.
--- include/linux/uidgid.h | 12 ++++++------ kernel/user_namespace.c | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-)
include/linux/uidgid.h +6 -6
@@ -130,9 +130,9 @@ static inline bool kgid_has_mapping(struct user_namespace *ns, kgid_t gid) return from_kgid(ns, gid) != (gid_t) -1; } -u32 map_id_down (struct uid_gid_map *map,u32 id); -u32 map_id_up (struct uid_gid_map *map,u32 id); -u32 map_id_range_up (struct uid_gid_map *map,u32 id,u32 count); +u32 map_id_down (const struct uid_gid_map *map,u32 id); +u32 map_id_up (const struct uid_gid_map *map,u32 id); +u32 map_id_range_up (const struct uid_gid_map *map,u32 id,u32 count);#else
@@ -182,17 +182,17 @@ static inline bool kgid_has_mapping(struct user_namespace *ns, kgid_t gid)return gid_valid (gid); } -static inline u32 map_id_down (struct uid_gid_map *map,u32 id) +static inline u32 map_id_down (const struct uid_gid_map *map,u32 id) {return id; } -static inline u32 map_id_range_up (struct uid_gid_map *map,u32 id,u32 count) +static inline u32 map_id_range_up (const struct uid_gid_map *map,u32 id,u32 count) {return id; } -static inline u32 map_id_up (struct uid_gid_map *map,u32 id) +static inline u32 map_id_up (const struct uid_gid_map *map,u32 id) {return id; }
kernel/user_namespace.c +14 -14
@@ -278,8 +278,8 @@ static int cmp_map_id(const void *k, const void *e)* map_id_range_down_max - Find idmap via binary search in ordered idmap array. * Can only be called if number of mappings exceeds UID_GID_MAP_MAX_BASE_EXTENTS. */ -static struct uid_gid_extent * -map_id_range_down_max (unsigned extents,struct uid_gid_map *map,u32 id,u32 count) +static const struct uid_gid_extent * +map_id_range_down_max (unsigned extents,const struct uid_gid_map *map,u32 id,u32 count) {struct idmap_key key;
@@ -296,8 +296,8 @@ map_id_range_down_max(unsigned extents, struct uid_gid_map *map, u32 id, u32 cou* Can only be called if number of mappings is equal or less than * UID_GID_MAP_MAX_BASE_EXTENTS. */ -static struct uid_gid_extent * -map_id_range_down_base (unsigned extents,struct uid_gid_map *map,u32 id,u32 count) +static const struct uid_gid_extent * +map_id_range_down_base (unsigned extents,const struct uid_gid_map *map,u32 id,u32 count) {unsigned idx;u32 first, last, id2;
@@ -315,9 +315,9 @@ map_id_range_down_base(unsigned extents, struct uid_gid_map *map, u32 id, u32 coreturn NULL ; } -static u32 map_id_range_down (struct uid_gid_map *map,u32 id,u32 count) +static u32 map_id_range_down (const struct uid_gid_map *map,u32 id,u32 count) { -struct uid_gid_extent *extent; +const struct uid_gid_extent *extent;unsigned extents = map->nr_extents;smp_rmb ();
@@ -335,7 +335,7 @@ static u32 map_id_range_down(struct uid_gid_map *map, u32 id, u32 count)return id; } -u32 map_id_down (struct uid_gid_map *map,u32 id) +u32 map_id_down (const struct uid_gid_map *map,u32 id) {return map_id_range_down (map, id,1 ); }
@@ -345,8 +345,8 @@ u32 map_id_down(struct uid_gid_map *map, u32 id)* Can only be called if number of mappings is equal or less than * UID_GID_MAP_MAX_BASE_EXTENTS. */ -static struct uid_gid_extent * -map_id_range_up_base (unsigned extents,struct uid_gid_map *map,u32 id,u32 count) +static const struct uid_gid_extent * +map_id_range_up_base (unsigned extents,const struct uid_gid_map *map,u32 id,u32 count) {unsigned idx;u32 first, last, id2;
@@ -368,8 +368,8 @@ map_id_range_up_base(unsigned extents, struct uid_gid_map *map, u32 id, u32 coun* map_id_up_max - Find idmap via binary search in ordered idmap array. * Can only be called if number of mappings exceeds UID_GID_MAP_MAX_BASE_EXTENTS. */ -static struct uid_gid_extent * -map_id_range_up_max (unsigned extents,struct uid_gid_map *map,u32 id,u32 count) +static const struct uid_gid_extent * +map_id_range_up_max (unsigned extents,const struct uid_gid_map *map,u32 id,u32 count) {struct idmap_key key;
@@ -381,9 +381,9 @@ map_id_range_up_max(unsigned extents, struct uid_gid_map *map, u32 id, u32 count sizeof(struct uid_gid_extent), cmp_map_id); } -u32 map_id_range_up (struct uid_gid_map *map,u32 id,u32 count) +u32 map_id_range_up (const struct uid_gid_map *map,u32 id,u32 count) { -struct uid_gid_extent *extent; +const struct uid_gid_extent *extent;unsigned extents = map->nr_extents;smp_rmb ();
@@ -401,7 +401,7 @@ u32 map_id_range_up(struct uid_gid_map *map, u32 id, u32 count)return id; } -u32 map_id_up (struct uid_gid_map *map,u32 id) +u32 map_id_up (const struct uid_gid_map *map,u32 id) {return map_id_range_up (map, id,1 ); }
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 2/27 fs: port mnt_idmap_{get,put}() to const mnt_idmap
In reply to Christian Braunerstruct mnt_idmap is immutable once alloc_mnt_idmap() has set it up. The only thing that changes afterwards is the reference count. Model mnt_idmap_{get,put}() after struct cred's reference count handling and take a const pointer.
This model is forced upon us because ceph stores the idmapping in mds requests and need to be able to take and put references.
mnt_idmap_get() keeps returning a non-const pointer for now because struct vfsmount still stores a non-const pointer. We can only change that at the end of the series once every user of mnt_idmap() has been ported.
--- fs/internal.h | 4 ++-- fs/mnt_idmapping.c | 16 ++++++++++------ include/linux/mnt_idmapping.h | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-)
fs/internal.h +2 -2
@@ -327,8 +327,8 @@ ssize_t __kernel_write_iter(struct file *file, struct iov_iter *from, loff_t *po* fs/attr.c */ struct mnt_idmap *alloc_mnt_idmap (struct user_namespace *mnt_userns); -struct mnt_idmap *mnt_idmap_get (struct mnt_idmap *idmap); -void mnt_idmap_put (struct mnt_idmap *idmap); +struct mnt_idmap *mnt_idmap_get (const struct mnt_idmap *idmap); +void mnt_idmap_put (const struct mnt_idmap *idmap);struct stashed_operations {struct dentry *(*stash_dentry)(struct dentry **stashed,struct dentry *dentry);
fs/mnt_idmapping.c +10 -6
@@ -312,12 +312,14 @@ struct mnt_idmap *alloc_mnt_idmap(struct user_namespace *mnt_userns)* * Return: @idmap with reference count bumped if @not_mnt_idmap isn't passed. */ -struct mnt_idmap *mnt_idmap_get (struct mnt_idmap *idmap) +struct mnt_idmap *mnt_idmap_get (const struct mnt_idmap *idmap) { +struct mnt_idmap *nonconst_idmap = (struct mnt_idmap *)idmap; +if (idmap != &nop_mnt_idmap && idmap != &invalid_mnt_idmap) -refcount_inc (&idmap->count); +refcount_inc (&nonconst_idmap->count); -return idmap; +return nonconst_idmap; }EXPORT_SYMBOL_GPL (mnt_idmap_get);
@@ -328,11 +330,13 @@ EXPORT_SYMBOL_GPL(mnt_idmap_get);* If this is a non-initial idmapping, put the reference count when a mount is * released and free it if we're the last user. */ -void mnt_idmap_put (struct mnt_idmap *idmap) +void mnt_idmap_put (const struct mnt_idmap *idmap) { +struct mnt_idmap *nonconst_idmap = (struct mnt_idmap *)idmap; +if (idmap != &nop_mnt_idmap && idmap != &invalid_mnt_idmap && -refcount_dec_and_test (&idmap->count)) -free_mnt_idmap (idmap); +refcount_dec_and_test (&nonconst_idmap->count)) +free_mnt_idmap (nonconst_idmap); }EXPORT_SYMBOL_GPL (mnt_idmap_put);
include/linux/mnt_idmapping.h +2 -2
@@ -121,8 +121,8 @@ static inline bool vfsgid_eq_kgid(vfsgid_t vfsgid, kgid_t kgid)int vfsgid_in_group_p (vfsgid_t vfsgid); -struct mnt_idmap *mnt_idmap_get (struct mnt_idmap *idmap); -void mnt_idmap_put (struct mnt_idmap *idmap); +struct mnt_idmap *mnt_idmap_get (const struct mnt_idmap *idmap); +void mnt_idmap_put (const struct mnt_idmap *idmap);vfsuid_t make_vfsuid (struct mnt_idmap *idmap,struct user_namespace *fs_userns,kuid_t kuid);
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 3/27 fs: port vfs{g,u}id helpers to 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.
--- fs/ceph/inode.c | 2 +- fs/ceph/super.h | 2 +- fs/fuse/dir.c | 12 ++++++------ fs/internal.h | 2 +- fs/mnt_idmapping.c | 15 ++++++++------- fs/overlayfs/inode.c | 4 ++-- fs/overlayfs/overlayfs.h | 2 +- fs/posix_acl.c | 2 +- fs/smb/server/smbacl.c | 14 +++++++------- fs/smb/server/smbacl.h | 8 ++++---- fs/smb/server/vfs.c | 4 ++-- fs/smb/server/vfs.h | 2 +- include/linux/mnt_idmapping.h | 12 ++++++------ security/integrity/evm/evm_main.c | 4 ++-- 14 files changed, 43 insertions(+), 42 deletions(-)
fs/ceph/inode.c +1 -1
@@ -2568,7 +2568,7 @@ static int fill_fscrypt_truncate(struct inode *inode,return ret; } -int __ceph_setattr (struct mnt_idmap *idmap,struct inode *inode, +int __ceph_setattr (const struct mnt_idmap *idmap,struct inode *inode,struct iattr *attr,struct ceph_iattr *cia) {struct ceph_inode_info *ci =ceph_inode (inode);
fs/ceph/super.h +1 -1
@@ -1173,7 +1173,7 @@ struct ceph_iattr {struct ceph_fscrypt_auth *fscrypt_auth; }; -extern int __ceph_setattr (struct mnt_idmap *idmap,struct inode *inode, +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);
fs/fuse/dir.c +6 -6
@@ -751,7 +751,7 @@ static u32 fuse_ext_size(size_t size)/* * This adds just a single supplementary group that matches the parent's group. */ -static int get_create_supp_group (struct mnt_idmap *idmap, +static int get_create_supp_group (const struct mnt_idmap *idmap,struct inode *dir,struct fuse_in_arg *ext) {
@@ -782,7 +782,7 @@ static int get_create_supp_group(struct mnt_idmap *idmap,return 0 ; } -static int get_create_ext (struct mnt_idmap *idmap, +static int get_create_ext (const struct mnt_idmap *idmap,struct fuse_args *args,struct inode *dir,struct dentry *dentry,umode_t mode)
@@ -1375,7 +1375,7 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,return err; } -static void fuse_fillattr (struct mnt_idmap *idmap,struct inode *inode, +static void fuse_fillattr (const struct mnt_idmap *idmap,struct inode *inode,struct fuse_attr *attr,struct kstat *stat) {unsigned int blkbits;
@@ -1429,7 +1429,7 @@ static void fuse_statx_to_attr(struct fuse_statx *sx, struct fuse_attr *attr) attr->blksize = sx->blksize; } -static int fuse_do_statx (struct mnt_idmap *idmap,struct inode *inode, +static int fuse_do_statx (const struct mnt_idmap *idmap,struct inode *inode,struct file *file,struct kstat *stat) {int err;
@@ -1490,7 +1490,7 @@ static int fuse_do_statx(struct mnt_idmap *idmap, struct inode *inode,return 0 ; } -static int fuse_do_getattr (struct mnt_idmap *idmap,struct inode *inode, +static int fuse_do_getattr (const struct mnt_idmap *idmap,struct inode *inode,struct kstat *stat,struct file *file) {int err;
@@ -2000,7 +2000,7 @@ static bool update_mtime(unsigned ivalid, bool trust_local_mtime)return true; } -static void iattr_to_fattr (struct mnt_idmap *idmap,struct fuse_conn *fc, +static void iattr_to_fattr (const struct mnt_idmap *idmap,struct fuse_conn *fc,struct iattr *iattr,struct fuse_setattr_in *arg,bool trust_local_cmtime) {
fs/internal.h +1 -1
@@ -354,7 +354,7 @@ static inline bool path_mounted(const struct path *path) }void file_f_owner_release (struct file *file);bool file_seek_cur_needs_f_lock (struct file *file); -int statmount_mnt_idmap (struct mnt_idmap *idmap,struct seq_file *seq,bool uid_map); +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, struct kstat *stat, u32 request_mask,
fs/mnt_idmapping.c +8 -7
@@ -77,7 +77,7 @@ static inline bool initial_idmapping(const struct user_namespace *ns)* returned. */ -vfsuid_t make_vfsuid (struct mnt_idmap *idmap, +vfsuid_t make_vfsuid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,kuid_t kuid) {
@@ -117,7 +117,7 @@ EXPORT_SYMBOL_GPL(make_vfsuid);* If @kgid has no mapping in either @idmap or @fs_userns INVALID_GID is * returned. */ -vfsgid_t make_vfsgid (struct mnt_idmap *idmap, +vfsgid_t make_vfsgid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,kgid_t kgid) {gid_t gid;
@@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(make_vfsgid);* * Return: @vfsuid mapped into the filesystem idmapping */ -kuid_t from_vfsuid (struct mnt_idmap *idmap, +kuid_t from_vfsuid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,vfsuid_t vfsuid) {uid_t uid;
@@ -176,7 +176,7 @@ EXPORT_SYMBOL_GPL(from_vfsuid);* * Return: @vfsgid mapped into the filesystem idmapping */ -kgid_t from_vfsgid (struct mnt_idmap *idmap, +kgid_t from_vfsgid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,vfsgid_t vfsgid) {gid_t gid;
@@ -340,9 +340,10 @@ void mnt_idmap_put(const struct mnt_idmap *idmap) }EXPORT_SYMBOL_GPL (mnt_idmap_put); -int statmount_mnt_idmap (struct mnt_idmap *idmap,struct seq_file *seq,bool uid_map) +int statmount_mnt_idmap (const struct mnt_idmap *idmap,struct seq_file *seq,bool uid_map) { -struct uid_gid_map *map, *map_up; +const struct uid_gid_map *map; +struct uid_gid_map *map_up;u32 idx, nr_mappings;if (!is_valid_mnt_idmap (idmap))
@@ -362,7 +363,7 @@ int statmount_mnt_idmap(struct mnt_idmap *idmap, struct seq_file *seq, bool uid_for (idx =0 , nr_mappings =0 ; idx < map->nr_extents; idx++) {uid_t lower; -struct uid_gid_extent *extent; +const struct uid_gid_extent *extent;if (map->nr_extents <=UID_GID_MAP_MAX_BASE_EXTENTS ) extent = &map->extent[idx];
fs/overlayfs/inode.c +2 -2
@@ -355,7 +355,7 @@ static const char *ovl_get_link(struct dentry *dentry,* alter the POSIX ACLs for the underlying filesystem. */ static void ovl_idmap_posix_acl (const struct inode *realinode, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct posix_acl *acl) {struct user_namespace *fs_userns =i_user_ns (realinode);
@@ -447,7 +447,7 @@ struct posix_acl *ovl_get_acl_path(const struct path *path,* * This is obviously only relevant when idmapped layers are used. */ -struct posix_acl *do_ovl_get_acl (struct mnt_idmap *idmap, +struct posix_acl *do_ovl_get_acl (const struct mnt_idmap *idmap,struct inode *inode,int type,bool rcu,bool noperm) {
fs/overlayfs/overlayfs.h +1 -1
@@ -806,7 +806,7 @@ int ovl_permission(struct mnt_idmap *idmap, struct inode *inode, int mask);#ifdef CONFIG_FS_POSIX_ACL -struct posix_acl *do_ovl_get_acl (struct mnt_idmap *idmap, +struct posix_acl *do_ovl_get_acl (const struct mnt_idmap *idmap,struct inode *inode,int type,bool rcu,bool noperm); static inline struct posix_acl *ovl_get_inode_acl(struct inode *inode, int type,
fs/posix_acl.c +1 -1
@@ -1057,7 +1057,7 @@ int simple_acl_create(struct inode *dir, struct inode *inode)return 0 ; } -static int vfs_set_acl_idmapped_mnt (struct mnt_idmap *idmap, +static int vfs_set_acl_idmapped_mnt (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,struct posix_acl *acl) {
fs/smb/server/smbacl.c +7 -7
@@ -257,7 +257,7 @@ void id_to_sid(unsigned int cid, uint sidtype, struct smb_sid *ssid) ssid->num_subauth++; } -static int sid_to_id (struct mnt_idmap *idmap, +static int sid_to_id (const struct mnt_idmap *idmap,struct smb_sid *psid,uint sidtype,struct smb_fattr *fattr) {
@@ -383,7 +383,7 @@ void free_acl_state(struct posix_acl_state *state)kfree (state->groups); } -static void parse_dacl (struct mnt_idmap *idmap, +static void parse_dacl (const struct mnt_idmap *idmap,struct smb_acl *pdacl,char *end_of_acl,struct smb_sid *pownersid,struct smb_sid *pgrpsid,struct smb_fattr *fattr)
@@ -608,7 +608,7 @@ static void parse_dacl(struct mnt_idmap *idmap,free_acl_state (&default_acl_state); } -static void set_posix_acl_entries_dacl(struct mnt_idmap *idmap, +static void set_posix_acl_entries_dacl(const struct mnt_idmap *idmap, struct smb_ace *pndace, struct smb_fattr *fattr, u16 *num_aces, u16 *size, u16 existing_nt_aces,
@@ -739,7 +739,7 @@ static void set_posix_acl_entries_dacl(struct mnt_idmap *idmap, } } -static void set_ntacl_dacl(struct mnt_idmap *idmap, +static void set_ntacl_dacl(const struct mnt_idmap *idmap, struct smb_acl *pndacl, struct smb_acl *nt_dacl, unsigned int aces_size,
@@ -798,7 +798,7 @@ static void set_ntacl_dacl(struct mnt_idmap *idmap, pndacl->size =cpu_to_le16 (le16_to_cpu (pndacl->size) + size); } -static void set_mode_dacl (struct mnt_idmap *idmap, +static void set_mode_dacl (const struct mnt_idmap *idmap,struct smb_acl *pndacl,struct smb_fattr *fattr) {struct smb_ace *pace, *pndace;
@@ -884,7 +884,7 @@ static int parse_sid(struct smb_sid *psid, char *end_of_acl) }/* Convert CIFS ACL to POSIX form */ -int parse_sec_desc (struct mnt_idmap *idmap,struct smb_ntsd *pntsd, +int parse_sec_desc (const struct mnt_idmap *idmap,struct smb_ntsd *pntsd,int acl_len,struct smb_fattr *fattr) {int rc =0 ;
@@ -1017,7 +1017,7 @@ size_t smb_acl_sec_desc_scratch_len(struct smb_fattr *fattr, }/* Convert permission bits from mode to equivalent CIFS ACL */ -int build_sec_desc (struct mnt_idmap *idmap, +int build_sec_desc (const struct mnt_idmap *idmap,struct smb_ntsd *pntsd,struct smb_ntsd *ppntsd,int ppntsd_size,int addition_info,__u32 *secdesclen,struct smb_fattr *fattr)
fs/smb/server/smbacl.h +4 -4
@@ -81,9 +81,9 @@ struct posix_acl_state {struct posix_ace_state_array *groups; }; -int parse_sec_desc (struct mnt_idmap *idmap,struct smb_ntsd *pntsd, +int parse_sec_desc (const struct mnt_idmap *idmap,struct smb_ntsd *pntsd,int acl_len,struct smb_fattr *fattr); -int build_sec_desc (struct mnt_idmap *idmap,struct smb_ntsd *pntsd, +int build_sec_desc (const struct mnt_idmap *idmap,struct smb_ntsd *pntsd,struct smb_ntsd *ppntsd,int ppntsd_size,int addition_info,__u32 *secdesclen,struct smb_fattr *fattr);int init_acl_state (struct posix_acl_state *state,u16 cnt);
@@ -105,7 +105,7 @@ void ksmbd_init_domain(u32 *sub_auth);size_t smb_acl_sec_desc_scratch_len (struct smb_fattr *fattr,struct smb_ntsd *ppntsd,int ppntsd_size,int addition_info); -static inline uid_t posix_acl_uid_translate (struct mnt_idmap *idmap, +static inline uid_t posix_acl_uid_translate (const struct mnt_idmap *idmap,struct posix_acl_entry *pace) {vfsuid_t vfsuid;
@@ -117,7 +117,7 @@ static inline uid_t posix_acl_uid_translate(struct mnt_idmap *idmap,return from_kuid (&init_user_ns,vfsuid_into_kuid (vfsuid)); } -static inline gid_t posix_acl_gid_translate (struct mnt_idmap *idmap, +static inline gid_t posix_acl_gid_translate (const struct mnt_idmap *idmap,struct posix_acl_entry *pace) {vfsgid_t vfsgid;
fs/smb/server/vfs.c +2 -2
@@ -1540,7 +1540,7 @@ int ksmbd_vfs_remove_sd_xattrs(struct mnt_idmap *idmap, const struct path *path)return err; } -static struct xattr_smb_acl *ksmbd_vfs_make_xattr_posix_acl (struct mnt_idmap *idmap, +static struct xattr_smb_acl *ksmbd_vfs_make_xattr_posix_acl (const struct mnt_idmap *idmap,struct inode *inode,int acl_type) {
@@ -2253,7 +2253,7 @@ int ksmbd_vfs_set_init_posix_acl(struct mnt_idmap *idmap,return rc; } -int ksmbd_vfs_inherit_posix_acl (struct mnt_idmap *idmap, +int ksmbd_vfs_inherit_posix_acl (const struct mnt_idmap *idmap,const struct path *path,struct inode *parent_inode) {struct posix_acl *acls;
fs/smb/server/vfs.h +1 -1
@@ -173,7 +173,7 @@ int ksmbd_vfs_get_dos_attrib_xattr(struct mnt_idmap *idmap, struct xattr_dos_attrib *da);int ksmbd_vfs_set_init_posix_acl (struct mnt_idmap *idmap,const struct path *path); -int ksmbd_vfs_inherit_posix_acl (struct mnt_idmap *idmap, +int ksmbd_vfs_inherit_posix_acl (const struct mnt_idmap *idmap,const struct path *path,struct inode *parent_inode);void ksmbd_vfs_update_compressed_fattr (struct dentry *dentry,__le32 *fattr);
include/linux/mnt_idmapping.h +6 -6
@@ -124,16 +124,16 @@ int vfsgid_in_group_p(vfsgid_t vfsgid);struct mnt_idmap *mnt_idmap_get (const struct mnt_idmap *idmap);void mnt_idmap_put (const struct mnt_idmap *idmap); -vfsuid_t make_vfsuid (struct mnt_idmap *idmap, +vfsuid_t make_vfsuid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,kuid_t kuid); -vfsgid_t make_vfsgid (struct mnt_idmap *idmap, +vfsgid_t make_vfsgid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,kgid_t kgid); -kuid_t from_vfsuid (struct mnt_idmap *idmap, +kuid_t from_vfsuid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,vfsuid_t vfsuid); -kgid_t from_vfsgid (struct mnt_idmap *idmap, +kgid_t from_vfsgid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,vfsgid_t vfsgid);/**
@@ -148,7 +148,7 @@ kgid_t from_vfsgid(struct mnt_idmap *idmap,* * Return: true if @vfsuid has a mapping in the filesystem, false if not. */ -static inline bool vfsuid_has_fsmapping (struct mnt_idmap *idmap, +static inline bool vfsuid_has_fsmapping (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,vfsuid_t vfsuid) {
@@ -186,7 +186,7 @@ static inline kuid_t vfsuid_into_kuid(vfsuid_t vfsuid)* * Return: true if @vfsgid has a mapping in the filesystem, false if not. */ -static inline bool vfsgid_has_fsmapping (struct mnt_idmap *idmap, +static inline bool vfsgid_has_fsmapping (const struct mnt_idmap *idmap,struct user_namespace *fs_userns,vfsgid_t vfsgid) {
security/integrity/evm/evm_main.c +2 -2
@@ -481,7 +481,7 @@ static enum integrity_status evm_verify_current_integrity(struct dentry *dentry)* * Returns 1 if passed xattr value differs from current value, 0 otherwise. */ -static int evm_xattr_change (struct mnt_idmap *idmap, +static int evm_xattr_change (const struct mnt_idmap *idmap,struct dentry *dentry,const char *xattr_name,const void *xattr_value,size_t xattr_value_len) {
@@ -517,7 +517,7 @@ static int evm_xattr_change(struct mnt_idmap *idmap,* For posix xattr acls only, permit security.evm, even if it currently * doesn't exist, to be updated unless the EVM signature is immutable. */ -static int evm_protect_xattr (struct mnt_idmap *idmap, +static int evm_protect_xattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *xattr_name,const void *xattr_value,size_t xattr_value_len) {
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 4/27 fs: port fs{g,u}id helpers to 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.
--- fs/ceph/mds_client.h | 2 +- fs/fuse/dir.c | 13 +++++++------ fs/fuse/fuse_i.h | 4 ++-- fs/fuse/req.c | 8 +++++--- include/linux/fs.h | 6 +++--- include/linux/mnt_idmapping.h | 4 ++-- 6 files changed, 20 insertions(+), 17 deletions(-)
fs/ceph/mds_client.h +1 -1
@@ -375,7 +375,7 @@ struct ceph_mds_request {int r_fmode;/* file mode, if expecting cap */ int r_request_release_offset;const struct cred *r_cred; -struct mnt_idmap *r_mnt_idmap; +const struct mnt_idmap *r_mnt_idmap;struct timespec64 r_stamp;/* for choosing which mds to send this request to */
fs/fuse/dir.c +7 -6
@@ -820,7 +820,7 @@ static void free_ext_value(struct fuse_args *args)* If the filesystem doesn't support this, then fall back to separate * 'mknod' + 'open' requests. */ -static int fuse_create_open (struct mnt_idmap *idmap,struct inode *dir, +static int fuse_create_open (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *entry,struct file *file,unsigned int flags,umode_t mode,u32 opcode) {
@@ -980,7 +980,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,/* * Code shared between mknod, mkdir, symlink and link */ -static struct dentry *create_new_entry (struct mnt_idmap *idmap,struct fuse_mount *fm, +static struct dentry *create_new_entry (const struct mnt_idmap *idmap,struct fuse_mount *fm,struct fuse_args *args,struct inode *dir,struct dentry *entry,umode_t mode) {
@@ -1053,7 +1053,7 @@ static struct dentry *create_new_entry(struct mnt_idmap *idmap, struct fuse_mounreturn ERR_PTR (err); } -static int create_new_nondir (struct mnt_idmap *idmap,struct fuse_mount *fm, +static int create_new_nondir (const struct mnt_idmap *idmap,struct fuse_mount *fm,struct fuse_args *args,struct inode *dir,struct dentry *entry,umode_t mode) {
@@ -1256,9 +1256,10 @@ static int fuse_rmdir(struct inode *dir, struct dentry *entry)return err; } -static int fuse_rename_common (struct mnt_idmap *idmap,struct inode *olddir,struct dentry *oldent, -struct inode *newdir,struct dentry *newent, -unsigned int flags,int opcode,size_t argsize) +static int fuse_rename_common (const struct mnt_idmap *idmap,struct inode *olddir, +struct dentry *oldent,struct inode *newdir, +struct dentry *newent,unsigned int flags, +int opcode,size_t argsize) {int err;struct fuse_rename2_in inarg;
fs/fuse/fuse_i.h +2 -2
@@ -1003,7 +1003,7 @@ void __exit fuse_ctl_cleanup(void);/* * Simple request sending that does request allocation and freeing */ -ssize_t __fuse_simple_request (struct mnt_idmap *idmap, +ssize_t __fuse_simple_request (const struct mnt_idmap *idmap,struct fuse_mount *fm,struct fuse_args *args);
@@ -1012,7 +1012,7 @@ static inline ssize_t fuse_simple_request(struct fuse_mount *fm, struct fuse_argreturn __fuse_simple_request (&invalid_mnt_idmap, fm, args); } -static inline ssize_t fuse_simple_idmap_request (struct mnt_idmap *idmap, +static inline ssize_t fuse_simple_idmap_request (const struct mnt_idmap *idmap,struct fuse_mount *fm,struct fuse_args *args) {
fs/fuse/req.c +5 -3
@@ -3,7 +3,8 @@#include "dev.h" #include "fuse_i.h" -static int fuse_fill_creds (struct fuse_mount *fm,struct fuse_args *args,struct mnt_idmap *idmap) +static int fuse_fill_creds (struct fuse_mount *fm,struct fuse_args *args, +const struct mnt_idmap *idmap) {struct fuse_conn *fc = fm->fc;bool no_idmap = !fm->sb || (fm->sb->s_iflags &SB_I_NOIDMAP );
@@ -49,7 +50,8 @@ static int fuse_fill_creds(struct fuse_mount *fm, struct fuse_args *args, structreturn 0 ; } -static int fuse_req_prep (struct fuse_mount *fm,struct fuse_args *args,struct mnt_idmap *idmap) +static int fuse_req_prep (struct fuse_mount *fm,struct fuse_args *args, +const struct mnt_idmap *idmap) {if (!args->force && fm->fc->conn_error)return -ECONNREFUSED ;
@@ -57,7 +59,7 @@ static int fuse_req_prep(struct fuse_mount *fm, struct fuse_args *args, struct mreturn fuse_fill_creds (fm, args, idmap); } -ssize_t __fuse_simple_request (struct mnt_idmap *idmap,struct fuse_mount *fm, +ssize_t __fuse_simple_request (const struct mnt_idmap *idmap,struct fuse_mount *fm,struct fuse_args *args) {struct fuse_conn *fc = fm->fc;
include/linux/fs.h +3 -3
@@ -1544,7 +1544,7 @@ static inline void i_gid_update(struct mnt_idmap *idmap,* an idmapped mount map the caller's fsuid according to @idmap. */ static inline void inode_fsuid_set (struct inode *inode, -struct mnt_idmap *idmap) +const struct mnt_idmap *idmap) { inode->i_uid =mapped_fsuid (idmap,i_user_ns (inode)); }
@@ -1558,7 +1558,7 @@ static inline void inode_fsuid_set(struct inode *inode,* an idmapped mount map the caller's fsgid according to @idmap. */ static inline void inode_fsgid_set (struct inode *inode, -struct mnt_idmap *idmap) +const struct mnt_idmap *idmap) { inode->i_gid =mapped_fsgid (idmap,i_user_ns (inode)); }
@@ -1575,7 +1575,7 @@ static inline void inode_fsgid_set(struct inode *inode,* Return: true if fsuid and fsgid is mapped, false if not. */ static inline bool fsuidgid_has_mapping (struct super_block *sb, -struct mnt_idmap *idmap) +const struct mnt_idmap *idmap) {struct user_namespace *fs_userns = sb->s_user_ns;kuid_t kuid;
include/linux/mnt_idmapping.h +2 -2
@@ -225,7 +225,7 @@ static inline kgid_t vfsgid_into_kgid(vfsgid_t vfsgid)* * Return: the caller's current fsuid mapped up according to @idmap. */ -static inline kuid_t mapped_fsuid (struct mnt_idmap *idmap, +static inline kuid_t mapped_fsuid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns) {return from_vfsuid (idmap, fs_userns,VFSUIDT_INIT (current_fsuid ()));
@@ -244,7 +244,7 @@ static inline kuid_t mapped_fsuid(struct mnt_idmap *idmap,* * Return: the caller's current fsgid mapped up according to @idmap. */ -static inline kgid_t mapped_fsgid (struct mnt_idmap *idmap, +static inline kgid_t mapped_fsgid (const struct mnt_idmap *idmap,struct user_namespace *fs_userns) {return from_vfsgid (idmap, fs_userns,VFSGIDT_INIT (current_fsgid ()));
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 5/27 fs: port i_{g,u}id_into_vfs{g,u}id() to 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.
--- fs/exfat/file.c | 2 +- fs/fat/file.c | 2 +- fs/internal.h | 2 +- fs/namei.c | 2 +- fs/smb/server/ndr.c | 2 +- fs/smb/server/ndr.h | 2 +- fs/smb/server/smb2pdu.c | 2 +- fs/xattr.c | 2 +- fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_itable.h | 2 +- include/linux/fs.h | 6 +++--- security/integrity/ima/ima.h | 10 +++++----- security/integrity/ima/ima_api.c | 2 +- security/integrity/ima/ima_appraise.c | 2 +- security/integrity/ima/ima_main.c | 2 +- security/integrity/ima/ima_policy.c | 4 ++-- 16 files changed, 23 insertions(+), 23 deletions(-)
fs/exfat/file.c +1 -1
@@ -143,7 +143,7 @@ static long exfat_fallocate(struct file *file, int mode,return err; } -static bool exfat_allow_set_time (struct mnt_idmap *idmap, +static bool exfat_allow_set_time (const struct mnt_idmap *idmap,struct exfat_sb_info *sbi,struct inode *inode) {mode_t allow_utime = sbi->options.allow_utime;
fs/fat/file.c +1 -1
@@ -493,7 +493,7 @@ static int fat_sanitize_mode(const struct msdos_sb_info *sbi,return 0 ; } -static int fat_allow_set_time (struct mnt_idmap *idmap, +static int fat_allow_set_time (const struct mnt_idmap *idmap,struct msdos_sb_info *sbi,struct inode *inode) {umode_t allow_utime = sbi->options.allow_utime;
fs/internal.h +1 -1
@@ -299,7 +299,7 @@ int filename_setxattr(int dfd, struct filename *filename,int setxattr_copy (const char __user *name,struct kernel_xattr_ctx *ctx);int import_xattr_name (struct xattr_name *kname,const char __user *name); -int may_write_xattr (struct mnt_idmap *idmap,struct inode *inode); +int may_write_xattr (const struct mnt_idmap *idmap,struct inode *inode);#ifdef CONFIG_FS_POSIX_ACL int do_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
fs/namei.c +1 -1
@@ -1407,7 +1407,7 @@ int may_linkat(struct mnt_idmap *idmap, const struct path *link)* * Returns 0 if the open is allowed, -ve on error. */ -static int may_create_in_sticky (struct mnt_idmap *idmap,struct nameidata *nd, +static int may_create_in_sticky (const struct mnt_idmap *idmap,struct nameidata *nd,struct inode *const inode) {umode_t dir_mode = nd->dir_mode;
fs/smb/server/ndr.c +1 -1
@@ -338,7 +338,7 @@ static int ndr_encode_posix_acl_entry(struct ndr *n, struct xattr_smb_acl *acl) }int ndr_encode_posix_acl (struct ndr *n, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *inode,struct xattr_smb_acl *acl,struct xattr_smb_acl *def_acl)
fs/smb/server/ndr.h +1 -1
@@ -14,7 +14,7 @@ struct ndr {int ndr_encode_dos_attr (struct ndr *n,struct xattr_dos_attrib *da);int ndr_decode_dos_attr (struct ndr *n,struct xattr_dos_attrib *da); -int ndr_encode_posix_acl (struct ndr *n,struct mnt_idmap *idmap, +int ndr_encode_posix_acl (struct ndr *n,const struct mnt_idmap *idmap,struct inode *inode,struct xattr_smb_acl *acl,struct xattr_smb_acl *def_acl);int ndr_encode_v4_ntacl (struct ndr *n,struct xattr_ntacl *acl);
fs/smb/server/smb2pdu.c +1 -1
@@ -3604,7 +3604,7 @@ static int smb2_create_sd_buffer(struct ksmbd_work *work, }static void ksmbd_acls_fattr (struct smb_fattr *fattr, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *inode) {vfsuid_t vfsuid =i_uid_into_vfsuid (idmap, inode);
fs/xattr.c +1 -1
@@ -100,7 +100,7 @@ xattr_resolve_name(struct inode *inode, const char **name)* * Return: On success zero is returned. On error a negative errno is returned. */ -int may_write_xattr (struct mnt_idmap *idmap,struct inode *inode) +int may_write_xattr (const struct mnt_idmap *idmap,struct inode *inode) {if (IS_IMMUTABLE (inode))return -EPERM ;
fs/xfs/xfs_itable.c +1 -1
@@ -63,7 +63,7 @@ want_metadir_file( STATIC intxfs_bulkstat_one_int (struct xfs_mount *mp, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct xfs_trans *tp,xfs_ino_t ino,struct xfs_bstat_chunk *bc)
fs/xfs/xfs_itable.h +1 -1
@@ -8,7 +8,7 @@/* In-memory representation of a userspace request for batch inode data. */ struct xfs_ibulk {struct xfs_mount *mp; -struct mnt_idmap *idmap; +const struct mnt_idmap *idmap;void __user *ubuffer;/* user output buffer */ xfs_ino_t startino;/* start with this inode */ unsigned int icount;/* number of elements in ubuffer */
include/linux/fs.h +3 -3
@@ -1439,7 +1439,7 @@ static inline void i_gid_write(struct inode *inode, gid_t gid)* Return: whe inode's i_uid mapped down according to @idmap. * If the inode's i_uid has no mapping INVALID_VFSUID is returned. */ -static inline vfsuid_t i_uid_into_vfsuid (struct mnt_idmap *idmap, +static inline vfsuid_t i_uid_into_vfsuid (const struct mnt_idmap *idmap,const struct inode *inode) {return make_vfsuid (idmap,i_user_ns (inode), inode->i_uid);
@@ -1491,7 +1491,7 @@ static inline void i_uid_update(struct mnt_idmap *idmap,* Return: the inode's i_gid mapped down according to @idmap. * If the inode's i_gid has no mapping INVALID_VFSGID is returned. */ -static inline vfsgid_t i_gid_into_vfsgid (struct mnt_idmap *idmap, +static inline vfsgid_t i_gid_into_vfsgid (const struct mnt_idmap *idmap,const struct inode *inode) {return make_vfsgid (idmap,i_user_ns (inode), inode->i_gid);
@@ -2173,7 +2173,7 @@ extern loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, (inode)->i_rdev == WHITEOUT_DEV)#define IS_ANON_FILE (inode) ((inode)->i_flags & S_ANON_INODE) -static inline bool HAS_UNMAPPED_ID (struct mnt_idmap *idmap, +static inline bool HAS_UNMAPPED_ID (const struct mnt_idmap *idmap,struct inode *inode) { return !vfsuid_valid(i_uid_into_vfsuid(idmap, inode)) ||
security/integrity/ima/ima.h +5 -5
@@ -423,7 +423,7 @@ static inline void ima_process_queued_keys(void) {}#endif /* CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS */ /* LIM API function definitions */ -int ima_get_action(struct mnt_idmap *idmap, struct inode *inode, +int ima_get_action(const struct mnt_idmap *idmap, struct inode *inode, const struct cred *cred, struct lsm_prop *prop, int mask, enum ima_hooks func, int *pcr, struct ima_template_desc **template_desc,
@@ -437,7 +437,7 @@ void ima_store_measurement(struct ima_iint_cache *iint, struct file *file,struct evm_ima_xattr_data *xattr_value, int xattr_len, const struct modsig *modsig, int pcr, struct ima_template_desc *template_desc); -int process_buffer_measurement(struct mnt_idmap *idmap, +int process_buffer_measurement(const struct mnt_idmap *idmap, struct inode *inode, const void *buf, int size, const char *eventname, enum ima_hooks func, int pcr, const char *func_data,
@@ -454,7 +454,7 @@ void ima_free_template_entry(struct ima_template_entry *entry);const char *ima_d_path (const struct path *path,char **pathbuf,char *filename);/* IMA policy related functions */ -int ima_match_policy(struct mnt_idmap *idmap, struct inode *inode, +int ima_match_policy(const struct mnt_idmap *idmap, struct inode *inode, const struct cred *cred, struct lsm_prop *prop, enum ima_hooks func, int mask, int flags, int *pcr, struct ima_template_desc **template_desc,
@@ -489,7 +489,7 @@ int ima_appraise_measurement(enum ima_hooks func, struct ima_iint_cache *iint,struct evm_ima_xattr_data *xattr_value, int xattr_len, const struct modsig *modsig, bool bprm_is_check); -int ima_must_appraise (struct mnt_idmap *idmap,struct inode *inode, +int ima_must_appraise (const struct mnt_idmap *idmap,struct inode *inode,int mask,enum ima_hooks func);void ima_update_xattr (struct ima_iint_cache *iint,struct file *file); enum integrity_status ima_get_cache_status(struct ima_iint_cache *iint,
@@ -519,7 +519,7 @@ static inline int ima_appraise_measurement(enum ima_hooks func,return INTEGRITY_UNKNOWN ; } -static inline int ima_must_appraise (struct mnt_idmap *idmap, +static inline int ima_must_appraise (const struct mnt_idmap *idmap,struct inode *inode,int mask,enum ima_hooks func) {
security/integrity/ima/ima_api.c +1 -1
@@ -188,7 +188,7 @@ void ima_add_violation(struct file *file, const unsigned char *filename,* Returns IMA_MEASURE, IMA_APPRAISE mask. * */ -int ima_get_action(struct mnt_idmap *idmap, struct inode *inode, +int ima_get_action(const struct mnt_idmap *idmap, struct inode *inode, const struct cred *cred, struct lsm_prop *prop, int mask, enum ima_hooks func, int *pcr, struct ima_template_desc **template_desc,
security/integrity/ima/ima_appraise.c +1 -1
@@ -71,7 +71,7 @@ bool is_ima_appraise_enabled(void)* * Return 1 to appraise or hash */ -int ima_must_appraise (struct mnt_idmap *idmap,struct inode *inode, +int ima_must_appraise (const struct mnt_idmap *idmap,struct inode *inode,int mask,enum ima_hooks func) {struct lsm_prop prop;
security/integrity/ima/ima_main.c +1 -1
@@ -1095,7 +1095,7 @@ static int ima_post_load_data(char *buf, loff_t size,* has been written to the passed location but not added to a measurement entry, * a negative value otherwise. */ -int process_buffer_measurement(struct mnt_idmap *idmap, +int process_buffer_measurement(const struct mnt_idmap *idmap, struct inode *inode, const void *buf, int size, const char *eventname, enum ima_hooks func, int pcr, const char *func_data,
security/integrity/ima/ima_policy.c +2 -2
@@ -575,7 +575,7 @@ static bool ima_match_rule_data(struct ima_rule_entry *rule,* Returns true on rule match, false on failure. */ static bool ima_match_rules (struct ima_rule_entry *rule, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *inode,const struct cred *cred,struct lsm_prop *prop,enum ima_hooks func,int mask,const char *func_data)
@@ -757,7 +757,7 @@ static int get_subaction(struct ima_rule_entry *rule, enum ima_hooks func)* list when walking it. Reads are many orders of magnitude more numerous * than writes so ima_match_policy() is classical RCU candidate. */ -int ima_match_policy(struct mnt_idmap *idmap, struct inode *inode, +int ima_match_policy(const struct mnt_idmap *idmap, struct inode *inode, const struct cred *cred, struct lsm_prop *prop, enum ima_hooks func, int mask, int flags, int *pcr, struct ima_template_desc **template_desc,
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 6/27 fs: port i_{g,u}id_{needs_}update() to 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.
--- include/linux/fs.h | 8 ++++---- security/integrity/evm/evm_main.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
include/linux/fs.h +4 -4
@@ -1456,7 +1456,7 @@ static inline vfsuid_t i_uid_into_vfsuid(const struct mnt_idmap *idmap,* * Return: true if @inode's i_uid field needs to be updated, false if not. */ -static inline bool i_uid_needs_update (struct mnt_idmap *idmap, +static inline bool i_uid_needs_update (const struct mnt_idmap *idmap,const struct iattr *attr,const struct inode *inode) {
@@ -1474,7 +1474,7 @@ static inline bool i_uid_needs_update(struct mnt_idmap *idmap,* Safely update @inode's i_uid field translating the vfsuid of any idmapped * mount into the filesystem kuid. */ -static inline void i_uid_update (struct mnt_idmap *idmap, +static inline void i_uid_update (const struct mnt_idmap *idmap,const struct iattr *attr,struct inode *inode) {
@@ -1508,7 +1508,7 @@ static inline vfsgid_t i_gid_into_vfsgid(const struct mnt_idmap *idmap,* * Return: true if @inode's i_gid field needs to be updated, false if not. */ -static inline bool i_gid_needs_update (struct mnt_idmap *idmap, +static inline bool i_gid_needs_update (const struct mnt_idmap *idmap,const struct iattr *attr,const struct inode *inode) {
@@ -1526,7 +1526,7 @@ static inline bool i_gid_needs_update(struct mnt_idmap *idmap,* Safely update @inode's i_gid field translating the vfsgid of any idmapped * mount into the filesystem kgid. */ -static inline void i_gid_update (struct mnt_idmap *idmap, +static inline void i_gid_update (const struct mnt_idmap *idmap,const struct iattr *attr,struct inode *inode) {
security/integrity/evm/evm_main.c +1 -1
@@ -933,7 +933,7 @@ static inline void evm_inode_post_remove_acl(struct mnt_idmap *idmap,evm_inode_post_removexattr (dentry, acl_name); } -static int evm_attr_change (struct mnt_idmap *idmap, +static int evm_attr_change (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_backing_inode (dentry);
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 7/27 quota: port to 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.
--- fs/quota/dquot.c | 2 +- include/linux/quotaops.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
fs/quota/dquot.c +1 -1
@@ -2079,7 +2079,7 @@ EXPORT_SYMBOL(__dquot_transfer);/* Wrapper for transferring ownership of an inode for uid/gid only * Called from FSXXX_setattr() */ -int dquot_transfer (struct mnt_idmap *idmap,struct inode *inode, +int dquot_transfer (const struct mnt_idmap *idmap,struct inode *inode,struct iattr *iattr) {struct dquot *transfer_to[MAXQUOTAS ] = {};
include/linux/quotaops.h +3 -3
@@ -20,7 +20,7 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb) }/* i_rwsem must being held */ -static inline bool is_quota_modification (struct mnt_idmap *idmap, +static inline bool is_quota_modification (const struct mnt_idmap *idmap,struct inode *inode,struct iattr *ia) { return ((ia->ia_valid & ATTR_SIZE) ||
@@ -109,7 +109,7 @@ int dquot_set_dqblk(struct super_block *sb, struct kqid id, struct qc_dqblk *di);int __dquot_transfer (struct inode *inode,struct dquot **transfer_to); -int dquot_transfer (struct mnt_idmap *idmap,struct inode *inode, +int dquot_transfer (const struct mnt_idmap *idmap,struct inode *inode,struct iattr *iattr);static inline struct mem_dqinfo *sb_dqinfo (struct super_block *sb,int type)
@@ -229,7 +229,7 @@ static inline void dquot_free_inode(struct inode *inode) { } -static inline int dquot_transfer (struct mnt_idmap *idmap, +static inline int dquot_transfer (const struct mnt_idmap *idmap,struct inode *inode,struct iattr *iattr) {return 0 ;
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 8/27 fs: port privilege checking helpers to 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.
--- fs/attr.c | 10 +++++----- fs/f2fs/acl.c | 4 ++-- fs/f2fs/file.c | 2 +- fs/inode.c | 4 ++-- fs/internal.h | 4 ++-- include/linux/capability.h | 4 ++-- include/linux/fs.h | 8 ++++---- include/linux/security.h | 2 +- kernel/capability.c | 4 ++-- security/commoncap.c | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-)
fs/attr.c +5 -5
@@ -30,7 +30,7 @@* * Return: ATTR_KILL_SGID if setgid bit needs to be removed, 0 otherwise. */ -int setattr_should_drop_sgid (struct mnt_idmap *idmap, +int setattr_should_drop_sgid (const struct mnt_idmap *idmap,const struct inode *inode) {umode_t mode = inode->i_mode;
@@ -60,7 +60,7 @@ EXPORT_SYMBOL(setattr_should_drop_sgid);* Return: A mask of ATTR_KILL_S{G,U}ID indicating which - if any - setid bits * to remove, 0 otherwise. */ -int setattr_should_drop_suidgid (struct mnt_idmap *idmap, +int setattr_should_drop_suidgid (const struct mnt_idmap *idmap,struct inode *inode) {umode_t mode = inode->i_mode;
@@ -91,7 +91,7 @@ EXPORT_SYMBOL(setattr_should_drop_suidgid);* permissions. On non-idmapped mounts or if permission checking is to be * performed on the raw inode simply pass @nop_mnt_idmap. */ -static bool chown_ok (struct mnt_idmap *idmap, +static bool chown_ok (const struct mnt_idmap *idmap,const struct inode *inode,vfsuid_t ia_vfsuid) {vfsuid_t vfsuid =i_uid_into_vfsuid (idmap, inode);
@@ -118,7 +118,7 @@ static bool chown_ok(struct mnt_idmap *idmap,* permissions. On non-idmapped mounts or if permission checking is to be * performed on the raw inode simply pass @nop_mnt_idmap. */ -static bool chgrp_ok (struct mnt_idmap *idmap, +static bool chgrp_ok (const struct mnt_idmap *idmap,const struct inode *inode,vfsgid_t ia_vfsgid) {vfsgid_t vfsgid =i_gid_into_vfsgid (idmap, inode);
@@ -339,7 +339,7 @@ static void setattr_copy_mgtime(struct inode *inode, const struct iattr *attr)* that for "simple" filesystems, the struct inode is the inode storage. * The caller is free to mark the inode dirty afterwards if needed. */ -void setattr_copy (struct mnt_idmap *idmap,struct inode *inode, +void setattr_copy (const struct mnt_idmap *idmap,struct inode *inode,const struct iattr *attr) {unsigned int ia_valid = attr->ia_valid;
fs/f2fs/acl.c +2 -2
@@ -219,7 +219,7 @@ struct posix_acl *f2fs_get_acl(struct inode *inode, int type, bool rcu)return __f2fs_get_acl (inode, type,NULL ); } -static int f2fs_acl_update_mode (struct mnt_idmap *idmap, +static int f2fs_acl_update_mode (const struct mnt_idmap *idmap,struct inode *inode,umode_t *mode_p,struct posix_acl **acl) {
@@ -240,7 +240,7 @@ static int f2fs_acl_update_mode(struct mnt_idmap *idmap,return 0 ; } -static int __f2fs_set_acl (struct mnt_idmap *idmap, +static int __f2fs_set_acl (const struct mnt_idmap *idmap,struct inode *inode,int type,struct posix_acl *acl,struct folio *ifolio) {
fs/f2fs/file.c +1 -1
@@ -1096,7 +1096,7 @@ int f2fs_getattr(struct mnt_idmap *idmap, const struct path *path, }#ifdef CONFIG_F2FS_FS_POSIX_ACL -static void __setattr_copy (struct mnt_idmap *idmap, +static void __setattr_copy (const struct mnt_idmap *idmap,struct inode *inode,const struct iattr *attr) {unsigned int ia_valid = attr->ia_valid;
fs/inode.c +2 -2
@@ -2337,7 +2337,7 @@ EXPORT_SYMBOL(touch_atime);* response to write or truncate. Return 0 if nothing has to be changed. * Negative value on error (change should be denied). */ -int dentry_needs_remove_privs (struct mnt_idmap *idmap, +int dentry_needs_remove_privs (const struct mnt_idmap *idmap,struct dentry *dentry) {struct inode *inode =d_inode (dentry);
@@ -3033,7 +3033,7 @@ EXPORT_SYMBOL(inode_set_ctime_deleg);* * Return: true if the caller is sufficiently privileged, false if not. */ -bool in_group_or_capable (struct mnt_idmap *idmap, +bool in_group_or_capable (const struct mnt_idmap *idmap,const struct inode *inode,vfsgid_t vfsgid) {if (vfsgid_in_group_p (vfsgid))
fs/internal.h +2 -2
@@ -210,8 +210,8 @@ extern int vfs_open(const struct path *, struct file *);* inode.c */ extern long prune_icache_sb (struct super_block *sb,struct shrink_control *sc); -int dentry_needs_remove_privs (struct mnt_idmap *,struct dentry *dentry); -bool in_group_or_capable (struct mnt_idmap *idmap, +int dentry_needs_remove_privs (const struct mnt_idmap *,struct dentry *dentry); +bool in_group_or_capable (const struct mnt_idmap *idmap,const struct inode *inode,vfsgid_t vfsgid);/*
include/linux/capability.h +2 -2
@@ -181,9 +181,9 @@ static inline bool ns_capable_setid(struct user_namespace *ns, int cap) }#endif /* CONFIG_MULTIUSER */ bool privileged_wrt_inode_uidgid (struct user_namespace *ns, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,const struct inode *inode); -bool capable_wrt_inode_uidgid (struct mnt_idmap *idmap, +bool capable_wrt_inode_uidgid (const struct mnt_idmap *idmap,const struct inode *inode,int cap);extern bool file_ns_capable (const struct file *file,struct user_namespace *ns,int cap);extern bool ptracer_capable (struct task_struct *tsk,struct user_namespace *ns);
include/linux/fs.h +4 -4
@@ -1835,7 +1835,7 @@ void inode_init_owner(struct mnt_idmap *idmap, struct inode *inode,extern bool may_open_dev (const struct path *path);umode_t mode_strip_sgid (struct mnt_idmap *idmap,const struct inode *dir,umode_t mode); -bool in_group_or_capable (struct mnt_idmap *idmap, +bool in_group_or_capable (const struct mnt_idmap *idmap,const struct inode *inode,vfsgid_t vfsgid);/*
@@ -3045,9 +3045,9 @@ static inline struct inode *new_inode_pseudo(struct super_block *sb) }extern struct inode *new_inode (struct super_block *sb);extern void free_inode_nonrcu (struct inode *inode); -extern int setattr_should_drop_suidgid (struct mnt_idmap *,struct inode *); +extern int setattr_should_drop_suidgid (const struct mnt_idmap *,struct inode *);extern int file_remove_privs (struct file *); -int setattr_should_drop_sgid (struct mnt_idmap *idmap, +int setattr_should_drop_sgid (const struct mnt_idmap *idmap,const struct inode *inode);/*
@@ -3401,7 +3401,7 @@ int may_setattr(struct mnt_idmap *idmap, struct inode *inode, unsigned int ia_valid);int setattr_prepare (struct mnt_idmap *,struct dentry *,struct iattr *);extern int inode_newsize_ok (const struct inode *,loff_t offset); -void setattr_copy (struct mnt_idmap *,struct inode *inode, +void setattr_copy (const struct mnt_idmap *,struct inode *inode,const struct iattr *attr);extern int file_update_time (struct file *file);
include/linux/security.h +1 -1
@@ -185,7 +185,7 @@ extern int cap_capset(struct cred *new, const struct cred *old,extern int cap_bprm_creds_from_file (struct linux_binprm *bprm,const struct file *file);int cap_inode_setxattr (struct dentry *dentry,const char *name,const void *value,size_t size,int flags); -int cap_inode_removexattr (struct mnt_idmap *idmap, +int cap_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name);int cap_inode_need_killpriv (struct dentry *dentry);int cap_inode_killpriv (struct mnt_idmap *idmap,struct dentry *dentry);
kernel/capability.c +2 -2
@@ -453,7 +453,7 @@ EXPORT_SYMBOL(file_ns_capable);* Return true if the inode uid and gid are within the namespace. */ bool privileged_wrt_inode_uidgid (struct user_namespace *ns, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,const struct inode *inode) { return vfsuid_has_mapping(ns, i_uid_into_vfsuid(idmap, inode)) &&
@@ -470,7 +470,7 @@ bool privileged_wrt_inode_uidgid(struct user_namespace *ns,* its own user namespace and that the given inode's uid and gid are * mapped into the current user namespace. */ -bool capable_wrt_inode_uidgid (struct mnt_idmap *idmap, +bool capable_wrt_inode_uidgid (const struct mnt_idmap *idmap,const struct inode *inode,int cap) {struct user_namespace *ns =current_user_ns ();
security/commoncap.c +1 -1
@@ -1063,7 +1063,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,* This is used to make sure security xattrs don't get removed by those who * aren't privileged to remove them. */ -int cap_inode_removexattr (struct mnt_idmap *idmap, +int cap_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name) {struct user_namespace *user_ns = dentry->d_sb->s_user_ns;
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 9/27 fs: port inode_owner_or_capable() to 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.
--- fs/btrfs/ioctl.c | 2 +- fs/ext4/ioctl.c | 2 +- fs/inode.c | 2 +- include/linux/fs.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
fs/btrfs/ioctl.c +1 -1
@@ -3886,7 +3886,7 @@ static long btrfs_ioctl_quota_rescan_wait(struct btrfs_fs_info *fs_info) }static long _btrfs_ioctl_set_received_subvol (struct file *file, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct btrfs_ioctl_received_subvol_args *sa) {struct inode *inode =file_inode (file);
fs/ext4/ioctl.c +1 -1
@@ -373,7 +373,7 @@ void ext4_reset_inode_seed(struct inode *inode)* */ static long swap_inode_boot_loader (struct super_block *sb, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *inode) {handle_t *handle;
fs/inode.c +1 -1
@@ -2746,7 +2746,7 @@ EXPORT_SYMBOL(inode_init_owner);* On non-idmapped mounts or if permission checking is to be performed on the * raw inode simply pass @nop_mnt_idmap. */ -bool inode_owner_or_capable (struct mnt_idmap *idmap, +bool inode_owner_or_capable (const struct mnt_idmap *idmap,const struct inode *inode) {vfsuid_t vfsuid;
include/linux/fs.h +1 -1
@@ -1755,7 +1755,7 @@ static inline bool file_write_not_started(const struct file *file)return sb_write_not_started (file_inode (file)->i_sb); } -bool inode_owner_or_capable (struct mnt_idmap *idmap, +bool inode_owner_or_capable (const struct mnt_idmap *idmap,const struct inode *inode);/*
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 10/27 fs: port inode_init_owner() to 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.
--- fs/btrfs/btrfs_inode.h | 2 +- fs/btrfs/inode.c | 6 +++--- fs/btrfs/ioctl.c | 2 +- fs/ext4/ext4.h | 2 +- fs/ext4/ialloc.c | 2 +- fs/ext4/namei.c | 4 ++-- fs/f2fs/f2fs.h | 2 +- fs/f2fs/namei.c | 10 +++++----- fs/hugetlbfs/inode.c | 2 +- fs/inode.c | 4 ++-- fs/namei.c | 2 +- fs/overlayfs/dir.c | 2 +- fs/xfs/libxfs/xfs_inode_util.h | 2 +- fs/xfs/xfs_inode.c | 4 ++-- fs/xfs/xfs_inode.h | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_symlink.c | 2 +- fs/xfs/xfs_symlink.h | 2 +- include/linux/fs.h | 4 ++-- mm/shmem.c | 8 ++++---- 20 files changed, 33 insertions(+), 33 deletions(-)
fs/btrfs/btrfs_inode.h +1 -1
@@ -559,7 +559,7 @@ int btrfs_new_inode_prepare(struct btrfs_new_inode_args *args,int btrfs_create_new_inode (struct btrfs_trans_handle *trans,struct btrfs_new_inode_args *args);void btrfs_new_inode_args_destroy (struct btrfs_new_inode_args *args); -struct inode *btrfs_new_subvol_inode (struct mnt_idmap *idmap, +struct inode *btrfs_new_subvol_inode (const struct mnt_idmap *idmap,struct inode *dir);void btrfs_set_delalloc_extent (struct btrfs_inode *inode,struct extent_state *state,u32 bits);
fs/btrfs/inode.c +3 -3
@@ -8022,7 +8022,7 @@ static int btrfs_truncate(struct btrfs_inode *inode, bool skip_writeback)return ret; } -struct inode *btrfs_new_subvol_inode (struct mnt_idmap *idmap, +struct inode *btrfs_new_subvol_inode (const struct mnt_idmap *idmap,struct inode *dir) {struct inode *inode;
@@ -8540,7 +8540,7 @@ static int btrfs_rename_exchange(struct inode *old_dir,return ret; } -static struct inode *new_whiteout_inode (struct mnt_idmap *idmap, +static struct inode *new_whiteout_inode (const struct mnt_idmap *idmap,struct inode *dir) {struct inode *inode;
@@ -8555,7 +8555,7 @@ static struct inode *new_whiteout_inode(struct mnt_idmap *idmap,return inode; } -static int btrfs_rename (struct mnt_idmap *idmap, +static int btrfs_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/ioctl.c +1 -1
@@ -534,7 +534,7 @@ static unsigned int create_subvol_num_items(const struct btrfs_qgroup_inherit *ireturn num_items; } -static noinline int create_subvol(struct mnt_idmap *idmap, +static noinline int create_subvol(const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,struct btrfs_qgroup_inherit *inherit) {
fs/ext4/ext4.h +1 -1
@@ -3044,7 +3044,7 @@ extern int ext4fs_dirhash(const struct inode *dir, const char *name, int len,/* ialloc.c */ extern int ext4_mark_inode_used (struct super_block *sb,int ino); -extern struct inode *__ext4_new_inode(struct mnt_idmap *, handle_t *, +extern struct inode *__ext4_new_inode(const struct mnt_idmap *, handle_t *, struct inode *, umode_t, const struct qstr *qstr, __u32 goal, uid_t *owner, __u32 i_flags,
fs/ext4/ialloc.c +1 -1
@@ -930,7 +930,7 @@ static int ext4_xattr_credits_for_new_inode(struct inode *dir, mode_t mode,* For other inodes, search forward from the parent directory's block * group to find a free inode. */ -struct inode *__ext4_new_inode(struct mnt_idmap *idmap, +struct inode *__ext4_new_inode(const struct mnt_idmap *idmap, handle_t *handle, struct inode *dir, umode_t mode, const struct qstr *qstr, __u32 goal, uid_t *owner, __u32 i_flags,
fs/ext4/namei.c +2 -2
@@ -3753,7 +3753,7 @@ static void ext4_update_dir_count(handle_t *handle, struct ext4_renament *ent) } } -static struct inode *ext4_whiteout_for_rename (struct mnt_idmap *idmap, +static struct inode *ext4_whiteout_for_rename (const struct mnt_idmap *idmap,struct ext4_renament *ent,int credits,handle_t **h) {
@@ -3796,7 +3796,7 @@ static struct inode *ext4_whiteout_for_rename(struct mnt_idmap *idmap,* while new_{dentry,inode) refers to the destination dentry/inode * This comes from rename(const char *oldpath, const char *newpath) */ -static int ext4_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int ext4_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/f2fs/f2fs.h +1 -1
@@ -3890,7 +3890,7 @@ void f2fs_destroy_evict_inode_work(void);int f2fs_update_extension_list (struct f2fs_sb_info *sbi,const char *name,bool hot,bool set);struct dentry *f2fs_get_parent (struct dentry *child); -int f2fs_get_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +int f2fs_get_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct inode **new_inode);/*
fs/f2fs/namei.c +5 -5
@@ -231,7 +231,7 @@ static void set_file_temperature(struct f2fs_sb_info *sbi, struct inode *inode,file_set_hot (inode); } -static struct inode *f2fs_new_inode (struct mnt_idmap *idmap, +static struct inode *f2fs_new_inode (const struct mnt_idmap *idmap,struct inode *dir,umode_t mode,const char *name) {
@@ -857,7 +857,7 @@ static int f2fs_mknod(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,bool is_whiteout,struct inode **new_inode,struct f2fs_filename *fname) {
@@ -944,7 +944,7 @@ static int f2fs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,return finish_open_simple (file, err); } -static int f2fs_create_whiteout (struct mnt_idmap *idmap, +static int f2fs_create_whiteout (const struct mnt_idmap *idmap,struct inode *dir,struct inode **whiteout,struct f2fs_filename *fname) {
@@ -952,14 +952,14 @@ static int f2fs_create_whiteout(struct mnt_idmap *idmap, true, whiteout, fname); } -int f2fs_get_tmpfile (struct mnt_idmap *idmap,struct inode *dir, +int f2fs_get_tmpfile (const struct mnt_idmap *idmap,struct inode *dir,struct inode **new_inode) {return __f2fs_tmpfile (idmap, dir,NULL ,S_IFREG , false, new_inode,NULL ); } -static int f2fs_rename (struct mnt_idmap *idmap,struct inode *old_dir, +static int f2fs_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/hugetlbfs/inode.c +1 -1
@@ -892,7 +892,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb,static struct lock_class_key hugetlbfs_i_mmap_rwsem_key;static struct inode *hugetlbfs_get_inode (struct super_block *sb, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct inode *dir,umode_t mode,dev_t dev) {
fs/inode.c +2 -2
@@ -2716,7 +2716,7 @@ EXPORT_SYMBOL(init_special_inode);* and initializing i_uid and i_gid. On non-idmapped mounts or if permission * checking is to be performed on the raw inode simply pass @nop_mnt_idmap. */ -void inode_init_owner (struct mnt_idmap *idmap,struct inode *inode, +void inode_init_owner (const struct mnt_idmap *idmap,struct inode *inode,const struct inode *dir,umode_t mode) {inode_fsuid_set (inode, idmap);
@@ -3058,7 +3058,7 @@ EXPORT_SYMBOL(in_group_or_capable);* * Return: the new mode to use for the file */ -umode_t mode_strip_sgid (struct mnt_idmap *idmap, +umode_t mode_strip_sgid (const struct mnt_idmap *idmap,const struct inode *dir,umode_t mode) {if ((mode & (S_ISGID |S_IXGRP )) != (S_ISGID |S_IXGRP ))
fs/namei.c +1 -1
@@ -4142,7 +4142,7 @@ EXPORT_SYMBOL(end_renaming);* * Returns: mode to be passed to the filesystem */ -static inline umode_t vfs_prepare_mode (struct mnt_idmap *idmap, +static inline umode_t vfs_prepare_mode (const struct mnt_idmap *idmap,const struct inode *dir,umode_t mode,umode_t mask_perms,umode_t type) {
fs/overlayfs/dir.c +1 -1
@@ -688,7 +688,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,return err; } -static int ovl_create_object (struct mnt_idmap *idmap,struct dentry *dentry, +static int ovl_create_object (const struct mnt_idmap *idmap,struct dentry *dentry,int mode,dev_t rdev,const char *link) {int err;
fs/xfs/libxfs/xfs_inode_util.h +1 -1
@@ -27,7 +27,7 @@ prid_t xfs_get_initial_prid(struct xfs_inode *dp);* idmap to NULL. To create a tree root, set pip to NULL. */ struct xfs_icreate_args { -struct mnt_idmap *idmap; +const struct mnt_idmap *idmap;struct xfs_inode *pip;/* parent inode or null */ dev_t rdev;umode_t mode;
fs/xfs/xfs_inode.c +2 -2
@@ -2084,7 +2084,7 @@ xfs_sort_inodes(*/ static int xfs_rename_alloc_whiteout ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct xfs_name *src_name,struct xfs_inode *dp,struct xfs_inode **wip)
@@ -2130,7 +2130,7 @@ xfs_rename_alloc_whiteout(*/ int xfs_rename( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct xfs_inode *src_dp, struct xfs_name *src_name, struct xfs_inode *src_ip,
fs/xfs/xfs_inode.h +1 -1
@@ -568,7 +568,7 @@ int xfs_remove(struct xfs_inode *dp, struct xfs_name *name, struct xfs_inode *ip);int xfs_link (struct xfs_inode *tdp,struct xfs_inode *sip,struct xfs_name *target_name); -int xfs_rename(struct mnt_idmap *idmap, +int xfs_rename(const struct mnt_idmap *idmap, struct xfs_inode *src_dp, struct xfs_name *src_name, struct xfs_inode *src_ip, struct xfs_inode *target_dp, struct xfs_name *target_name,
fs/xfs/xfs_iops.c +1 -1
@@ -169,7 +169,7 @@ xfs_create_need_xattr( STATIC int xfs_generic_create( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct inode *dir, struct dentry *dentry, umode_t mode,
fs/xfs/xfs_symlink.c +1 -1
@@ -82,7 +82,7 @@ xfs_readlink( int xfs_symlink( - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct xfs_inode *dp, struct xfs_name *link_name, const char *target_path,
fs/xfs/xfs_symlink.h +1 -1
@@ -7,7 +7,7 @@/* Kernel only symlink definitions */ -int xfs_symlink (struct mnt_idmap *idmap,struct xfs_inode *dp, +int xfs_symlink (const struct mnt_idmap *idmap,struct xfs_inode *dp,struct xfs_name *link_name,const char *target_path,umode_t mode,struct xfs_inode **ipp);int xfs_readlink (struct xfs_inode *ip,char *link);
include/linux/fs.h +2 -2
@@ -1830,10 +1830,10 @@ extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,/* * VFS file helper functions. */ -void inode_init_owner (struct mnt_idmap *idmap,struct inode *inode, +void inode_init_owner (const struct mnt_idmap *idmap,struct inode *inode,const struct inode *dir,umode_t mode);extern bool may_open_dev (const struct path *path); -umode_t mode_strip_sgid (struct mnt_idmap *idmap, +umode_t mode_strip_sgid (const struct mnt_idmap *idmap,const struct inode *dir,umode_t mode);bool in_group_or_capable (const struct mnt_idmap *idmap,const struct inode *inode,vfsgid_t vfsgid);
mm/shmem.c +4 -4
@@ -3022,7 +3022,7 @@ static struct offset_ctx *shmem_get_offset_ctx(struct inode *inode)return &SHMEM_I (inode)->dir_offsets; } -static struct inode *__shmem_get_inode (struct mnt_idmap *idmap, +static struct inode *__shmem_get_inode (const struct mnt_idmap *idmap,struct super_block *sb,struct inode *dir,umode_t mode,dev_t dev,vma_flags_t flags)
@@ -3102,7 +3102,7 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, }#ifdef CONFIG_TMPFS_QUOTA -static struct inode *shmem_get_inode (struct mnt_idmap *idmap, +static struct inode *shmem_get_inode (const struct mnt_idmap *idmap,struct super_block *sb,struct inode *dir,umode_t mode,dev_t dev,vma_flags_t flags) {
@@ -3130,7 +3130,7 @@ static struct inode *shmem_get_inode(struct mnt_idmap *idmap, return ERR_PTR(err); }#else -static struct inode *shmem_get_inode (struct mnt_idmap *idmap, +static struct inode *shmem_get_inode (const struct mnt_idmap *idmap,struct super_block *sb,struct inode *dir,umode_t mode,dev_t dev,vma_flags_t flags) {
@@ -5792,7 +5792,7 @@ static inline void shmem_unacct_size(unsigned long flags, loff_t size) { } -static inline struct inode *shmem_get_inode (struct mnt_idmap *idmap, +static inline struct inode *shmem_get_inode (const struct mnt_idmap *idmap,struct super_block *sb,struct inode *dir,umode_t mode,dev_t dev,vma_flags_t flags) {
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 11/27 fs: port acl to 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.
--- fs/ntfs/ea.c | 4 ++-- fs/ntfs/ea.h | 2 +- fs/ntfs/namei.c | 2 +- fs/ntfs3/inode.c | 2 +- fs/ntfs3/ntfs_fs.h | 4 ++-- fs/ntfs3/xattr.c | 4 ++-- fs/posix_acl.c | 6 +++--- include/linux/lsm_hook_defs.h | 8 ++++---- include/linux/posix_acl.h | 4 ++-- include/linux/security.h | 16 ++++++++-------- security/integrity/evm/evm_main.c | 10 +++++----- security/integrity/ima/ima_appraise.c | 4 ++-- security/security.c | 8 ++++---- security/selinux/hooks.c | 6 +++--- security/smack/smack_lsm.c | 6 +++--- 15 files changed, 43 insertions(+), 43 deletions(-)
fs/ntfs/ea.c +2 -2
@@ -998,7 +998,7 @@ struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,return acl; } -static noinline int ntfs_set_acl_ex(struct mnt_idmap *idmap, +static noinline int ntfs_set_acl_ex(const struct mnt_idmap *idmap,struct inode *inode,struct posix_acl *acl,int type,bool init_acl) {
@@ -1086,7 +1086,7 @@ int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,return ntfs_set_acl_ex (idmap,d_inode (dentry), acl, type, false); } -int ntfs_init_acl (struct mnt_idmap *idmap,struct inode *inode, +int ntfs_init_acl (const struct mnt_idmap *idmap,struct inode *inode,struct inode *dir) {struct posix_acl *default_acl, *acl;
fs/ntfs/ea.h +1 -1
@@ -21,7 +21,7 @@ struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry, int type);int ntfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type); -int ntfs_init_acl (struct mnt_idmap *idmap,struct inode *inode, +int ntfs_init_acl (const struct mnt_idmap *idmap,struct inode *inode,struct inode *dir);#else #define ntfs_get_acl NULL
fs/ntfs/namei.c +1 -1
@@ -391,7 +391,7 @@ static int ntfs_sd_add_everyone(struct ntfs_inode *ni)return ret; } -static struct ntfs_inode *__ntfs_create (struct mnt_idmap *idmap,struct inode *dir, +static struct ntfs_inode *__ntfs_create (const struct mnt_idmap *idmap,struct inode *dir,__le16 *name,u8 name_len,mode_t mode,dev_t dev,const char *target,int target_len) {
fs/ntfs3/inode.c +1 -1
@@ -1381,7 +1381,7 @@ ntfs_create_reparse_buffer(struct ntfs_sb_info *sbi, const char *symname,* * NOTE: if fnd != NULL (ntfs_atomic_open) then @dir is locked */ -int ntfs_create_inode (struct mnt_idmap *idmap,struct inode *dir, +int ntfs_create_inode (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const struct cpu_str *uni,umode_t mode,dev_t dev,const char *symname,u32 size,struct ntfs_fnd *fnd)
fs/ntfs3/ntfs_fs.h +2 -2
@@ -803,7 +803,7 @@ int ntfs_set_size(struct inode *inode, u64 new_size);int ntfs3_write_inode (struct inode *inode,struct writeback_control *wbc);int ntfs_sync_inode (struct inode *inode);int inode_read_data (struct inode *inode,void *data,size_t bytes); -int ntfs_create_inode (struct mnt_idmap *idmap,struct inode *dir, +int ntfs_create_inode (const struct mnt_idmap *idmap,struct inode *dir,struct dentry *dentry,const struct cpu_str *uni,umode_t mode,dev_t dev,const char *symname,u32 size,struct ntfs_fnd *fnd);
@@ -967,7 +967,7 @@ struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry, int type);int ntfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type); -int ntfs_init_acl (struct mnt_idmap *idmap,struct inode *inode, +int ntfs_init_acl (const struct mnt_idmap *idmap,struct inode *inode,struct inode *dir);#else #define ntfs_get_acl NULL
fs/ntfs3/xattr.c +2 -2
@@ -595,7 +595,7 @@ struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap, struct dentry *dentry,return acl; } -static noinline int ntfs_set_acl_ex(struct mnt_idmap *idmap, +static noinline int ntfs_set_acl_ex(const struct mnt_idmap *idmap,struct inode *inode,struct posix_acl *acl,int type,bool init_acl) {
@@ -688,7 +688,7 @@ int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,* * Called from ntfs_create_inode(). */ -int ntfs_init_acl (struct mnt_idmap *idmap,struct inode *inode, +int ntfs_init_acl (const struct mnt_idmap *idmap,struct inode *inode,struct inode *dir) {struct posix_acl *default_acl, *acl;
fs/posix_acl.c +3 -3
@@ -378,7 +378,7 @@ EXPORT_SYMBOL(posix_acl_from_mode);* by the acl. Returns -E... otherwise. */ int -posix_acl_permission (struct mnt_idmap *idmap,struct inode *inode, +posix_acl_permission (const struct mnt_idmap *idmap,struct inode *inode,const struct posix_acl *acl,int want) {const struct posix_acl_entry *pa, *pe, *mask_obj;
@@ -709,7 +709,7 @@ EXPORT_SYMBOL_GPL(posix_acl_create);* * Called from set_acl inode operations. */ -int posix_acl_update_mode (struct mnt_idmap *idmap, +int posix_acl_update_mode (const struct mnt_idmap *idmap,struct inode *inode,umode_t *mode_p,struct posix_acl **acl) {
@@ -889,7 +889,7 @@ EXPORT_SYMBOL (posix_acl_to_xattr);* Return: On success, the size of the stored uapi posix acls, on error a * negative errno. */ -static ssize_t vfs_posix_acl_to_xattr (struct mnt_idmap *idmap, +static ssize_t vfs_posix_acl_to_xattr (const struct mnt_idmap *idmap,struct inode *inode,const struct posix_acl *acl,void *buffer,size_t size)
include/linux/lsm_hook_defs.h +4 -4
@@ -159,15 +159,15 @@ LSM_HOOK(void, LSM_RET_VOID, inode_post_removexattr, struct dentry *dentry, const char *name) LSM_HOOK(int, 0, inode_file_setattr, struct dentry *dentry, struct file_kattr *fa) LSM_HOOK(int, 0, inode_file_getattr, struct dentry *dentry, struct file_kattr *fa) -LSM_HOOK(int, 0, inode_set_acl, struct mnt_idmap *idmap, +LSM_HOOK(int, 0, inode_set_acl, const struct mnt_idmap *idmap, struct dentry *dentry, const char *acl_name, struct posix_acl *kacl) LSM_HOOK(void, LSM_RET_VOID, inode_post_set_acl, struct dentry *dentry, const char *acl_name, struct posix_acl *kacl) -LSM_HOOK(int, 0, inode_get_acl, struct mnt_idmap *idmap, +LSM_HOOK(int, 0, inode_get_acl, const struct mnt_idmap *idmap, struct dentry *dentry, const char *acl_name) -LSM_HOOK(int, 0, inode_remove_acl, struct mnt_idmap *idmap, +LSM_HOOK(int, 0, inode_remove_acl, const struct mnt_idmap *idmap, struct dentry *dentry, const char *acl_name) -LSM_HOOK(void, LSM_RET_VOID, inode_post_remove_acl, struct mnt_idmap *idmap, +LSM_HOOK(void, LSM_RET_VOID, inode_post_remove_acl, const struct mnt_idmap *idmap, struct dentry *dentry, const char *acl_name) LSM_HOOK(int, 0, inode_need_killpriv, struct dentry *dentry) LSM_HOOK(int, 0, inode_killpriv, struct mnt_idmap *idmap,
include/linux/posix_acl.h +2 -2
@@ -84,7 +84,7 @@ struct posix_acl *posix_acl_clone(const struct posix_acl *acl, gfp_t flags);int posix_acl_chmod (struct mnt_idmap *,struct dentry *,umode_t );extern int posix_acl_create (struct inode *,umode_t *,struct posix_acl **,struct posix_acl **); -int posix_acl_update_mode (struct mnt_idmap *,struct inode *,umode_t *, +int posix_acl_update_mode (const struct mnt_idmap *,struct inode *,umode_t *,struct posix_acl **); int simple_set_acl(struct mnt_idmap *, struct dentry *,
@@ -96,7 +96,7 @@ void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl);void forget_cached_acl (struct inode *inode,int type);void forget_all_cached_acls (struct inode *inode);int posix_acl_valid (struct user_namespace *,const struct posix_acl *); -int posix_acl_permission (struct mnt_idmap *,struct inode *, +int posix_acl_permission (const struct mnt_idmap *,struct inode *,const struct posix_acl *,int );static inline void cache_no_acl (struct inode *inode)
include/linux/security.h +8 -8
@@ -430,16 +430,16 @@ int security_inode_getattr(const struct path *path);int security_inode_setxattr (struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags); -int security_inode_set_acl (struct mnt_idmap *idmap, +int security_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl);void security_inode_post_set_acl (struct dentry *dentry,const char *acl_name,struct posix_acl *kacl); -int security_inode_get_acl (struct mnt_idmap *idmap, +int security_inode_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name); -int security_inode_remove_acl (struct mnt_idmap *idmap, +int security_inode_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name); -void security_inode_post_remove_acl (struct mnt_idmap *idmap, +void security_inode_post_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name); void security_inode_post_setxattr(struct dentry *dentry, const char *name,
@@ -1003,7 +1003,7 @@ static inline int security_inode_setxattr(struct mnt_idmap *idmap,return cap_inode_setxattr (dentry, name, value, size, flags); } -static inline int security_inode_set_acl (struct mnt_idmap *idmap, +static inline int security_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl)
@@ -1016,21 +1016,21 @@ static inline void security_inode_post_set_acl(struct dentry *dentry, struct posix_acl *kacl) { } -static inline int security_inode_get_acl (struct mnt_idmap *idmap, +static inline int security_inode_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {return 0 ; } -static inline int security_inode_remove_acl (struct mnt_idmap *idmap, +static inline int security_inode_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {return 0 ; } -static inline void security_inode_post_remove_acl (struct mnt_idmap *idmap, +static inline void security_inode_post_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) { }
security/integrity/evm/evm_main.c +5 -5
@@ -652,7 +652,7 @@ static int evm_inode_removexattr(struct mnt_idmap *idmap, struct dentry *dentry, }#ifdef CONFIG_FS_POSIX_ACL -static int evm_inode_set_acl_change (struct mnt_idmap *idmap, +static int evm_inode_set_acl_change (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,struct posix_acl *kacl) {
@@ -671,7 +671,7 @@ static int evm_inode_set_acl_change(struct mnt_idmap *idmap, return 0; }#else -static inline int evm_inode_set_acl_change (struct mnt_idmap *idmap, +static inline int evm_inode_set_acl_change (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,struct posix_acl *kacl)
@@ -693,7 +693,7 @@ static inline int evm_inode_set_acl_change(struct mnt_idmap *idmap,* * Return: zero on success, -EPERM on failure. */ -static int evm_inode_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +static int evm_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl) {enum integrity_status evm_status;
@@ -745,7 +745,7 @@ static int evm_inode_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,* * Return: zero on success, -EPERM on failure. */ -static int evm_inode_remove_acl (struct mnt_idmap *idmap,struct dentry *dentry, +static int evm_inode_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {return evm_inode_set_acl (idmap, dentry, acl_name,NULL );
@@ -926,7 +926,7 @@ static void evm_inode_post_removexattr(struct dentry *dentry,* Update the 'security.evm' xattr with the EVM HMAC re-calculated after * removing posix acls. */ -static inline void evm_inode_post_remove_acl (struct mnt_idmap *idmap, +static inline void evm_inode_post_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {
security/integrity/ima/ima_appraise.c +2 -2
@@ -790,7 +790,7 @@ static int ima_inode_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,return result; } -static int ima_inode_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +static int ima_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl) {if (evm_revalidate_status (acl_name))
@@ -815,7 +815,7 @@ static int ima_inode_removexattr(struct mnt_idmap *idmap, struct dentry *dentry,return result; } -static int ima_inode_remove_acl (struct mnt_idmap *idmap,struct dentry *dentry, +static int ima_inode_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {return ima_inode_set_acl (idmap, dentry, acl_name,NULL );
security/security.c +4 -4
@@ -1953,7 +1953,7 @@ int security_inode_setxattr(struct mnt_idmap *idmap,* * Return: Returns 0 if permission is granted. */ -int security_inode_set_acl (struct mnt_idmap *idmap, +int security_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl) {
@@ -1990,7 +1990,7 @@ void security_inode_post_set_acl(struct dentry *dentry, const char *acl_name,* * Return: Returns 0 if permission is granted. */ -int security_inode_get_acl (struct mnt_idmap *idmap, +int security_inode_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {if (unlikely (IS_PRIVATE (d_backing_inode (dentry))))
@@ -2009,7 +2009,7 @@ int security_inode_get_acl(struct mnt_idmap *idmap,* * Return: Returns 0 if permission is granted. */ -int security_inode_remove_acl (struct mnt_idmap *idmap, +int security_inode_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {if (unlikely (IS_PRIVATE (d_backing_inode (dentry))))
@@ -2026,7 +2026,7 @@ int security_inode_remove_acl(struct mnt_idmap *idmap,* Update inode security data after successfully removing posix acls on * @dentry in @idmap. The posix acls are identified by @acl_name. */ -void security_inode_post_remove_acl (struct mnt_idmap *idmap, +void security_inode_post_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {if (unlikely (IS_PRIVATE (d_backing_inode (dentry))))
security/selinux/hooks.c +3 -3
@@ -3453,20 +3453,20 @@ static int selinux_inode_setxattr(struct mnt_idmap *idmap, &ad); } -static int selinux_inode_set_acl (struct mnt_idmap *idmap, +static int selinux_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl) {return dentry_has_perm (current_cred (), dentry,FILE__SETATTR ); } -static int selinux_inode_get_acl (struct mnt_idmap *idmap, +static int selinux_inode_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {return dentry_has_perm (current_cred (), dentry,FILE__GETATTR ); } -static int selinux_inode_remove_acl (struct mnt_idmap *idmap, +static int selinux_inode_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {return dentry_has_perm (current_cred (), dentry,FILE__SETATTR );
security/smack/smack_lsm.c +3 -3
@@ -1543,7 +1543,7 @@ static int smack_inode_removexattr(struct mnt_idmap *idmap,* * Returns 0 if access is permitted, an error code otherwise */ -static int smack_inode_set_acl (struct mnt_idmap *idmap, +static int smack_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl) {
@@ -1566,7 +1566,7 @@ static int smack_inode_set_acl(struct mnt_idmap *idmap,* * Returns 0 if access is permitted, an error code otherwise */ -static int smack_inode_get_acl (struct mnt_idmap *idmap, +static int smack_inode_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {struct smk_audit_info ad;
@@ -1588,7 +1588,7 @@ static int smack_inode_get_acl(struct mnt_idmap *idmap,* * Returns 0 if access is permitted, an error code otherwise */ -static int smack_inode_remove_acl (struct mnt_idmap *idmap, +static int smack_inode_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {struct smk_audit_info ad;
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 12/27 fs: port ->permission() 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/afs/internal.h | 2 +- fs/afs/security.c | 2 +- fs/attr.c | 2 +- fs/autofs/root.c | 4 ++-- fs/bad_inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/btrfs/ioctl.c | 2 +- fs/ceph/inode.c | 2 +- fs/ceph/super.h | 2 +- fs/coda/coda_linux.h | 2 +- fs/coda/dir.c | 2 +- fs/coda/pioctl.c | 4 ++-- fs/ecryptfs/inode.c | 2 +- fs/failfs.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/inode.c | 2 +- fs/gfs2/inode.h | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/internal.h | 2 +- fs/kernfs/inode.c | 2 +- fs/kernfs/kernfs-internal.h | 2 +- fs/namei.c | 22 +++++++++++----------- fs/nfs/dir.c | 2 +- fs/nilfs2/inode.c | 2 +- fs/nilfs2/nilfs.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/proc/base.c | 4 ++-- fs/proc/fd.c | 4 ++-- fs/proc/fd.h | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/smb/client/cifsfs.c | 2 +- fs/smb/server/vfs.c | 2 +- fs/smb/server/vfs.h | 2 +- fs/tracefs/inode.c | 2 +- include/linux/fs.h | 8 ++++---- include/linux/nfs_fs.h | 2 +- security/selinux/selinuxfs.c | 2 +- 44 files changed, 61 insertions(+), 61 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -74,7 +74,7 @@ prototypes:: int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *, struct delayed_call *); void (*truncate) (struct inode *); - int (*permission) (struct mnt_idmap *, struct inode *, int, unsigned int); + 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);
Documentation/filesystems/vfs.rst +1 -1
@@ -428,7 +428,7 @@ As of kernel 2.6.22, the following members are defined: int (*readlink) (struct dentry *, char __user *,int); const char *(*get_link) (struct dentry *, struct inode *, struct delayed_call *); - int (*permission) (struct mnt_idmap *, struct inode *, int); + 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);
fs/afs/internal.h +1 -1
@@ -1530,7 +1530,7 @@ extern void afs_cache_permit(struct afs_vnode *, struct key *, unsigned int,extern struct key *afs_request_key (struct afs_cell *);extern struct key *afs_request_key_rcu (struct afs_cell *);extern int afs_check_permit (struct afs_vnode *,struct key *,afs_access_t *); -extern int afs_permission (struct mnt_idmap *,struct inode *,int ); +extern int afs_permission (const struct mnt_idmap *,struct inode *,int ); extern void __exit afs_clean_up_permit_cache(void);/*
fs/afs/security.c +1 -1
@@ -428,7 +428,7 @@ int afs_check_permit(struct afs_vnode *vnode, struct key *key,* - AFS ACLs are attached to directories only, and a file is controlled by its * parent directory's ACL */ -int afs_permission (struct mnt_idmap *idmap,struct inode *inode, +int afs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct afs_vnode *vnode =AFS_FS_I (inode);
fs/attr.c +1 -1
@@ -369,7 +369,7 @@ void setattr_copy(const struct mnt_idmap *idmap, struct inode *inode, }EXPORT_SYMBOL (setattr_copy); -int may_setattr (struct mnt_idmap *idmap,struct inode *inode, +int may_setattr (const struct mnt_idmap *idmap,struct inode *inode,unsigned int ia_valid) {int error;
fs/autofs/root.c +2 -2
@@ -11,7 +11,7 @@#include "autofs_i.h" -static int autofs_dir_permission (struct mnt_idmap *,struct inode *,int ); +static int autofs_dir_permission (const struct mnt_idmap *,struct inode *,int );static int autofs_dir_symlink (struct mnt_idmap *,struct inode *,struct dentry *,const char *);static int autofs_dir_unlink (struct inode *,struct dentry *);
@@ -552,7 +552,7 @@ static struct dentry *autofs_lookup(struct inode *dir,return NULL ; } -static int autofs_dir_permission (struct mnt_idmap *idmap, +static int autofs_dir_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {if (mask &MAY_WRITE ) {
fs/bad_inode.c +1 -1
@@ -89,7 +89,7 @@ static int bad_inode_readlink(struct dentry *dentry, char __user *buffer,return -EIO ; } -static int bad_inode_permission (struct mnt_idmap *idmap, +static int bad_inode_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {return -EIO ;
fs/btrfs/inode.c +1 -1
@@ -9375,7 +9375,7 @@ int btrfs_prealloc_file_range_trans(struct inode *inode,* we are marking them with IOP_FASTPERM_MAY_EXEC, allowing path lookup to * elide calls here. */ -static int btrfs_permission (struct mnt_idmap *idmap, +static int btrfs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct btrfs_root *root =BTRFS_I (inode)->root;
fs/btrfs/ioctl.c +1 -1
@@ -1726,7 +1726,7 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_root *root, u64 diridreturn 0 ; } -static int btrfs_search_path_in_tree_user (struct mnt_idmap *idmap, +static int btrfs_search_path_in_tree_user (const struct mnt_idmap *idmap,struct inode *inode,struct btrfs_ioctl_ino_lookup_user_args *args) {
fs/ceph/inode.c +1 -1
@@ -3098,7 +3098,7 @@ int ceph_do_getvxattr(struct inode *inode, const char *name, void *value,* Check inode permissions. We verify we have a valid value for * the AUTH cap, then call the generic handler. */ -int ceph_permission (struct mnt_idmap *idmap,struct inode *inode, +int ceph_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {int err;
fs/ceph/super.h +1 -1
@@ -1166,7 +1166,7 @@ static inline int ceph_do_getattr(struct inode *inode, int mask, bool force) {return __ceph_do_getattr (inode,NULL , mask, force); } -extern int ceph_permission (struct mnt_idmap *idmap, +extern int ceph_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);struct ceph_iattr {
fs/coda/coda_linux.h +1 -1
@@ -46,7 +46,7 @@ extern const struct file_operations coda_ioctl_operations;/* operations shared over more than one file */ int coda_open (struct inode *i,struct file *f);int coda_release (struct inode *i,struct file *f); -int coda_permission (struct mnt_idmap *idmap,struct inode *inode, +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 *,
fs/coda/dir.c +1 -1
@@ -73,7 +73,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsig } -int coda_permission (struct mnt_idmap *idmap,struct inode *inode, +int coda_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {int error;
fs/coda/pioctl.c +2 -2
@@ -24,7 +24,7 @@#include "coda_linux.h" /* pioctl ops */ -static int coda_ioctl_permission (struct mnt_idmap *idmap, +static int coda_ioctl_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);static long coda_pioctl (struct file *filp,unsigned int cmd,unsigned long user_data);
@@ -41,7 +41,7 @@ const struct file_operations coda_ioctl_operations = { };/* the coda pioctl inode ops */ -static int coda_ioctl_permission (struct mnt_idmap *idmap, +static int coda_ioctl_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {return (mask &MAY_EXEC ) ? -EACCES :0 ;
fs/ecryptfs/inode.c +1 -1
@@ -849,7 +849,7 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) }static int -ecryptfs_permission (struct mnt_idmap *idmap,struct inode *inode, +ecryptfs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) { return inode_permission(&nop_mnt_idmap,
fs/failfs.c +1 -1
@@ -22,7 +22,7 @@ bool failfs_mnt(const struct vfsmount *mnt)return mnt->mnt_sb == failfs_root_path.mnt->mnt_sb; } -static int failfs_permission (struct mnt_idmap *idmap,struct inode *inode, +static int failfs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {return -EOPNOTSUPP ;
fs/fuse/dir.c +1 -1
@@ -1763,7 +1763,7 @@ static int fuse_perm_getattr(struct inode *inode, int mask)* access request is sent. Execute permission is still checked * locally based on file mode. */ -static int fuse_permission (struct mnt_idmap *idmap, +static int fuse_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct fuse_conn *fc =get_fuse_conn (inode);
fs/gfs2/inode.c +1 -1
@@ -1963,7 +1963,7 @@ static const char *gfs2_get_link(struct dentry *dentry,* Returns: errno */ -int gfs2_permission (struct mnt_idmap *idmap,struct inode *inode, +int gfs2_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {int may_not_block = mask &MAY_NOT_BLOCK ;
fs/gfs2/inode.h +1 -1
@@ -97,7 +97,7 @@ int gfs2_dinode_dealloc(struct gfs2_inode *ip);struct inode *gfs2_lookupi (struct inode *dir,const struct qstr *name,int is_root); -int gfs2_permission (struct mnt_idmap *idmap, +int gfs2_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);struct inode *gfs2_lookup_meta (struct inode *dip,const char *name);void gfs2_dinode_out (const struct gfs2_inode *ip,void *buf);
fs/hostfs/hostfs_kern.c +1 -1
@@ -774,7 +774,7 @@ static int hostfs_rename2(struct mnt_idmap *idmap,return err; } -static int hostfs_permission (struct mnt_idmap *idmap, +static int hostfs_permission (const struct mnt_idmap *idmap,struct inode *ino,int desired) {char *name;
fs/internal.h +1 -1
@@ -55,7 +55,7 @@ extern int filename_lookup(int dfd, struct filename *name, unsigned flags, struct path *path, const struct path *root);int filename_rmdir (int dfd,struct filename *name);int filename_unlinkat (int dfd,struct filename *name); -int may_linkat (struct mnt_idmap *idmap,const struct path *link); +int may_linkat (const struct mnt_idmap *idmap,const struct path *link);int filename_renameat2 (int olddfd,struct filename *oldname,int newdfd,struct filename *newname,unsigned int flags);int filename_mkdirat (int dfd,struct filename *name,umode_t mode);
fs/kernfs/inode.c +1 -1
@@ -272,7 +272,7 @@ void kernfs_evict_inode(struct inode *inode)kernfs_put (kn); } -int kernfs_iop_permission (struct mnt_idmap *idmap, +int kernfs_iop_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct kernfs_node *kn;
fs/kernfs/kernfs-internal.h +1 -1
@@ -171,7 +171,7 @@ extern struct kmem_cache *kernfs_node_cache, *kernfs_iattrs_cache;*/ extern const struct xattr_handler *const kernfs_xattr_handlers[];void kernfs_evict_inode (struct inode *inode); -int kernfs_iop_permission (struct mnt_idmap *idmap, +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);
fs/namei.c +11 -11
@@ -371,7 +371,7 @@ struct filename *complete_getname(struct delayed_filename *v)* On non-idmapped mounts or if permission checking is to be performed on the * raw inode simply pass @nop_mnt_idmap. */ -static int check_acl (struct mnt_idmap *idmap, +static int check_acl (const struct mnt_idmap *idmap,struct inode *inode,int mask) {#ifdef CONFIG_FS_POSIX_ACL
@@ -435,7 +435,7 @@ static inline bool no_acl_inode(struct inode *inode)* On non-idmapped mounts or if permission checking is to be performed on the * raw inode simply pass @nop_mnt_idmap. */ -static int acl_permission_check (struct mnt_idmap *idmap, +static int acl_permission_check (const struct mnt_idmap *idmap,struct inode *inode,int mask) {unsigned int mode = inode->i_mode;
@@ -518,7 +518,7 @@ static int acl_permission_check(struct mnt_idmap *idmap,* On non-idmapped mounts or if permission checking is to be performed on the * raw inode simply pass @nop_mnt_idmap. */ -int generic_permission (struct mnt_idmap *idmap,struct inode *inode, +int generic_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {int ret;
@@ -575,7 +575,7 @@ EXPORT_SYMBOL(generic_permission);* flag in inode->i_opflags, that says "this has not special * permission function, use the fast case". */ -static inline int do_inode_permission (struct mnt_idmap *idmap, +static inline int do_inode_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {if (unlikely (!(inode->i_opflags &IOP_FASTPERM ))) {
@@ -625,7 +625,7 @@ static int sb_permission(struct super_block *sb, struct inode *inode, int mask)* * When checking for MAY_APPEND, MAY_WRITE must also be set in @mask. */ -int inode_permission (struct mnt_idmap *idmap, +int inode_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {int retval;
@@ -680,7 +680,7 @@ EXPORT_SYMBOL(inode_permission);* on IOP_FASTPERM can still get the optimization if they set IOP_FASTPERM_MAY_EXEC * on their directory inodes. */ -static __always_inline int lookup_inode_permission_may_exec(struct mnt_idmap *idmap, +static __always_inline int lookup_inode_permission_may_exec(const struct mnt_idmap *idmap,struct inode *inode,int mask) {/* Lookup already checked this to return -ENOTDIR */
@@ -1314,7 +1314,7 @@ static inline int may_follow_link(struct nameidata *nd, const struct inode *inod* * Otherwise returns true. */ -static bool safe_hardlink_source (struct mnt_idmap *idmap, +static bool safe_hardlink_source (const struct mnt_idmap *idmap,struct inode *inode) {umode_t mode = inode->i_mode;
@@ -1357,7 +1357,7 @@ static bool safe_hardlink_source(struct mnt_idmap *idmap,* * Returns 0 if successful, -ve on error. */ -int may_linkat (struct mnt_idmap *idmap,const struct path *link) +int may_linkat (const struct mnt_idmap *idmap,const struct path *link) {struct inode *inode = link->dentry->d_inode;
@@ -1952,7 +1952,7 @@ static struct dentry *lookup_slow_killable(const struct qstr *name,return res; } -static inline int may_lookup (struct mnt_idmap *idmap, +static inline int may_lookup (const struct mnt_idmap *idmap,struct nameidata *restrict nd) {int err, mask;
@@ -4228,7 +4228,7 @@ bool may_open_dev(const struct path *path) !(path->mnt->mnt_sb->s_iflags &SB_I_NODEV ); } -static int may_open (struct mnt_idmap *idmap,const struct path *path, +static int may_open (const struct mnt_idmap *idmap,const struct path *path,int acc_mode,int flag) {struct dentry *dentry = path->dentry;
@@ -4312,7 +4312,7 @@ static inline int open_to_namei_flags(int flag)return flag; } -static int may_o_create (struct mnt_idmap *idmap, +static int may_o_create (const struct mnt_idmap *idmap,const struct path *dir,struct dentry *dentry,umode_t mode) {
fs/nfs/dir.c +1 -1
@@ -3393,7 +3393,7 @@ static int nfs_execute_ok(struct inode *inode, int mask)return ret; } -int nfs_permission (struct mnt_idmap *idmap, +int nfs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {
fs/nilfs2/inode.c +1 -1
@@ -943,7 +943,7 @@ int nilfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,return err; } -int nilfs_permission (struct mnt_idmap *idmap,struct inode *inode, +int nilfs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct nilfs_root *root =NILFS_I (inode)->i_root;
fs/nilfs2/nilfs.h +1 -1
@@ -302,7 +302,7 @@ extern void nilfs_evict_inode(struct inode *);extern int nilfs_setattr (struct mnt_idmap *,struct dentry *,struct iattr *);extern void nilfs_write_failed (struct address_space *mapping,loff_t to); -int nilfs_permission (struct mnt_idmap *idmap,struct inode *inode, +int nilfs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);int nilfs_load_inode_block (struct inode *inode,struct buffer_head **pbh);extern int nilfs_inode_dirty (struct inode *);
fs/ocfs2/file.c +1 -1
@@ -1349,7 +1349,7 @@ int ocfs2_getattr(struct mnt_idmap *idmap, const struct path *path,return err; } -int ocfs2_permission (struct mnt_idmap *idmap,struct inode *inode, +int ocfs2_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {int ret, had_lock;
fs/ocfs2/file.h +1 -1
@@ -54,7 +54,7 @@ int ocfs2_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr);int ocfs2_getattr (struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); -int ocfs2_permission (struct mnt_idmap *idmap, +int ocfs2_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);
fs/orangefs/inode.c +1 -1
@@ -872,7 +872,7 @@ int orangefs_getattr(struct mnt_idmap *idmap, const struct path *path,return ret; } -int orangefs_permission (struct mnt_idmap *idmap, +int orangefs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {int ret;
fs/orangefs/orangefs-kernel.h +1 -1
@@ -357,7 +357,7 @@ int orangefs_setattr(struct mnt_idmap *, struct dentry *, struct iattr *);int orangefs_getattr (struct mnt_idmap *idmap,const struct path *path,struct kstat *stat,u32 request_mask,unsigned int flags); -int orangefs_permission (struct mnt_idmap *idmap, +int orangefs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask); int orangefs_update_time(struct inode *inode, enum fs_update_time type,
fs/overlayfs/inode.c +1 -1
@@ -303,7 +303,7 @@ int ovl_getattr(struct mnt_idmap *idmap, const struct path *path,return err; } -int ovl_permission (struct mnt_idmap *idmap, +int ovl_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct inode *upperinode =ovl_inode_upper (inode);
fs/overlayfs/overlayfs.h +1 -1
@@ -802,7 +802,7 @@ int ovl_set_nlink_lower(struct dentry *dentry);unsigned int ovl_get_nlink (struct ovl_fs *ofs,struct dentry *lowerdentry,struct dentry *upperdentry,unsigned int fallback); -int ovl_permission (struct mnt_idmap *idmap,struct inode *inode, +int ovl_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);#ifdef CONFIG_FS_POSIX_ACL
fs/proc/base.c +2 -2
@@ -743,7 +743,7 @@ static bool has_pid_permissions(struct proc_fs_info *fs_info, } -static int proc_pid_permission (struct mnt_idmap *idmap, +static int proc_pid_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct proc_fs_info *fs_info =proc_sb_info (inode->i_sb);
@@ -3607,7 +3607,7 @@ int proc_pid_readdir(struct file *file, struct dir_context *ctx)* This function makes sure that the node is always accessible for members of * same thread group. */ -static int proc_tid_comm_permission (struct mnt_idmap *idmap, +static int proc_tid_comm_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {bool is_same_tgroup;
fs/proc/fd.c +2 -2
@@ -82,7 +82,7 @@ static int seq_fdinfo_open(struct inode *inode, struct file *file)* that the current task has PTRACE_MODE_READ in addition to the normal * POSIX-like checks. */ -static int proc_fdinfo_permission (struct mnt_idmap *idmap,struct inode *inode, +static int proc_fdinfo_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {bool allowed = false;
@@ -323,7 +323,7 @@ static struct dentry *proc_lookupfd(struct inode *dir, struct dentry *dentry,* /proc/pid/fd needs a special permission handler so that a process can still * access /proc/self/fd after it has executed a setuid(). */ -int proc_fd_permission (struct mnt_idmap *idmap, +int proc_fd_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {struct task_struct *p;
fs/proc/fd.h +1 -1
@@ -10,7 +10,7 @@ extern const struct inode_operations proc_fd_inode_operations;extern const struct file_operations proc_fdinfo_operations;extern const struct inode_operations proc_fdinfo_inode_operations; -extern int proc_fd_permission (struct mnt_idmap *idmap, +extern int proc_fd_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask);static inline unsigned int proc_fd (struct inode *inode)
fs/proc/proc_sysctl.c +1 -1
@@ -788,7 +788,7 @@ static int proc_sys_readdir(struct file *file, struct dir_context *ctx)return 0 ; } -static int proc_sys_permission (struct mnt_idmap *idmap, +static int proc_sys_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {/*
fs/smb/client/cifsfs.c +1 -1
@@ -402,7 +402,7 @@ static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len)return rc; } -static int cifs_permission (struct mnt_idmap *idmap, +static int cifs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {unsigned int sbflags =cifs_sb_flags (CIFS_SB (inode));
fs/smb/server/vfs.c +1 -1
@@ -115,7 +115,7 @@ static int ksmbd_vfs_path_lookup(struct ksmbd_share_config *share_conf,return 0 ; } -void ksmbd_vfs_query_maximal_access (struct mnt_idmap *idmap, +void ksmbd_vfs_query_maximal_access (const struct mnt_idmap *idmap,struct dentry *dentry,__le32 *daccess) { *daccess =cpu_to_le32 (FILE_READ_ATTRIBUTES |READ_CONTROL );
fs/smb/server/vfs.h +1 -1
@@ -74,7 +74,7 @@ struct ksmbd_kstat { };int ksmbd_vfs_lock_parent (struct dentry *parent,struct dentry *child); -void ksmbd_vfs_query_maximal_access (struct mnt_idmap *idmap, +void ksmbd_vfs_query_maximal_access (const struct mnt_idmap *idmap,struct dentry *dentry,__le32 *daccess);int ksmbd_vfs_create (struct ksmbd_work *work,const char *name,umode_t mode);int ksmbd_vfs_mkdir (struct ksmbd_work *work,const char *name,umode_t mode);
fs/tracefs/inode.c +1 -1
@@ -189,7 +189,7 @@ static void set_tracefs_inode_owner(struct inode *inode) inode->i_gid = gid; } -static int tracefs_permission (struct mnt_idmap *idmap, +static int tracefs_permission (const struct mnt_idmap *idmap,struct inode *inode,int mask) {set_tracefs_inode_owner (inode);
include/linux/fs.h +4 -4
@@ -1994,7 +1994,7 @@ enum fs_update_time {struct inode_operations {struct dentry * (*lookup) (struct inode *,struct dentry *,unsigned int );const char * (*get_link) (struct dentry *,struct inode *,struct delayed_call *); -int (*permission) (struct mnt_idmap *,struct inode *,int ); +int (*permission) (const struct mnt_idmap *,struct inode *,int );struct posix_acl * (*get_inode_acl)(struct inode *,int ,bool );int (*readlink) (struct dentry *,char __user *,int );
@@ -2709,8 +2709,8 @@ static inline int bmap(struct inode *inode, sector_t *block)int notify_change (struct mnt_idmap *,struct dentry *,struct iattr *,struct delegated_inode *); -int inode_permission (struct mnt_idmap *,struct inode *,int ); -int generic_permission (struct mnt_idmap *,struct inode *,int ); +int inode_permission (const struct mnt_idmap *,struct inode *,int ); +int generic_permission (const struct mnt_idmap *,struct inode *,int );static inline int file_permission (struct file *file,int mask) { return inode_permission(file_mnt_idmap(file),
@@ -3397,7 +3397,7 @@ static inline bool generic_ci_validate_strict_name(struct inode *dir, }#endif -int may_setattr (struct mnt_idmap *idmap,struct inode *inode, +int may_setattr (const struct mnt_idmap *idmap,struct inode *inode,unsigned int ia_valid);int setattr_prepare (struct mnt_idmap *,struct dentry *,struct iattr *);extern int inode_newsize_ok (const struct inode *,loff_t offset);
include/linux/nfs_fs.h +1 -1
@@ -441,7 +441,7 @@ extern int nfs_getattr(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 ); -extern int nfs_permission (struct mnt_idmap *,struct inode *,int ); +extern int nfs_permission (const struct mnt_idmap *,struct inode *,int );extern int nfs_open (struct inode *,struct file *);extern int nfs_attribute_cache_expired (struct inode *inode);extern int nfs_revalidate_inode (struct inode *inode,unsigned long flags);
security/selinux/selinuxfs.c +1 -1
@@ -1782,7 +1782,7 @@ static struct dentry *sel_make_dir(struct dentry *dir, const char *name,return sel_attach (dir, name, inode); } -static int reject_all (struct mnt_idmap *idmap,struct inode *inode,int mask) +static int reject_all (const struct mnt_idmap *idmap,struct inode *inode,int mask) {return -EPERM ;// no access for anyone, root or no root. }
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 13/27 fs: port xattr to 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 +- fs/9p/xattr.c | 2 +- fs/afs/xattr.c | 4 ++-- fs/attr.c | 2 +- fs/btrfs/xattr.c | 6 +++--- fs/ceph/xattr.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ext2/xattr_security.c | 2 +- fs/ext2/xattr_trusted.c | 2 +- fs/ext2/xattr_user.c | 2 +- fs/ext4/xattr_hurd.c | 2 +- fs/ext4/xattr_security.c | 2 +- fs/ext4/xattr_trusted.c | 2 +- fs/ext4/xattr_user.c | 2 +- fs/f2fs/xattr.c | 4 ++-- fs/fuse/dir.c | 2 +- fs/fuse/fuse_i.h | 2 +- fs/fuse/xattr.c | 2 +- fs/gfs2/xattr.c | 2 +- fs/hfs/attr.c | 2 +- fs/hfsplus/xattr.c | 2 +- fs/hfsplus/xattr_security.c | 2 +- fs/hfsplus/xattr_trusted.c | 2 +- fs/hfsplus/xattr_user.c | 2 +- fs/jffs2/security.c | 2 +- fs/jffs2/xattr_trusted.c | 2 +- fs/jffs2/xattr_user.c | 2 +- fs/jfs/xattr.c | 4 ++-- fs/kernfs/inode.c | 4 ++-- fs/nfs/nfs4proc.c | 10 +++++----- fs/ntfs/ea.c | 2 +- fs/ntfs3/xattr.c | 2 +- fs/ocfs2/xattr.c | 6 +++--- fs/orangefs/xattr.c | 2 +- fs/overlayfs/xattrs.c | 4 ++-- fs/pidfs.c | 2 +- fs/smb/client/xattr.c | 2 +- fs/smb/server/vfs.c | 24 ++++++++++++------------ fs/smb/server/vfs.h | 20 ++++++++++---------- fs/ubifs/xattr.c | 2 +- fs/xattr.c | 22 +++++++++++----------- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_xattr.c | 2 +- include/linux/capability.h | 4 ++-- include/linux/fs.h | 2 +- include/linux/lsm_hook_defs.h | 8 ++++---- include/linux/security.h | 20 ++++++++++---------- include/linux/xattr.h | 20 ++++++++++---------- kernel/bpf/inode.c | 2 +- mm/shmem.c | 2 +- net/socket.c | 4 ++-- security/commoncap.c | 8 ++++---- security/integrity/evm/evm_main.c | 4 ++-- security/integrity/ima/ima_appraise.c | 4 ++-- security/security.c | 8 ++++---- security/selinux/hooks.c | 6 +++--- security/smack/smack_lsm.c | 6 +++--- 57 files changed, 135 insertions(+), 135 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -148,7 +148,7 @@ prototypes:: struct inode *inode, const char *name, void *buffer, size_t size); int (*set)(const struct xattr_handler *handler, - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct dentry *dentry, struct inode *inode, const char *name, const void *buffer, size_t size, int flags);
fs/9p/xattr.c +1 -1
@@ -153,7 +153,7 @@ static int v9fs_xattr_handler_get(const struct xattr_handler *handler, }static int v9fs_xattr_handler_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/afs/xattr.c +2 -2
@@ -97,7 +97,7 @@ static const struct afs_operation_ops afs_store_acl_operation = {* Set a file's AFS3 ACL. */ static int afs_xattr_set_acl (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
@@ -228,7 +228,7 @@ static const struct afs_operation_ops yfs_store_opaque_acl2_operation = {* Set a file's YFS ACL. */ static int afs_xattr_set_yfs (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/attr.c +1 -1
@@ -158,7 +158,7 @@ static bool chgrp_ok(const struct mnt_idmap *idmap,* Should be called as the first thing in ->setattr implementations, * possibly after taking additional locks. */ -int setattr_prepare (struct mnt_idmap *idmap,struct dentry *dentry, +int setattr_prepare (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {struct inode *inode =d_inode (dentry);
fs/btrfs/xattr.c +3 -3
@@ -353,7 +353,7 @@ static int btrfs_xattr_handler_get(const struct xattr_handler *handler, }static int btrfs_xattr_handler_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
@@ -395,7 +395,7 @@ static int btrfs_xattr_handler_get_security(const struct xattr_handler *handler, } static int btrfs_xattr_handler_set_security(const struct xattr_handler *handler, - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct dentry *unused, struct inode *inode, const char *name,
@@ -413,7 +413,7 @@ static int btrfs_xattr_handler_set_security(const struct xattr_handler *handler, }static int btrfs_xattr_handler_set_prop (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ceph/xattr.c +1 -1
@@ -1352,7 +1352,7 @@ static int ceph_get_xattr_handler(const struct xattr_handler *handler, }static int ceph_set_xattr_handler (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ecryptfs/inode.c +1 -1
@@ -1158,7 +1158,7 @@ static int ecryptfs_xattr_get(const struct xattr_handler *handler, }static int ecryptfs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ext2/xattr_security.c +1 -1
@@ -19,7 +19,7 @@ ext2_xattr_security_get(const struct xattr_handler *handler,static int ext2_xattr_security_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ext2/xattr_trusted.c +1 -1
@@ -26,7 +26,7 @@ ext2_xattr_trusted_get(const struct xattr_handler *handler,static int ext2_xattr_trusted_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ext2/xattr_user.c +1 -1
@@ -30,7 +30,7 @@ ext2_xattr_user_get(const struct xattr_handler *handler,static int ext2_xattr_user_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ext4/xattr_hurd.c +1 -1
@@ -32,7 +32,7 @@ ext4_xattr_hurd_get(const struct xattr_handler *handler,static int ext4_xattr_hurd_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ext4/xattr_security.c +1 -1
@@ -23,7 +23,7 @@ ext4_xattr_security_get(const struct xattr_handler *handler,static int ext4_xattr_security_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ext4/xattr_trusted.c +1 -1
@@ -30,7 +30,7 @@ ext4_xattr_trusted_get(const struct xattr_handler *handler,static int ext4_xattr_trusted_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/ext4/xattr_user.c +1 -1
@@ -31,7 +31,7 @@ ext4_xattr_user_get(const struct xattr_handler *handler,static int ext4_xattr_user_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/f2fs/xattr.c +2 -2
@@ -67,7 +67,7 @@ static int f2fs_xattr_generic_get(const struct xattr_handler *handler, }static int f2fs_xattr_generic_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
@@ -111,7 +111,7 @@ static int f2fs_xattr_advise_get(const struct xattr_handler *handler, }static int f2fs_xattr_advise_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/fuse/dir.c +1 -1
@@ -2143,7 +2143,7 @@ int fuse_flush_times(struct inode *inode, struct fuse_file *ff)* vmtruncate() doesn't allow for this case, so do the rlimit checking * and the actual truncation by hand. */ -int fuse_do_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int fuse_do_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr,struct file *file) {struct inode *inode =d_inode (dentry);
fs/fuse/fuse_i.h +1 -1
@@ -1189,7 +1189,7 @@ bool fuse_write_update_attr(struct inode *inode, loff_t pos, ssize_t written);int fuse_flush_times (struct inode *inode,struct fuse_file *ff);int fuse_write_inode (struct inode *inode,struct writeback_control *wbc); -int fuse_do_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +int fuse_do_setattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr,struct file *file);void fuse_unlock_inode (struct inode *inode,bool locked);
fs/fuse/xattr.c +1 -1
@@ -188,7 +188,7 @@ static int fuse_xattr_get(const struct xattr_handler *handler, }static int fuse_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/gfs2/xattr.c +1 -1
@@ -1229,7 +1229,7 @@ int __gfs2_xattr_set(struct inode *inode, const char *name, }static int gfs2_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/hfs/attr.c +1 -1
@@ -121,7 +121,7 @@ static int hfs_xattr_get(const struct xattr_handler *handler, }static int hfs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/hfsplus/xattr.c +1 -1
@@ -1008,7 +1008,7 @@ static int hfsplus_osx_getxattr(const struct xattr_handler *handler, }static int hfsplus_osx_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/hfsplus/xattr_security.c +1 -1
@@ -23,7 +23,7 @@ static int hfsplus_security_getxattr(const struct xattr_handler *handler, }static int hfsplus_security_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/hfsplus/xattr_trusted.c +1 -1
@@ -22,7 +22,7 @@ static int hfsplus_trusted_getxattr(const struct xattr_handler *handler, }static int hfsplus_trusted_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/hfsplus/xattr_user.c +1 -1
@@ -22,7 +22,7 @@ static int hfsplus_user_getxattr(const struct xattr_handler *handler, }static int hfsplus_user_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/jffs2/security.c +1 -1
@@ -57,7 +57,7 @@ static int jffs2_security_getxattr(const struct xattr_handler *handler, }static int jffs2_security_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/jffs2/xattr_trusted.c +1 -1
@@ -25,7 +25,7 @@ static int jffs2_trusted_getxattr(const struct xattr_handler *handler, }static int jffs2_trusted_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/jffs2/xattr_user.c +1 -1
@@ -25,7 +25,7 @@ static int jffs2_user_getxattr(const struct xattr_handler *handler, }static int jffs2_user_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *buffer,size_t size,int flags)
fs/jfs/xattr.c +2 -2
@@ -956,7 +956,7 @@ static int jfs_xattr_get(const struct xattr_handler *handler, }static int jfs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
@@ -975,7 +975,7 @@ static int jfs_xattr_get_os2(const struct xattr_handler *handler, }static int jfs_xattr_set_os2 (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/kernfs/inode.c +2 -2
@@ -344,7 +344,7 @@ static int kernfs_vfs_xattr_get(const struct xattr_handler *handler, }static int kernfs_vfs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *suffix,const void *value,size_t size,int flags)
@@ -356,7 +356,7 @@ static int kernfs_vfs_xattr_set(const struct xattr_handler *handler, }static int kernfs_vfs_user_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *suffix,const void *value,size_t size,int flags)
fs/nfs/nfs4proc.c +5 -5
@@ -7866,7 +7866,7 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state,#define XATTR_NAME_NFSV4_ACL "system.nfs4_acl"static int nfs4_xattr_set_nfs4_acl (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *key,const void *buf,size_t buflen,int flags)
@@ -7889,7 +7889,7 @@ static bool nfs4_xattr_list_nfs4_acl(struct dentry *dentry)#define XATTR_NAME_NFSV4_DACL "system.nfs4_dacl"static int nfs4_xattr_set_nfs4_dacl (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *key,const void *buf,size_t buflen,int flags)
@@ -7912,7 +7912,7 @@ static bool nfs4_xattr_list_nfs4_dacl(struct dentry *dentry)#define XATTR_NAME_NFSV4_SACL "system.nfs4_sacl"static int nfs4_xattr_set_nfs4_sacl (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *key,const void *buf,size_t buflen,int flags)
@@ -7935,7 +7935,7 @@ static bool nfs4_xattr_list_nfs4_sacl(struct dentry *dentry)#ifdef CONFIG_NFS_V4_SECURITY_LABEL static int nfs4_xattr_set_nfs4_label (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *key,const void *buf,size_t buflen,int flags)
@@ -7965,7 +7965,7 @@ static const struct xattr_handler nfs4_xattr_nfs4_label_handler = {#ifdef CONFIG_NFS_V4_2 static int nfs4_xattr_set_nfs4_user (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *key,const void *buf,size_t buflen,int flags)
fs/ntfs/ea.c +1 -1
@@ -852,7 +852,7 @@ static int ntfs_validate_fattr(struct ntfs_inode *ni, __le32 fattr) }static int ntfs_setxattr (const struct xattr_handler *handler, -struct mnt_idmap *idmap,struct dentry *unused, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags) {
fs/ntfs3/xattr.c +1 -1
@@ -863,7 +863,7 @@ static bool ntfs_is_reserved_lxattr(const char *name)* ntfs_setxattr - inode_operations::setxattr */ static noinline int ntfs_setxattr(const struct xattr_handler *handler, -struct mnt_idmap *idmap,struct dentry *de, +const struct mnt_idmap *idmap,struct dentry *de,struct inode *inode,const char *name,const void *value,size_t size,int flags) {
fs/ocfs2/xattr.c +3 -3
@@ -7503,7 +7503,7 @@ static int ocfs2_xattr_security_get(const struct xattr_handler *handler, }static int ocfs2_xattr_security_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
@@ -7598,7 +7598,7 @@ static int ocfs2_xattr_trusted_get(const struct xattr_handler *handler, }static int ocfs2_xattr_trusted_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
@@ -7629,7 +7629,7 @@ static int ocfs2_xattr_user_get(const struct xattr_handler *handler, }static int ocfs2_xattr_user_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/orangefs/xattr.c +1 -1
@@ -527,7 +527,7 @@ ssize_t orangefs_listxattr(struct dentry *dentry, char *buffer, size_t size) } static int orangefs_xattr_set_default(const struct xattr_handler *handler, - struct mnt_idmap *idmap, + const struct mnt_idmap *idmap, struct dentry *unused, struct inode *inode, const char *name,
fs/overlayfs/xattrs.c +2 -2
@@ -190,7 +190,7 @@ static int ovl_own_xattr_get(const struct xattr_handler *handler, }static int ovl_own_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags)
@@ -217,7 +217,7 @@ static int ovl_other_xattr_get(const struct xattr_handler *handler, }static int ovl_other_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/pidfs.c +1 -1
@@ -1102,7 +1102,7 @@ static int pidfs_xattr_get(const struct xattr_handler *handler, }static int pidfs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap,struct dentry *unused, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *suffix,const void *value,size_t size,int flags) {
fs/smb/client/xattr.c +1 -1
@@ -91,7 +91,7 @@ static int cifs_creation_time_set(unsigned int xid, struct cifs_tcon *pTcon, }static int cifs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/smb/server/vfs.c +12 -12
@@ -216,7 +216,7 @@ int ksmbd_vfs_mkdir(struct ksmbd_work *work, const char *name, umode_t mode)return err; } -static ssize_t ksmbd_vfs_getcasexattr (struct mnt_idmap *idmap, +static ssize_t ksmbd_vfs_getcasexattr (const struct mnt_idmap *idmap,struct dentry *dentry,char *attr_name,int attr_name_len,char **attr_value) {
@@ -841,7 +841,7 @@ ssize_t ksmbd_vfs_listxattr(struct dentry *dentry, char **list)return size; } -static ssize_t ksmbd_vfs_xattr_len (struct mnt_idmap *idmap, +static ssize_t ksmbd_vfs_xattr_len (const struct mnt_idmap *idmap,struct dentry *dentry,char *xattr_name) {return vfs_getxattr (idmap, dentry, xattr_name,NULL ,0 );
@@ -856,7 +856,7 @@ static ssize_t ksmbd_vfs_xattr_len(struct mnt_idmap *idmap,* * Return: read xattr value length on success, otherwise error */ -ssize_t ksmbd_vfs_getxattr (struct mnt_idmap *idmap, +ssize_t ksmbd_vfs_getxattr (const struct mnt_idmap *idmap,struct dentry *dentry,char *xattr_name,char **xattr_buf) {
@@ -893,7 +893,7 @@ ssize_t ksmbd_vfs_getxattr(struct mnt_idmap *idmap,* * Return: 0 on success, otherwise error */ -int ksmbd_vfs_setxattr (struct mnt_idmap *idmap, +int ksmbd_vfs_setxattr (const struct mnt_idmap *idmap,const struct path *path,const char *attr_name,void *attr_value,size_t attr_size,int flags,bool get_write)
@@ -1177,7 +1177,7 @@ int ksmbd_vfs_query_allocated_ranges(struct ksmbd_file *fp, loff_t start,return ret; } -int ksmbd_vfs_remove_xattr (struct mnt_idmap *idmap, +int ksmbd_vfs_remove_xattr (const struct mnt_idmap *idmap,const struct path *path,char *attr_name,bool get_write) {
@@ -1511,7 +1511,7 @@ int ksmbd_vfs_remove_acl_xattrs(struct mnt_idmap *idmap,return err; } -int ksmbd_vfs_remove_sd_xattrs (struct mnt_idmap *idmap,const struct path *path) +int ksmbd_vfs_remove_sd_xattrs (const struct mnt_idmap *idmap,const struct path *path) {char *name, *xattr_list =NULL ;ssize_t xattr_list_len;
@@ -1606,7 +1606,7 @@ static struct xattr_smb_acl *ksmbd_vfs_make_xattr_posix_acl(const struct mnt_idm }int ksmbd_vfs_set_sd_xattr (struct ksmbd_conn *conn, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,const struct path *path,struct smb_ntsd *pntsd,int len,bool get_write)
@@ -1673,7 +1673,7 @@ int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn, }int ksmbd_vfs_get_sd_xattr (struct ksmbd_conn *conn, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct smb_ntsd **pntsd) {
@@ -1742,7 +1742,7 @@ int ksmbd_vfs_get_sd_xattr(struct ksmbd_conn *conn,return rc; } -int ksmbd_vfs_set_dos_attrib_xattr (struct mnt_idmap *idmap, +int ksmbd_vfs_set_dos_attrib_xattr (const struct mnt_idmap *idmap,const struct path *path,struct xattr_dos_attrib *da,bool get_write)
@@ -1764,7 +1764,7 @@ int ksmbd_vfs_set_dos_attrib_xattr(struct mnt_idmap *idmap,return err; } -int ksmbd_vfs_get_dos_attrib_xattr (struct mnt_idmap *idmap, +int ksmbd_vfs_get_dos_attrib_xattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct xattr_dos_attrib *da) {
@@ -1820,7 +1820,7 @@ void *ksmbd_vfs_init_kstat(char **p, struct ksmbd_kstat *ksmbd_kstat) }int ksmbd_vfs_fill_dentry_attrs (struct ksmbd_work *work, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct ksmbd_kstat *ksmbd_kstat) {
@@ -1895,7 +1895,7 @@ int ksmbd_vfs_fill_dentry_attrs(struct ksmbd_work *work,return 0 ; } -ssize_t ksmbd_vfs_casexattr_len (struct mnt_idmap *idmap, +ssize_t ksmbd_vfs_casexattr_len (const struct mnt_idmap *idmap,struct dentry *dentry,char *attr_name,int attr_name_len) {
fs/smb/server/vfs.h +10 -10
@@ -104,20 +104,20 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work,unsigned int *chunk_size_written, loff_t *total_size_written);ssize_t ksmbd_vfs_listxattr (struct dentry *dentry,char **list); -ssize_t ksmbd_vfs_getxattr (struct mnt_idmap *idmap, +ssize_t ksmbd_vfs_getxattr (const struct mnt_idmap *idmap,struct dentry *dentry,char *xattr_name,char **xattr_buf); -ssize_t ksmbd_vfs_casexattr_len (struct mnt_idmap *idmap, +ssize_t ksmbd_vfs_casexattr_len (const struct mnt_idmap *idmap,struct dentry *dentry,char *attr_name,int attr_name_len); -int ksmbd_vfs_setxattr (struct mnt_idmap *idmap, +int ksmbd_vfs_setxattr (const struct mnt_idmap *idmap,const struct path *path,const char *attr_name,void *attr_value,size_t attr_size,int flags,bool get_write);int ksmbd_vfs_xattr_stream_name (char *stream_name,char **xattr_stream_name,size_t *xattr_stream_name_size,int s_type); -int ksmbd_vfs_remove_xattr (struct mnt_idmap *idmap, +int ksmbd_vfs_remove_xattr (const struct mnt_idmap *idmap,const struct path *path,char *attr_name,bool get_write); int ksmbd_vfs_kern_path(struct ksmbd_work *work, char *name,
@@ -147,28 +147,28 @@ int ksmbd_vfs_query_allocated_ranges(struct ksmbd_file *fp, loff_t start,int ksmbd_vfs_unlink (struct file *filp);void *ksmbd_vfs_init_kstat (char **p,struct ksmbd_kstat *ksmbd_kstat);int ksmbd_vfs_fill_dentry_attrs (struct ksmbd_work *work, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct ksmbd_kstat *ksmbd_kstat);void ksmbd_vfs_posix_lock_wait (struct file_lock *flock);void ksmbd_vfs_posix_lock_unblock (struct file_lock *flock);int ksmbd_vfs_remove_acl_xattrs (struct mnt_idmap *idmap,const struct path *path); -int ksmbd_vfs_remove_sd_xattrs (struct mnt_idmap *idmap,const struct path *path); +int ksmbd_vfs_remove_sd_xattrs (const struct mnt_idmap *idmap,const struct path *path);int ksmbd_vfs_set_sd_xattr (struct ksmbd_conn *conn, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,const struct path *path,struct smb_ntsd *pntsd,int len,bool get_write);int ksmbd_vfs_get_sd_xattr (struct ksmbd_conn *conn, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct smb_ntsd **pntsd); -int ksmbd_vfs_set_dos_attrib_xattr (struct mnt_idmap *idmap, +int ksmbd_vfs_set_dos_attrib_xattr (const struct mnt_idmap *idmap,const struct path *path,struct xattr_dos_attrib *da,bool get_write); -int ksmbd_vfs_get_dos_attrib_xattr (struct mnt_idmap *idmap, +int ksmbd_vfs_get_dos_attrib_xattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct xattr_dos_attrib *da); int ksmbd_vfs_set_init_posix_acl(struct mnt_idmap *idmap,
fs/ubifs/xattr.c +1 -1
@@ -660,7 +660,7 @@ static int xattr_get(const struct xattr_handler *handler, }static int xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags)
fs/xattr.c +11 -11
@@ -123,7 +123,7 @@ static inline int xattr_permission_error(int mask)* because different namespaces have very different rules. */ static int -xattr_permission (struct mnt_idmap *idmap,struct inode *inode, +xattr_permission (const struct mnt_idmap *idmap,struct inode *inode,const char *name,int mask) {if (mask &MAY_WRITE ) {
@@ -204,7 +204,7 @@ xattr_supports_user_prefix(struct inode *inode)EXPORT_SYMBOL (xattr_supports_user_prefix);int -__vfs_setxattr (struct mnt_idmap *idmap,struct dentry *dentry, +__vfs_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *value,size_t size,int flags) {
@@ -242,7 +242,7 @@ EXPORT_SYMBOL(__vfs_setxattr);* is executed. It also assumes that the caller will make the appropriate * permission checks. */ -int __vfs_setxattr_noperm (struct mnt_idmap *idmap, +int __vfs_setxattr_noperm (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags) {
@@ -295,7 +295,7 @@ int __vfs_setxattr_noperm(struct mnt_idmap *idmap,* a delegation was broken on, NULL if none. */ int -__vfs_setxattr_locked (struct mnt_idmap *idmap,struct dentry *dentry, +__vfs_setxattr_locked (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags,struct delegated_inode *delegated_inode) {
@@ -324,7 +324,7 @@ __vfs_setxattr_locked(struct mnt_idmap *idmap, struct dentry *dentry,EXPORT_SYMBOL_GPL (__vfs_setxattr_locked);int -vfs_setxattr (struct mnt_idmap *idmap,struct dentry *dentry, +vfs_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags) {struct inode *inode = dentry->d_inode;
@@ -358,7 +358,7 @@ vfs_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,EXPORT_SYMBOL_GPL (vfs_setxattr);static ssize_t -xattr_getsecurity (struct mnt_idmap *idmap,struct inode *inode, +xattr_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void *value,size_t size) {void *buffer =NULL ;
@@ -395,7 +395,7 @@ xattr_getsecurity(struct mnt_idmap *idmap, struct inode *inode,* Returns the result of alloc, if failed, or the getxattr operation. */ int -vfs_getxattr_alloc (struct mnt_idmap *idmap,struct dentry *dentry, +vfs_getxattr_alloc (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,char **xattr_value,size_t xattr_size,gfp_t flags) {
@@ -448,7 +448,7 @@ __vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,EXPORT_SYMBOL (__vfs_getxattr);ssize_t -vfs_getxattr (struct mnt_idmap *idmap,struct dentry *dentry, +vfs_getxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,void *value,size_t size) {struct inode *inode = dentry->d_inode;
@@ -527,7 +527,7 @@ vfs_listxattr(struct dentry *dentry, char *list, size_t size)EXPORT_SYMBOL_GPL (vfs_listxattr);int -__vfs_removexattr (struct mnt_idmap *idmap,struct dentry *dentry, +__vfs_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name) {struct inode *inode =d_inode (dentry);
@@ -557,7 +557,7 @@ EXPORT_SYMBOL(__vfs_removexattr);* a delegation was broken on, NULL if none. */ int -__vfs_removexattr_locked (struct mnt_idmap *idmap, +__vfs_removexattr_locked (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,struct delegated_inode *delegated_inode) {
@@ -589,7 +589,7 @@ __vfs_removexattr_locked(struct mnt_idmap *idmap,EXPORT_SYMBOL_GPL (__vfs_removexattr_locked);int -vfs_removexattr (struct mnt_idmap *idmap,struct dentry *dentry, +vfs_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name) {struct inode *inode = dentry->d_inode;
fs/xfs/xfs_iops.c +1 -1
@@ -754,7 +754,7 @@ xfs_vn_getattr(static int xfs_vn_change_ok ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {
fs/xfs/xfs_xattr.c +1 -1
@@ -169,7 +169,7 @@ xfs_xattr_flags_to_op(static int xfs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap,struct dentry *unused, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags) {
include/linux/capability.h +2 -2
@@ -210,11 +210,11 @@ static inline bool checkpoint_restore_ns_capable_noaudit(struct user_namespace * }/* audit system wants to get cap info from files as well */ -int get_vfs_caps_from_disk (struct mnt_idmap *idmap, +int get_vfs_caps_from_disk (const struct mnt_idmap *idmap,const struct dentry *dentry,struct cpu_vfs_cap_data *cpu_caps); -int cap_convert_nscap (struct mnt_idmap *idmap,struct dentry *dentry, +int cap_convert_nscap (const struct mnt_idmap *idmap,struct dentry *dentry,const void **ivalue,size_t size);#endif /* !_LINUX_CAPABILITY_H */
include/linux/fs.h +1 -1
@@ -3399,7 +3399,7 @@ static inline bool generic_ci_validate_strict_name(struct inode *dir,int may_setattr (const struct mnt_idmap *idmap,struct inode *inode,unsigned int ia_valid); -int setattr_prepare (struct mnt_idmap *,struct dentry *,struct iattr *); +int setattr_prepare (const struct mnt_idmap *,struct dentry *,struct iattr *);extern int inode_newsize_ok (const struct inode *,loff_t offset);void setattr_copy (const struct mnt_idmap *,struct inode *inode,const struct iattr *attr);
include/linux/lsm_hook_defs.h +4 -4
@@ -146,14 +146,14 @@ LSM_HOOK(void, LSM_RET_VOID, inode_post_setattr, 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) -LSM_HOOK(int, 0, inode_setxattr, struct mnt_idmap *idmap, +LSM_HOOK(int, 0, inode_setxattr, const struct mnt_idmap *idmap, struct dentry *dentry, const char *name, const void *value, size_t size, int flags) LSM_HOOK(void, LSM_RET_VOID, inode_post_setxattr, struct dentry *dentry, const char *name, const void *value, size_t size, int flags) LSM_HOOK(int, 0, inode_getxattr, struct dentry *dentry, const char *name) LSM_HOOK(int, 0, inode_listxattr, struct dentry *dentry) -LSM_HOOK(int, 0, inode_removexattr, struct mnt_idmap *idmap, +LSM_HOOK(int, 0, inode_removexattr, const struct mnt_idmap *idmap, struct dentry *dentry, const char *name) LSM_HOOK(void, LSM_RET_VOID, inode_post_removexattr, struct dentry *dentry, const char *name)
@@ -170,9 +170,9 @@ LSM_HOOK(int, 0, inode_remove_acl, const struct mnt_idmap *idmap, LSM_HOOK(void, LSM_RET_VOID, inode_post_remove_acl, const struct mnt_idmap *idmap, struct dentry *dentry, const char *acl_name) LSM_HOOK(int, 0, inode_need_killpriv, struct dentry *dentry) -LSM_HOOK(int, 0, inode_killpriv, struct mnt_idmap *idmap, +LSM_HOOK(int, 0, inode_killpriv, const struct mnt_idmap *idmap, struct dentry *dentry) -LSM_HOOK(int, -EOPNOTSUPP, inode_getsecurity, struct mnt_idmap *idmap, +LSM_HOOK(int, -EOPNOTSUPP, inode_getsecurity, const struct mnt_idmap *idmap, struct inode *inode, const char *name, void **buffer, bool alloc) LSM_HOOK(int, -EOPNOTSUPP, inode_setsecurity, struct inode *inode, const char *name, const void *value, size_t size, int flags)
include/linux/security.h +10 -10
@@ -188,8 +188,8 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name,int cap_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name);int cap_inode_need_killpriv (struct dentry *dentry); -int cap_inode_killpriv (struct mnt_idmap *idmap,struct dentry *dentry); -int cap_inode_getsecurity (struct mnt_idmap *idmap, +int cap_inode_killpriv (const struct mnt_idmap *idmap,struct dentry *dentry); +int cap_inode_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void **buffer,bool alloc);extern int cap_mmap_addr (unsigned long addr);
@@ -427,7 +427,7 @@ int security_inode_setattr(struct mnt_idmap *idmap,void security_inode_post_setattr (struct mnt_idmap *idmap,struct dentry *dentry,int ia_valid);int security_inode_getattr (const struct path *path); -int security_inode_setxattr (struct mnt_idmap *idmap, +int security_inode_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags); int security_inode_set_acl(const struct mnt_idmap *idmap,
@@ -446,7 +446,7 @@ void security_inode_post_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags);int security_inode_getxattr (struct dentry *dentry,const char *name);int security_inode_listxattr (struct dentry *dentry); -int security_inode_removexattr (struct mnt_idmap *idmap, +int security_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name);void security_inode_post_removexattr (struct dentry *dentry,const char *name); int security_inode_file_setattr(struct dentry *dentry,
@@ -454,8 +454,8 @@ int security_inode_file_setattr(struct dentry *dentry,int security_inode_file_getattr (struct dentry *dentry,struct file_kattr *fa);int security_inode_need_killpriv (struct dentry *dentry); -int security_inode_killpriv (struct mnt_idmap *idmap,struct dentry *dentry); -int security_inode_getsecurity (struct mnt_idmap *idmap, +int security_inode_killpriv (const struct mnt_idmap *idmap,struct dentry *dentry); +int security_inode_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void **buffer,bool alloc);int security_inode_setsecurity (struct inode *inode,const char *name,const void *value,size_t size,int flags);
@@ -996,7 +996,7 @@ static inline int security_inode_getattr(const struct path *path)return 0 ; } -static inline int security_inode_setxattr (struct mnt_idmap *idmap, +static inline int security_inode_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags) {
@@ -1050,7 +1050,7 @@ static inline int security_inode_listxattr(struct dentry *dentry)return 0 ; } -static inline int security_inode_removexattr (struct mnt_idmap *idmap, +static inline int security_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name) {
@@ -1078,13 +1078,13 @@ static inline int security_inode_need_killpriv(struct dentry *dentry)return cap_inode_need_killpriv (dentry); } -static inline int security_inode_killpriv (struct mnt_idmap *idmap, +static inline int security_inode_killpriv (const struct mnt_idmap *idmap,struct dentry *dentry) {return cap_inode_killpriv (idmap, dentry); } -static inline int security_inode_getsecurity (struct mnt_idmap *idmap, +static inline int security_inode_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void **buffer,bool alloc)
include/linux/xattr.h +10 -10
@@ -47,7 +47,7 @@ struct xattr_handler { struct inode *inode, const char *name, void *buffer, size_t size);int (*set)(const struct xattr_handler *, -struct mnt_idmap *idmap,struct dentry *dentry, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *name,const void *buffer,size_t size,int flags); };
@@ -77,25 +77,25 @@ struct xattr { };ssize_t __vfs_getxattr (struct dentry *,struct inode *,const char *,void *,size_t ); -ssize_t vfs_getxattr (struct mnt_idmap *,struct dentry *,const char *, +ssize_t vfs_getxattr (const struct mnt_idmap *,struct dentry *,const char *,void *,size_t );ssize_t vfs_listxattr (struct dentry *d,char *list,size_t size); -int __vfs_setxattr (struct mnt_idmap *,struct dentry *,struct inode *, +int __vfs_setxattr (const struct mnt_idmap *,struct dentry *,struct inode *,const char *,const void *,size_t ,int ); -int __vfs_setxattr_noperm (struct mnt_idmap *,struct dentry *, +int __vfs_setxattr_noperm (const struct mnt_idmap *,struct dentry *,const char *,const void *,size_t ,int ); -int __vfs_setxattr_locked (struct mnt_idmap *,struct dentry *, +int __vfs_setxattr_locked (const struct mnt_idmap *,struct dentry *,const char *,const void *,size_t ,int ,struct delegated_inode *); -int vfs_setxattr (struct mnt_idmap *,struct dentry *,const char *, +int vfs_setxattr (const struct mnt_idmap *,struct dentry *,const char *,const void *,size_t ,int ); -int __vfs_removexattr (struct mnt_idmap *,struct dentry *,const char *); -int __vfs_removexattr_locked (struct mnt_idmap *,struct dentry *, +int __vfs_removexattr (const struct mnt_idmap *,struct dentry *,const char *); +int __vfs_removexattr_locked (const struct mnt_idmap *,struct dentry *,const char *,struct delegated_inode *); -int vfs_removexattr (struct mnt_idmap *,struct dentry *,const char *); +int vfs_removexattr (const struct mnt_idmap *,struct dentry *,const char *);ssize_t generic_listxattr (struct dentry *dentry,char *buffer,size_t buffer_size); -int vfs_getxattr_alloc (struct mnt_idmap *idmap, +int vfs_getxattr_alloc (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,char **xattr_value,size_t size,gfp_t flags);
kernel/bpf/inode.c +1 -1
@@ -874,7 +874,7 @@ enum { };static int bpf_fs_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap,struct dentry *unused, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags) {
mm/shmem.c +1 -1
@@ -4264,7 +4264,7 @@ static int shmem_xattr_handler_get(const struct xattr_handler *handler, }static int shmem_xattr_handler_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *unused,struct inode *inode,const char *name,const void *value,size_t size,int flags)
net/socket.c +2 -2
@@ -422,7 +422,7 @@ static const struct xattr_handler sockfs_xattr_handler = { };static int sockfs_security_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *suffix,const void *value,size_t size,int flags)
@@ -447,7 +447,7 @@ static int sockfs_user_xattr_get(const struct xattr_handler *handler, }static int sockfs_user_xattr_set (const struct xattr_handler *handler, -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,const char *suffix,const void *value,size_t size,int flags)
security/commoncap.c +4 -4
@@ -348,7 +348,7 @@ int cap_inode_need_killpriv(struct dentry *dentry)* * Return: 0 if successful, -ve on error. */ -int cap_inode_killpriv (struct mnt_idmap *idmap,struct dentry *dentry) +int cap_inode_killpriv (const struct mnt_idmap *idmap,struct dentry *dentry) {int error;
@@ -417,7 +417,7 @@ static bool is_v3header(int size, const struct vfs_cap_data *cap)* by the integrity subsystem, which really wants the unconverted values - * so that's good. */ -int cap_inode_getsecurity (struct mnt_idmap *idmap, +int cap_inode_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void **buffer,bool alloc) {
@@ -566,7 +566,7 @@ static bool validheader(size_t size, const struct vfs_cap_data *cap)* * Return: On success, return the new size; on error, return < 0. */ -int cap_convert_nscap (struct mnt_idmap *idmap,struct dentry *dentry, +int cap_convert_nscap (const struct mnt_idmap *idmap,struct dentry *dentry,const void **ivalue,size_t size) {struct vfs_ns_cap_data *nscap;
@@ -672,7 +672,7 @@ static inline int bprm_caps_from_vfs_caps(struct cpu_vfs_cap_data *caps,* permissions. On non-idmapped mounts or if permission checking is to be * performed on the raw inode simply pass @nop_mnt_idmap. */ -int get_vfs_caps_from_disk (struct mnt_idmap *idmap, +int get_vfs_caps_from_disk (const struct mnt_idmap *idmap,const struct dentry *dentry,struct cpu_vfs_cap_data *cpu_caps) {
security/integrity/evm/evm_main.c +2 -2
@@ -607,7 +607,7 @@ static int evm_protect_xattr(const struct mnt_idmap *idmap,* userspace from writing HMAC value. Writing 'security.evm' requires * requires CAP_SYS_ADMIN privileges. */ -static int evm_inode_setxattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int evm_inode_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *xattr_name,const void *xattr_value,size_t xattr_value_len,int flags) {
@@ -639,7 +639,7 @@ static int evm_inode_setxattr(struct mnt_idmap *idmap, struct dentry *dentry,* Removing 'security.evm' requires CAP_SYS_ADMIN privileges and that * the current value is valid. */ -static int evm_inode_removexattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int evm_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *xattr_name) {/* Policy permits modification of the protected xattrs even though
security/integrity/ima/ima_appraise.c +2 -2
@@ -757,7 +757,7 @@ static int validate_hash_algo(struct dentry *dentry,return -EACCES ; } -static int ima_inode_setxattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int ima_inode_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *xattr_name,const void *xattr_value,size_t xattr_value_len,int flags) {
@@ -799,7 +799,7 @@ static int ima_inode_set_acl(const struct mnt_idmap *idmap, struct dentry *dentrreturn 0 ; } -static int ima_inode_removexattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int ima_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *xattr_name) {int result, digsig =-1 ;
security/security.c +4 -4
@@ -1921,7 +1921,7 @@ int security_inode_getattr(const struct path *path)* * Return: Returns 0 if permission is granted. */ -int security_inode_setxattr (struct mnt_idmap *idmap, +int security_inode_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags) {
@@ -2108,7 +2108,7 @@ int security_inode_listxattr(struct dentry *dentry)* * Return: Returns 0 if permission is granted. */ -int security_inode_removexattr (struct mnt_idmap *idmap, +int security_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name) {int rc;
@@ -2197,7 +2197,7 @@ int security_inode_need_killpriv(struct dentry *dentry)* Return: Return 0 on success. If error is returned, then the operation * causing setuid bit removal is failed. */ -int security_inode_killpriv (struct mnt_idmap *idmap, +int security_inode_killpriv (const struct mnt_idmap *idmap,struct dentry *dentry) {return call_int_hook (inode_killpriv, idmap, dentry);
@@ -2219,7 +2219,7 @@ int security_inode_killpriv(struct mnt_idmap *idmap,* * Return: Returns size of buffer on success. */ -int security_inode_getsecurity (struct mnt_idmap *idmap, +int security_inode_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void **buffer,bool alloc) {
security/selinux/hooks.c +3 -3
@@ -3367,7 +3367,7 @@ static int selinux_inode_xattr_skipcap(const char *name)return !strcmp (name,XATTR_NAME_SELINUX ); } -static int selinux_inode_setxattr (struct mnt_idmap *idmap, +static int selinux_inode_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags) {
@@ -3526,7 +3526,7 @@ static int selinux_inode_listxattr(struct dentry *dentry)return dentry_has_perm (cred, dentry,FILE__GETATTR ); } -static int selinux_inode_removexattr (struct mnt_idmap *idmap, +static int selinux_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name) {/* if not a selinux xattr, only check the ordinary setattr perm */
@@ -3606,7 +3606,7 @@ static int selinux_path_notify(const struct path *path, u64 mask,* * Permission check is handled by selinux_inode_getxattr hook. */ -static int selinux_inode_getsecurity (struct mnt_idmap *idmap, +static int selinux_inode_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void **buffer,bool alloc) {
security/smack/smack_lsm.c +3 -3
@@ -1348,7 +1348,7 @@ static int smack_inode_xattr_skipcap(const char *name)* * Returns 0 if access is permitted, an error code otherwise */ -static int smack_inode_setxattr (struct mnt_idmap *idmap, +static int smack_inode_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,const void *value,size_t size,int flags) {
@@ -1482,7 +1482,7 @@ static int smack_inode_getxattr(struct dentry *dentry, const char *name)* * Returns 0 if access is permitted, an error code otherwise */ -static int smack_inode_removexattr (struct mnt_idmap *idmap, +static int smack_inode_removexattr (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name) {struct inode_smack *isp;
@@ -1612,7 +1612,7 @@ static int smack_inode_remove_acl(const struct mnt_idmap *idmap,* * Returns the size of the attribute or an error code */ -static int smack_inode_getsecurity (struct mnt_idmap *idmap, +static int smack_inode_getsecurity (const struct mnt_idmap *idmap,struct inode *inode,const char *name,void **buffer,bool alloc) {
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 14/27 fs: port ->fileattr_set() 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/btrfs/ioctl.c | 2 +- fs/btrfs/ioctl.h | 2 +- fs/ecryptfs/inode.c | 2 +- fs/efivarfs/inode.c | 2 +- fs/ext2/ext2.h | 2 +- fs/ext2/ioctl.c | 2 +- fs/ext4/ext4.h | 2 +- fs/ext4/ioctl.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- fs/file_attr.c | 2 +- fs/fuse/fuse_i.h | 2 +- fs/fuse/ioctl.c | 2 +- fs/gfs2/file.c | 2 +- fs/gfs2/inode.h | 2 +- fs/hfsplus/hfsplus_fs.h | 2 +- fs/hfsplus/inode.c | 2 +- fs/jfs/ioctl.c | 2 +- fs/jfs/jfs_inode.h | 2 +- fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/nilfs.h | 2 +- fs/ntfs3/file.c | 2 +- fs/ntfs3/ntfs_fs.h | 2 +- fs/ocfs2/ioctl.c | 2 +- fs/ocfs2/ioctl.h | 2 +- fs/orangefs/inode.c | 2 +- fs/overlayfs/inode.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- fs/ubifs/ioctl.c | 2 +- fs/ubifs/ubifs.h | 2 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_ioctl.h | 2 +- include/linux/fileattr.h | 2 +- include/linux/fs.h | 2 +- mm/shmem.c | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -88,7 +88,7 @@ prototypes:: umode_t create_mode); int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t); - int (*fileattr_set)(struct mnt_idmap *idmap, + int (*fileattr_set)(const struct mnt_idmap *idmap, struct dentry *dentry, struct file_kattr *fa); int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa); struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
Documentation/filesystems/vfs.rst +1 -1
@@ -441,7 +441,7 @@ As of kernel 2.6.22, the following members are defined: int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t); struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int); int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int); - int (*fileattr_set)(struct mnt_idmap *idmap, + int (*fileattr_set)(const struct mnt_idmap *idmap, struct dentry *dentry, struct file_kattr *fa); int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa); struct offset_ctx *(*get_offset_ctx)(struct inode *inode);
fs/btrfs/ioctl.c +1 -1
@@ -278,7 +278,7 @@ int btrfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int btrfs_fileattr_set (struct mnt_idmap *idmap, +int btrfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct btrfs_inode *inode =BTRFS_I (d_inode (dentry));
fs/btrfs/ioctl.h +1 -1
@@ -17,7 +17,7 @@ struct btrfs_ioctl_balance_args;long btrfs_ioctl (struct file *file,unsigned int cmd,unsigned long arg);long btrfs_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg);int btrfs_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int btrfs_fileattr_set (struct mnt_idmap *idmap, +int btrfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);int btrfs_ioctl_get_supported_features (void __user *arg);void btrfs_sync_inode_flags_to_i_flags (struct btrfs_inode *inode);
fs/ecryptfs/inode.c +1 -1
@@ -1078,7 +1078,7 @@ static int ecryptfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return vfs_fileattr_get (ecryptfs_dentry_to_lower (dentry), fa); } -static int ecryptfs_fileattr_set (struct mnt_idmap *idmap, +static int ecryptfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct dentry *lower_dentry =ecryptfs_dentry_to_lower (dentry);
fs/efivarfs/inode.c +1 -1
@@ -150,7 +150,7 @@ efivarfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) }static int -efivarfs_fileattr_set (struct mnt_idmap *idmap, +efivarfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {unsigned int i_flags =0 ;
fs/ext2/ext2.h +1 -1
@@ -748,7 +748,7 @@ extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,/* ioctl.c */ extern int ext2_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -extern int ext2_fileattr_set (struct mnt_idmap *idmap, +extern int ext2_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);extern long ext2_ioctl (struct file *,unsigned int ,unsigned long );extern long ext2_compat_ioctl (struct file *,unsigned int ,unsigned long );
fs/ext2/ioctl.c +1 -1
@@ -27,7 +27,7 @@ int ext2_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int ext2_fileattr_set (struct mnt_idmap *idmap, +int ext2_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/ext4/ext4.h +1 -1
@@ -3246,7 +3246,7 @@ extern int ext4_ind_remove_space(handle_t *handle, struct inode *inode,/* ioctl.c */ extern long ext4_ioctl (struct file *,unsigned int ,unsigned long );extern long ext4_compat_ioctl (struct file *,unsigned int ,unsigned long ); -int ext4_fileattr_set (struct mnt_idmap *idmap, +int ext4_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);int ext4_fileattr_get (struct dentry *dentry,struct file_kattr *fa);extern void ext4_reset_inode_seed (struct inode *inode);
fs/ext4/ioctl.c +1 -1
@@ -1008,7 +1008,7 @@ int ext4_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int ext4_fileattr_set (struct mnt_idmap *idmap, +int ext4_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/f2fs/f2fs.h +1 -1
@@ -3858,7 +3858,7 @@ int f2fs_do_shutdown(struct f2fs_sb_info *sbi, unsigned int flag, bool readonly, bool need_lock);int f2fs_precache_extents (struct inode *inode);int f2fs_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int f2fs_fileattr_set (struct mnt_idmap *idmap, +int f2fs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);long f2fs_ioctl (struct file *filp,unsigned int cmd,unsigned long arg);long f2fs_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg);
fs/f2fs/file.c +1 -1
@@ -3580,7 +3580,7 @@ int f2fs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int f2fs_fileattr_set (struct mnt_idmap *idmap, +int f2fs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/file_attr.c +1 -1
@@ -265,7 +265,7 @@ static int fileattr_set_prepare(struct inode *inode,* * Return: 0 on success, or a negative error on failure. */ -int vfs_fileattr_set (struct mnt_idmap *idmap,struct dentry *dentry, +int vfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/fuse/fuse_i.h +1 -1
@@ -1238,7 +1238,7 @@ long fuse_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg);long fuse_file_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg);int fuse_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int fuse_fileattr_set (struct mnt_idmap *idmap, +int fuse_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);/* iomode.c */
fs/fuse/ioctl.c +1 -1
@@ -540,7 +540,7 @@ int fuse_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return err; } -int fuse_fileattr_set (struct mnt_idmap *idmap, +int fuse_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/gfs2/file.c +1 -1
@@ -275,7 +275,7 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask)return error; } -int gfs2_fileattr_set (struct mnt_idmap *idmap, +int gfs2_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/gfs2/inode.h +1 -1
@@ -109,7 +109,7 @@ extern const struct file_operations gfs2_file_fops_nolock;extern const struct file_operations gfs2_dir_fops_nolock;int gfs2_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int gfs2_fileattr_set (struct mnt_idmap *idmap, +int gfs2_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);void gfs2_set_inode_flags (struct inode *inode);
fs/hfsplus/hfsplus_fs.h +1 -1
@@ -465,7 +465,7 @@ int hfsplus_getattr(struct mnt_idmap *idmap, const struct path *path,int hfsplus_file_fsync (struct file *file,loff_t start,loff_t end,int datasync);int hfsplus_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int hfsplus_fileattr_set (struct mnt_idmap *idmap, +int hfsplus_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);/* ioctl.c */
fs/hfsplus/inode.c +1 -1
@@ -797,7 +797,7 @@ int hfsplus_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int hfsplus_fileattr_set (struct mnt_idmap *idmap, +int hfsplus_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/jfs/ioctl.c +1 -1
@@ -70,7 +70,7 @@ int jfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int jfs_fileattr_set (struct mnt_idmap *idmap, +int jfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/jfs/jfs_inode.h +1 -1
@@ -10,7 +10,7 @@ struct fid;extern struct inode *ialloc (struct inode *,umode_t );extern int jfs_fsync (struct file *,loff_t ,loff_t ,int );extern int jfs_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -extern int jfs_fileattr_set (struct mnt_idmap *idmap, +extern int jfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);extern long jfs_ioctl (struct file *,unsigned int ,unsigned long );extern struct inode *jfs_iget (struct super_block *,unsigned long );
fs/nilfs2/ioctl.c +1 -1
@@ -135,7 +135,7 @@ int nilfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)* * Return: 0 on success, or a negative error code on failure. */ -int nilfs_fileattr_set (struct mnt_idmap *idmap, +int nilfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/nilfs2/nilfs.h +1 -1
@@ -270,7 +270,7 @@ extern int nilfs_sync_file(struct file *, loff_t, loff_t, int);/* ioctl.c */ int nilfs_fileattr_get (struct dentry *dentry,struct file_kattr *m); -int nilfs_fileattr_set (struct mnt_idmap *idmap, +int nilfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);long nilfs_ioctl (struct file *,unsigned int ,unsigned long );long nilfs_compat_ioctl (struct file *file,unsigned int cmd,unsigned long arg);
fs/ntfs3/file.c +1 -1
@@ -129,7 +129,7 @@ int ntfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)/* * ntfs_fileattr_set - inode_operations::fileattr_set */ -int ntfs_fileattr_set (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/ntfs3/ntfs_fs.h +1 -1
@@ -551,7 +551,7 @@ extern const struct file_operations ntfs_dir_operations;/* Globals from file.c */ int ntfs_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int ntfs_fileattr_set (struct mnt_idmap *idmap,struct dentry *dentry, +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,struct kstat *stat,u32 request_mask,u32 flags);
fs/ocfs2/ioctl.c +1 -1
@@ -82,7 +82,7 @@ int ocfs2_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return status; } -int ocfs2_fileattr_set (struct mnt_idmap *idmap, +int ocfs2_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/ocfs2/ioctl.h +1 -1
@@ -12,7 +12,7 @@#define OCFS2_IOCTL_PROTO_H int ocfs2_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int ocfs2_fileattr_set (struct mnt_idmap *idmap, +int ocfs2_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);long ocfs2_ioctl (struct file *filp,unsigned int cmd,unsigned long arg);long ocfs2_compat_ioctl (struct file *file,unsigned cmd,unsigned long arg);
fs/orangefs/inode.c +1 -1
@@ -934,7 +934,7 @@ static int orangefs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -static int orangefs_fileattr_set (struct mnt_idmap *idmap, +static int orangefs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {u64 val =0 ;
fs/overlayfs/inode.c +1 -1
@@ -650,7 +650,7 @@ int ovl_real_fileattr_set(const struct path *realpath, struct file_kattr *fa)return vfs_fileattr_set (mnt_idmap (realpath->mnt), realpath->dentry, fa); } -int ovl_fileattr_set (struct mnt_idmap *idmap, +int ovl_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/overlayfs/overlayfs.h +1 -1
@@ -914,7 +914,7 @@ extern const struct file_operations ovl_file_operations;int ovl_real_fileattr_get (const struct path *realpath,struct file_kattr *fa);int ovl_real_fileattr_set (const struct path *realpath,struct file_kattr *fa);int ovl_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int ovl_fileattr_set (struct mnt_idmap *idmap, +int ovl_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);struct ovl_file ;struct ovl_file *ovl_file_alloc (struct file *realfile);
fs/ubifs/ioctl.c +1 -1
@@ -144,7 +144,7 @@ int ubifs_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -int ubifs_fileattr_set (struct mnt_idmap *idmap, +int ubifs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
fs/ubifs/ubifs.h +1 -1
@@ -2083,7 +2083,7 @@ void ubifs_destroy_size_tree(struct ubifs_info *c);/* ioctl.c */ int ubifs_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int ubifs_fileattr_set (struct mnt_idmap *idmap, +int ubifs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);long ubifs_ioctl (struct file *file,unsigned int cmd,unsigned long arg);void ubifs_set_inode_flags (struct inode *inode);
fs/xfs/xfs_ioctl.c +1 -1
@@ -748,7 +748,7 @@ xfs_ioctl_setattr_check_projid(int xfs_fileattr_set ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {
fs/xfs/xfs_ioctl.h +1 -1
@@ -21,7 +21,7 @@ xfs_fileattr_get(extern int xfs_fileattr_set ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);
include/linux/fileattr.h +1 -1
@@ -74,7 +74,7 @@ static inline bool fileattr_has_fsx(const struct file_kattr *fa) }int vfs_fileattr_get (struct dentry *dentry,struct file_kattr *fa); -int vfs_fileattr_set (struct mnt_idmap *idmap,struct dentry *dentry, +int vfs_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);int ioctl_getflags (struct file *file,unsigned int __user *argp);int ioctl_setflags (struct file *file,unsigned int __user *argp);
include/linux/fs.h +1 -1
@@ -2030,7 +2030,7 @@ struct inode_operations { int);int (*set_acl)(struct mnt_idmap *,struct dentry *,struct posix_acl *,int ); -int (*fileattr_set)(struct mnt_idmap *idmap, +int (*fileattr_set)(const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);int (*fileattr_get)(struct dentry *dentry,struct file_kattr *fa);struct offset_ctx *(*get_offset_ctx)(struct inode *inode);
mm/shmem.c +1 -1
@@ -4159,7 +4159,7 @@ static int shmem_fileattr_get(struct dentry *dentry, struct file_kattr *fa)return 0 ; } -static int shmem_fileattr_set (struct mnt_idmap *idmap, +static int shmem_fileattr_set (const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa) {struct inode *inode =d_inode (dentry);
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 15/27 fs: port ->set_acl() 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/vfs.rst | 2 +- fs/9p/acl.c | 2 +- fs/9p/acl.h | 2 +- fs/bad_inode.c | 2 +- fs/btrfs/acl.c | 2 +- fs/btrfs/acl.h | 2 +- fs/ceph/acl.c | 2 +- fs/ceph/super.h | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ext2/acl.c | 2 +- fs/ext2/acl.h | 2 +- fs/ext4/acl.c | 2 +- fs/ext4/acl.h | 2 +- fs/f2fs/acl.c | 2 +- fs/f2fs/acl.h | 2 +- fs/fuse/acl.c | 2 +- fs/fuse/fuse_i.h | 2 +- fs/gfs2/acl.c | 2 +- fs/gfs2/acl.h | 2 +- fs/internal.h | 4 ++-- fs/jffs2/acl.c | 2 +- fs/jffs2/acl.h | 2 +- fs/jfs/acl.c | 2 +- fs/jfs/jfs_acl.h | 2 +- fs/nfs/nfs3_fs.h | 2 +- fs/nfs/nfs3acl.c | 2 +- fs/ntfs/ea.c | 2 +- fs/ntfs/ea.h | 2 +- fs/ntfs3/ntfs_fs.h | 4 ++-- fs/ntfs3/xattr.c | 4 ++-- fs/ocfs2/acl.c | 2 +- fs/ocfs2/acl.h | 2 +- fs/orangefs/acl.c | 2 +- fs/orangefs/orangefs-kernel.h | 2 +- fs/overlayfs/inode.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- fs/posix_acl.c | 12 ++++++------ fs/smb/client/cifsacl.c | 2 +- fs/smb/client/cifsproto.h | 2 +- fs/smb/server/vfs.c | 4 ++-- fs/smb/server/vfs.h | 4 ++-- fs/xattr.c | 4 ++-- fs/xfs/xfs_acl.c | 2 +- fs/xfs/xfs_acl.h | 2 +- fs/xfs/xfs_iops.c | 4 ++-- fs/xfs/xfs_iops.h | 2 +- include/linux/fs.h | 2 +- include/linux/posix_acl.h | 16 ++++++++-------- 48 files changed, 67 insertions(+), 67 deletions(-)
Documentation/filesystems/vfs.rst +1 -1
@@ -440,7 +440,7 @@ As of kernel 2.6.22, the following members are defined: unsigned open_flag, umode_t create_mode); int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t); struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int); - int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int); + int (*set_acl)(const struct mnt_idmap *, struct dentry *, struct posix_acl *, int); int (*fileattr_set)(const struct mnt_idmap *idmap, struct dentry *dentry, struct file_kattr *fa); int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa);
fs/9p/acl.c +1 -1
@@ -152,7 +152,7 @@ struct posix_acl *v9fs_iop_get_acl(struct mnt_idmap *idmap,return v9fs_get_cached_acl (d_inode (dentry), type); } -int v9fs_iop_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int v9fs_iop_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int retval;
fs/9p/acl.h +1 -1
@@ -12,7 +12,7 @@ struct posix_acl *v9fs_iop_get_inode_acl(struct inode *inode, int type, bool rcu);struct posix_acl *v9fs_iop_get_acl (struct mnt_idmap *idmap,struct dentry *dentry,int type); -int v9fs_iop_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int v9fs_iop_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int v9fs_acl_chmod (struct inode *inode,struct p9_fid *fid); int v9fs_set_create_acl(struct inode *inode, struct p9_fid *fid,
fs/bad_inode.c +1 -1
@@ -153,7 +153,7 @@ static int bad_inode_tmpfile(struct mnt_idmap *idmap,return -EIO ; } -static int bad_inode_set_acl (struct mnt_idmap *idmap, +static int bad_inode_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {
fs/btrfs/acl.c +1 -1
@@ -101,7 +101,7 @@ int __btrfs_set_acl(struct btrfs_trans_handle *trans, struct inode *inode,return 0 ; } -int btrfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int btrfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int ret;
fs/btrfs/acl.h +1 -1
@@ -15,7 +15,7 @@ struct mnt_idmap;struct dentry ;struct posix_acl *btrfs_get_acl (struct inode *inode,int type,bool rcu); -int btrfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int btrfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int __btrfs_set_acl (struct btrfs_trans_handle *trans,struct inode *inode,struct posix_acl *acl,int type);
fs/ceph/acl.c +1 -1
@@ -87,7 +87,7 @@ struct posix_acl *ceph_get_acl(struct inode *inode, int type, bool rcu)return acl; } -int ceph_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ceph_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int ret =0 ;
fs/ceph/super.h +1 -1
@@ -1252,7 +1252,7 @@ void ceph_release_acl_sec_ctx(struct ceph_acl_sec_ctx *as_ctx);#ifdef CONFIG_CEPH_FS_POSIX_ACL struct posix_acl *ceph_get_acl (struct inode *,int ,bool ); -int ceph_set_acl (struct mnt_idmap *idmap, +int ceph_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int ceph_pre_init_acls (struct inode *dir,umode_t *mode,struct ceph_acl_sec_ctx *as_ctx);
fs/ecryptfs/inode.c +1 -1
@@ -1097,7 +1097,7 @@ static struct posix_acl *ecryptfs_get_acl(struct mnt_idmap *idmap, posix_acl_xattr_name(type)); } -static int ecryptfs_set_acl (struct mnt_idmap *idmap, +static int ecryptfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {
fs/ext2/acl.c +1 -1
@@ -219,7 +219,7 @@ __ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type)* inode->i_mutex: down */ int -ext2_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +ext2_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int error;
fs/ext2/acl.h +1 -1
@@ -56,7 +56,7 @@ static inline int ext2_acl_count(size_t size)/* acl.c */ extern struct posix_acl *ext2_get_acl (struct inode *inode,int type,bool rcu); -extern int ext2_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +extern int ext2_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);extern int ext2_init_acl (struct inode *,struct inode *);
fs/ext4/acl.c +1 -1
@@ -225,7 +225,7 @@ __ext4_set_acl(handle_t *handle, struct inode *inode, int type, }int -ext4_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +ext4_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {handle_t *handle;
fs/ext4/acl.h +1 -1
@@ -56,7 +56,7 @@ static inline int ext4_acl_count(size_t size)/* acl.c */ struct posix_acl *ext4_get_acl (struct inode *inode,int type,bool rcu); -int ext4_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ext4_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);extern int ext4_init_acl (handle_t *,struct inode *,struct inode *);
fs/f2fs/acl.c +1 -1
@@ -289,7 +289,7 @@ static int __f2fs_set_acl(const struct mnt_idmap *idmap,return error; } -int f2fs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int f2fs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {struct inode *inode =d_inode (dentry);
fs/f2fs/acl.h +1 -1
@@ -34,7 +34,7 @@ struct f2fs_acl_header {#ifdef CONFIG_F2FS_FS_POSIX_ACL struct posix_acl *f2fs_get_acl (struct inode *,int ,bool ); -int f2fs_set_acl (struct mnt_idmap *,struct dentry *, +int f2fs_set_acl (const struct mnt_idmap *,struct dentry *,struct posix_acl *,int );int f2fs_init_acl (struct inode *,struct inode *,struct folio *ifolio,struct folio *dfolio);
fs/fuse/acl.c +1 -1
@@ -90,7 +90,7 @@ struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu)return __fuse_get_acl (fc, inode, type, rcu); } -int fuse_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int fuse_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {struct inode *inode =d_inode (dentry);
fs/fuse/fuse_i.h +1 -1
@@ -1207,7 +1207,7 @@ struct posix_acl;struct posix_acl *fuse_get_inode_acl (struct inode *inode,int type,bool rcu);struct posix_acl *fuse_get_acl (struct mnt_idmap *idmap,struct dentry *dentry,int type); -int fuse_set_acl (struct mnt_idmap *,struct dentry *dentry, +int fuse_set_acl (const struct mnt_idmap *,struct dentry *dentry,struct posix_acl *acl,int type);/* readdir.c */
fs/gfs2/acl.c +1 -1
@@ -102,7 +102,7 @@ int __gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)return error; } -int gfs2_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int gfs2_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {struct inode *inode =d_inode (dentry);
fs/gfs2/acl.h +1 -1
@@ -13,7 +13,7 @@struct posix_acl *gfs2_get_acl (struct inode *inode,int type,bool rcu);int __gfs2_set_acl (struct inode *inode,struct posix_acl *acl,int type); -int gfs2_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int gfs2_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);#endif /* __ACL_DOT_H__ */
fs/internal.h +2 -2
@@ -302,12 +302,12 @@ int import_xattr_name(struct xattr_name *kname, const char __user *name);int may_write_xattr (const struct mnt_idmap *idmap,struct inode *inode);#ifdef CONFIG_FS_POSIX_ACL -int do_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int do_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,const void *kvalue,size_t size);ssize_t do_get_acl (struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,void *kvalue,size_t size);#else -static inline int do_set_acl (struct mnt_idmap *idmap, +static inline int do_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,const void *kvalue,size_t size) {
fs/jffs2/acl.c +1 -1
@@ -228,7 +228,7 @@ static int __jffs2_set_acl(struct inode *inode, int xprefix, struct posix_acl *areturn rc; } -int jffs2_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int jffs2_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int rc, xprefix;
fs/jffs2/acl.h +1 -1
@@ -28,7 +28,7 @@ struct jffs2_acl_header {#ifdef CONFIG_JFFS2_FS_POSIX_ACL struct posix_acl *jffs2_get_acl (struct inode *inode,int type,bool rcu); -int jffs2_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int jffs2_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);extern int jffs2_init_acl_pre (struct inode *,struct inode *,umode_t *);extern int jffs2_init_acl_post (struct inode *);
fs/jfs/acl.c +1 -1
@@ -89,7 +89,7 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,return rc; } -int jfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int jfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int rc;
fs/jfs/jfs_acl.h +1 -1
@@ -8,7 +8,7 @@#ifdef CONFIG_JFS_POSIX_ACL struct posix_acl *jfs_get_acl (struct inode *inode,int type,bool rcu); -int jfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int jfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int jfs_init_acl (tid_t ,struct inode *,struct inode *);
fs/nfs/nfs3_fs.h +1 -1
@@ -12,7 +12,7 @@*/ #ifdef CONFIG_NFS_V3_ACL extern struct posix_acl *nfs3_get_acl (struct inode *inode,int type,bool rcu); -extern int nfs3_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +extern int nfs3_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);extern int nfs3_proc_setacls (struct inode *inode,struct posix_acl *acl,struct posix_acl *dfacl);
fs/nfs/nfs3acl.c +1 -1
@@ -254,7 +254,7 @@ int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, } -int nfs3_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int nfs3_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {struct posix_acl *orig = acl, *dfacl =NULL , *alloc;
fs/ntfs/ea.c +1 -1
@@ -1080,7 +1080,7 @@ static noinline int ntfs_set_acl_ex(const struct mnt_idmap *idmap,return err; } -int ntfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {return ntfs_set_acl_ex (idmap,d_inode (dentry), acl, type, false);
fs/ntfs/ea.h +1 -1
@@ -19,7 +19,7 @@ ssize_t ntfs_listxattr(struct dentry *dentry, char *buffer, size_t size);#ifdef CONFIG_NTFS_FS_POSIX_ACL struct posix_acl *ntfs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry,int type); -int ntfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int ntfs_init_acl (const struct mnt_idmap *idmap,struct inode *inode,struct inode *dir);
fs/ntfs3/ntfs_fs.h +2 -2
@@ -965,7 +965,7 @@ unsigned long ntfs_names_hash(const u16 *name, size_t len, const u16 *upcase,#ifdef CONFIG_NTFS3_FS_POSIX_ACL struct posix_acl *ntfs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry,int type); -int ntfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int ntfs_init_acl (const struct mnt_idmap *idmap,struct inode *inode,struct inode *dir);
@@ -974,7 +974,7 @@ int ntfs_init_acl(const struct mnt_idmap *idmap, struct inode *inode,#define ntfs_set_acl NULL#endif -int ntfs_acl_chmod (struct mnt_idmap *idmap,struct dentry *dentry); +int ntfs_acl_chmod (const struct mnt_idmap *idmap,struct dentry *dentry);ssize_t ntfs_listxattr (struct dentry *dentry,char *buffer,size_t size);extern const struct xattr_handler *const ntfs_xattr_handlers[];
fs/ntfs3/xattr.c +2 -2
@@ -677,7 +677,7 @@ static noinline int ntfs_set_acl_ex(const struct mnt_idmap *idmap,/* * ntfs_set_acl - inode_operations::set_acl */ -int ntfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ntfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {return ntfs_set_acl_ex (idmap,d_inode (dentry), acl, type, false);
@@ -722,7 +722,7 @@ int ntfs_init_acl(const struct mnt_idmap *idmap, struct inode *inode,/* * ntfs_acl_chmod - Helper for ntfs_setattr(). */ -int ntfs_acl_chmod (struct mnt_idmap *idmap,struct dentry *dentry) +int ntfs_acl_chmod (const struct mnt_idmap *idmap,struct dentry *dentry) {struct inode *inode =d_inode (dentry);struct super_block *sb = inode->i_sb;
fs/ocfs2/acl.c +1 -1
@@ -260,7 +260,7 @@ static int ocfs2_set_acl(handle_t *handle,return ret; } -int ocfs2_iop_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ocfs2_iop_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {struct buffer_head *bh =NULL ;
fs/ocfs2/acl.h +1 -1
@@ -17,7 +17,7 @@ struct ocfs2_acl_entry { };struct posix_acl *ocfs2_iop_get_acl (struct inode *inode,int type,bool rcu); -int ocfs2_iop_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ocfs2_iop_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);extern int ocfs2_acl_chmod (struct inode *,struct buffer_head *);struct ocfs2_acl_state {
fs/orangefs/acl.c +1 -1
@@ -112,7 +112,7 @@ int __orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)return error; } -int orangefs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int orangefs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int error;
fs/orangefs/orangefs-kernel.h +1 -1
@@ -98,7 +98,7 @@ enum orangefs_vfs_op_states {extern const struct xattr_handler *const orangefs_xattr_handlers[];extern struct posix_acl *orangefs_get_acl (struct inode *inode,int type,bool rcu); -extern int orangefs_set_acl (struct mnt_idmap *idmap, +extern int orangefs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int __orangefs_set_acl (struct inode *inode,struct posix_acl *acl,int type);
fs/overlayfs/inode.c +1 -1
@@ -536,7 +536,7 @@ static int ovl_set_or_remove_acl(struct dentry *dentry, struct inode *inode,return err; } -int ovl_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ovl_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int err;
fs/overlayfs/overlayfs.h +1 -1
@@ -819,7 +819,7 @@ static inline struct posix_acl *ovl_get_acl(struct mnt_idmap *idmap, {return do_ovl_get_acl (idmap,d_inode (dentry), type, false, false); } -int ovl_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int ovl_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);struct posix_acl *ovl_get_acl_path (const struct path *path,const char *acl_name,bool noperm);
fs/posix_acl.c +6 -6
@@ -608,7 +608,7 @@ EXPORT_SYMBOL(__posix_acl_chmod);* performed on the raw inode simply pass @nop_mnt_idmap. */ int -posix_acl_chmod (struct mnt_idmap *idmap,struct dentry *dentry, +posix_acl_chmod (const struct mnt_idmap *idmap,struct dentry *dentry,umode_t mode) {struct inode *inode =d_inode (dentry);
@@ -937,7 +937,7 @@ static ssize_t vfs_posix_acl_to_xattr(const struct mnt_idmap *idmap, }int -set_posix_acl (struct mnt_idmap *idmap,struct dentry *dentry, +set_posix_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type,struct posix_acl *acl) {struct inode *inode =d_inode (dentry);
@@ -1018,7 +1018,7 @@ const struct xattr_handler nop_posix_acl_default = { };EXPORT_SYMBOL_GPL (nop_posix_acl_default); -int simple_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int simple_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {int error;
@@ -1091,7 +1091,7 @@ static int vfs_set_acl_idmapped_mnt(const struct mnt_idmap *idmap,* * Return: On success 0, on error negative errno. */ -int vfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int vfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl) {int acl_type;
@@ -1212,7 +1212,7 @@ EXPORT_SYMBOL_GPL(vfs_get_acl);* * Return: On success 0, on error negative errno. */ -int vfs_remove_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int vfs_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {int acl_type;
@@ -1265,7 +1265,7 @@ int vfs_remove_acl(struct mnt_idmap *idmap, struct dentry *dentry, }EXPORT_SYMBOL_GPL (vfs_remove_acl); -int do_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int do_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,const void *kvalue,size_t size) {int error;
fs/smb/client/cifsacl.c +1 -1
@@ -1931,7 +1931,7 @@ struct posix_acl *cifs_get_acl(struct mnt_idmap *idmap,#endif } -int cifs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int cifs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {#if defined(CONFIG_CIFS_ALLOW_INSECURE_LEGACY ) && defined(CONFIG_CIFS_POSIX )
fs/smb/client/cifsproto.h +1 -1
@@ -214,7 +214,7 @@ struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb, u32 *pacllen, u32 info);struct posix_acl *cifs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry,int type); -int cifs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int cifs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);int set_cifs_acl (struct smb_ntsd *pnntsd,__u32 acllen,struct inode *inode,const char *path,int aclflag);
fs/smb/server/vfs.c +2 -2
@@ -1471,7 +1471,7 @@ struct dentry *ksmbd_vfs_kern_path_create(struct ksmbd_work *work,return dent; } -int ksmbd_vfs_remove_acl_xattrs (struct mnt_idmap *idmap, +int ksmbd_vfs_remove_acl_xattrs (const struct mnt_idmap *idmap,const struct path *path) {char *name, *xattr_list =NULL ;
@@ -2200,7 +2200,7 @@ void ksmbd_vfs_posix_lock_unblock(struct file_lock *flock)locks_delete_block (flock); } -int ksmbd_vfs_set_init_posix_acl (struct mnt_idmap *idmap, +int ksmbd_vfs_set_init_posix_acl (const struct mnt_idmap *idmap,const struct path *path) {struct posix_acl_state acl_state;
fs/smb/server/vfs.h +2 -2
@@ -152,7 +152,7 @@ int ksmbd_vfs_fill_dentry_attrs(struct ksmbd_work *work, struct ksmbd_kstat *ksmbd_kstat);void ksmbd_vfs_posix_lock_wait (struct file_lock *flock);void ksmbd_vfs_posix_lock_unblock (struct file_lock *flock); -int ksmbd_vfs_remove_acl_xattrs (struct mnt_idmap *idmap, +int ksmbd_vfs_remove_acl_xattrs (const struct mnt_idmap *idmap,const struct path *path);int ksmbd_vfs_remove_sd_xattrs (const struct mnt_idmap *idmap,const struct path *path); int ksmbd_vfs_set_sd_xattr(struct ksmbd_conn *conn,
@@ -171,7 +171,7 @@ int ksmbd_vfs_set_dos_attrib_xattr(const struct mnt_idmap *idmap,int ksmbd_vfs_get_dos_attrib_xattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct xattr_dos_attrib *da); -int ksmbd_vfs_set_init_posix_acl (struct mnt_idmap *idmap, +int ksmbd_vfs_set_init_posix_acl (const struct mnt_idmap *idmap,const struct path *path); int ksmbd_vfs_inherit_posix_acl(const struct mnt_idmap *idmap, const struct path *path,
fs/xattr.c +2 -2
@@ -652,7 +652,7 @@ int setxattr_copy(const char __user *name, struct kernel_xattr_ctx *ctx)return error; } -static int do_setxattr (struct mnt_idmap *idmap,struct dentry *dentry, +static int do_setxattr (const struct mnt_idmap *idmap,struct dentry *dentry,struct kernel_xattr_ctx *ctx) {if (is_posix_acl_xattr (ctx->kname->name))
@@ -1029,7 +1029,7 @@ SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size)* Extended attribute REMOVE operations */ static long -removexattr (struct mnt_idmap *idmap,struct dentry *d,const char *name) +removexattr (const struct mnt_idmap *idmap,struct dentry *d,const char *name) {if (is_posix_acl_xattr (name))return vfs_remove_acl (idmap, d, name);
fs/xfs/xfs_acl.c +1 -1
@@ -243,7 +243,7 @@ xfs_acl_set_mode( }int -xfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +xfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type) {umode_t mode;
fs/xfs/xfs_acl.h +1 -1
@@ -11,7 +11,7 @@ struct posix_acl;#ifdef CONFIG_XFS_POSIX_ACL extern struct posix_acl *xfs_get_acl (struct inode *inode,int type,bool rcu); -extern int xfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +extern int xfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);extern int __xfs_set_acl (struct inode *inode,struct posix_acl *acl,int type);void xfs_forget_acl (struct inode *inode,const char *name);
fs/xfs/xfs_iops.c +2 -2
@@ -777,7 +777,7 @@ xfs_vn_change_ok(*/ static int xfs_setattr_nonsize ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct xfs_inode *ip,struct iattr *iattr)
@@ -903,7 +903,7 @@ xfs_setattr_nonsize(*/ int xfs_vn_setattr_size ( -struct mnt_idmap *idmap, +const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *iattr) {
fs/xfs/xfs_iops.h +1 -1
@@ -10,7 +10,7 @@ struct xfs_inode;extern ssize_t xfs_vn_listxattr (struct dentry *,char *data,size_t size); -int xfs_vn_setattr_size (struct mnt_idmap *idmap, +int xfs_vn_setattr_size (const struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *vap); int xfs_inode_init_security(struct inode *inode, struct inode *dir,
include/linux/fs.h +1 -1
@@ -2028,7 +2028,7 @@ struct inode_operations { struct file *, umode_t);struct posix_acl *(*get_acl)(struct mnt_idmap *,struct dentry *,int ); -int (*set_acl)(struct mnt_idmap *,struct dentry *, +int (*set_acl)(const struct mnt_idmap *,struct dentry *,struct posix_acl *,int );int (*fileattr_set)(const struct mnt_idmap *idmap,struct dentry *dentry,struct file_kattr *fa);
include/linux/posix_acl.h +8 -8
@@ -74,20 +74,20 @@ extern int __posix_acl_create(struct posix_acl **, gfp_t, umode_t *);extern int __posix_acl_chmod (struct posix_acl **,gfp_t ,umode_t );extern struct posix_acl *get_posix_acl (struct inode *,int ); -int set_posix_acl (struct mnt_idmap *,struct dentry *,int , +int set_posix_acl (const struct mnt_idmap *,struct dentry *,int ,struct posix_acl *);struct posix_acl *get_cached_acl_rcu (struct inode *inode,int type);struct posix_acl *posix_acl_clone (const struct posix_acl *acl,gfp_t flags);#ifdef CONFIG_FS_POSIX_ACL -int posix_acl_chmod (struct mnt_idmap *,struct dentry *,umode_t ); +int posix_acl_chmod (const struct mnt_idmap *,struct dentry *,umode_t );extern int posix_acl_create (struct inode *,umode_t *,struct posix_acl **,struct posix_acl **);int posix_acl_update_mode (const struct mnt_idmap *,struct inode *,umode_t *,struct posix_acl **); -int simple_set_acl (struct mnt_idmap *,struct dentry *, +int simple_set_acl (const struct mnt_idmap *,struct dentry *,struct posix_acl *,int );extern int simple_acl_create (struct inode *,struct inode *);
@@ -105,16 +105,16 @@ static inline void cache_no_acl(struct inode *inode) inode->i_default_acl = NULL; } -int vfs_set_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int vfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl);struct posix_acl *vfs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name); -int vfs_remove_acl (struct mnt_idmap *idmap,struct dentry *dentry, +int vfs_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name);int posix_acl_listxattr (struct inode *inode,char **buffer,ssize_t *remaining_size);#else -static inline int posix_acl_chmod (struct mnt_idmap *idmap, +static inline int posix_acl_chmod (const struct mnt_idmap *idmap,struct dentry *dentry,umode_t mode) {return 0 ;
@@ -141,7 +141,7 @@ static inline void forget_all_cached_acls(struct inode *inode) { } -static inline int vfs_set_acl (struct mnt_idmap *idmap, +static inline int vfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *name,struct posix_acl *acl) {
@@ -155,7 +155,7 @@ static inline struct posix_acl *vfs_get_acl(struct mnt_idmap *idmap,return ERR_PTR (-EOPNOTSUPP ); } -static inline int vfs_remove_acl (struct mnt_idmap *idmap, +static inline int vfs_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {return -EOPNOTSUPP ;
Signature · 1 line
2.53.0
Christian Brauner
maintainerPATCH 16/27 fs: port ->get_acl() 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/acl.c | 2 +- fs/9p/acl.h | 2 +- fs/ecryptfs/inode.c | 2 +- fs/fuse/acl.c | 2 +- fs/fuse/fuse_i.h | 2 +- fs/internal.h | 4 ++-- fs/ntfs/ea.c | 2 +- fs/ntfs/ea.h | 2 +- fs/ntfs3/ntfs_fs.h | 2 +- fs/ntfs3/xattr.c | 2 +- fs/overlayfs/overlayfs.h | 2 +- fs/posix_acl.c | 6 +++--- fs/smb/client/cifsacl.c | 2 +- fs/smb/client/cifsproto.h | 2 +- fs/xattr.c | 2 +- include/linux/fs.h | 2 +- include/linux/posix_acl.h | 4 ++-- 19 files changed, 23 insertions(+), 23 deletions(-)
Documentation/filesystems/locking.rst +1 -1
@@ -91,7 +91,7 @@ prototypes:: int (*fileattr_set)(const struct mnt_idmap *idmap, struct dentry *dentry, struct file_kattr *fa); int (*fileattr_get)(struct dentry *dentry, struct file_kattr *fa); - struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int); + struct posix_acl * (*get_acl)(const struct mnt_idmap *, struct dentry *, int); struct offset_ctx *(*get_offset_ctx)(struct inode *inode); locking rules:
Documentation/filesystems/vfs.rst +1 -1
@@ -439,7 +439,7 @@ As of kernel 2.6.22, the following members are defined: 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); - struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int); + 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, struct dentry *dentry, struct file_kattr *fa);
fs/9p/acl.c +1 -1
@@ -140,7 +140,7 @@ struct posix_acl *v9fs_iop_get_inode_acl(struct inode *inode, int type, bool rcu } -struct posix_acl *v9fs_iop_get_acl (struct mnt_idmap *idmap, +struct posix_acl *v9fs_iop_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type) {struct v9fs_session_info *v9ses;
fs/9p/acl.h +1 -1
@@ -10,7 +10,7 @@int v9fs_get_acl (struct inode *inode,struct p9_fid *fid);struct posix_acl *v9fs_iop_get_inode_acl (struct inode *inode,int type,bool rcu); -struct posix_acl *v9fs_iop_get_acl (struct mnt_idmap *idmap, +struct posix_acl *v9fs_iop_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type);int v9fs_iop_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);
fs/ecryptfs/inode.c +1 -1
@@ -1090,7 +1090,7 @@ static int ecryptfs_fileattr_set(const struct mnt_idmap *idmap,return rc; } -static struct posix_acl *ecryptfs_get_acl (struct mnt_idmap *idmap, +static struct posix_acl *ecryptfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type) { return vfs_get_acl(idmap, ecryptfs_dentry_to_lower(dentry),
fs/fuse/acl.c +1 -1
@@ -62,7 +62,7 @@ static inline bool fuse_no_acl(const struct fuse_conn *fc,return !fc->posix_acl && (i_user_ns (inode) != &init_user_ns); } -struct posix_acl *fuse_get_acl (struct mnt_idmap *idmap, +struct posix_acl *fuse_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type) {struct inode *inode =d_inode (dentry);
fs/fuse/fuse_i.h +1 -1
@@ -1205,7 +1205,7 @@ extern const struct xattr_handler * const fuse_xattr_handlers[];struct posix_acl ;struct posix_acl *fuse_get_inode_acl (struct inode *inode,int type,bool rcu); -struct posix_acl *fuse_get_acl (struct mnt_idmap *idmap, +struct posix_acl *fuse_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type);int fuse_set_acl (const struct mnt_idmap *,struct dentry *dentry,struct posix_acl *acl,int type);
fs/internal.h +2 -2
@@ -304,7 +304,7 @@ int may_write_xattr(const struct mnt_idmap *idmap, struct inode *inode);#ifdef CONFIG_FS_POSIX_ACL int do_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,const void *kvalue,size_t size); -ssize_t do_get_acl (struct mnt_idmap *idmap,struct dentry *dentry, +ssize_t do_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,void *kvalue,size_t size);#else static inline int do_set_acl(const struct mnt_idmap *idmap,
@@ -313,7 +313,7 @@ static inline int do_set_acl(const struct mnt_idmap *idmap, {return -EOPNOTSUPP ; } -static inline ssize_t do_get_acl (struct mnt_idmap *idmap, +static inline ssize_t do_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,void *kvalue,size_t size) {
fs/ntfs/ea.c +1 -1
@@ -954,7 +954,7 @@ const struct xattr_handler * const ntfs_xattr_handlers[] = {// clang-format on #ifdef CONFIG_NTFS_FS_POSIX_ACL -struct posix_acl *ntfs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry, +struct posix_acl *ntfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type) {struct inode *inode =d_inode (dentry);
fs/ntfs/ea.h +1 -1
@@ -17,7 +17,7 @@ int ntfs_ea_set_wsl_inode(struct inode *inode, dev_t rdev, __le16 *ea_size,ssize_t ntfs_listxattr (struct dentry *dentry,char *buffer,size_t size);#ifdef CONFIG_NTFS_FS_POSIX_ACL -struct posix_acl *ntfs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry, +struct posix_acl *ntfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type);int ntfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);
fs/ntfs3/ntfs_fs.h +1 -1
@@ -963,7 +963,7 @@ unsigned long ntfs_names_hash(const u16 *name, size_t len, const u16 *upcase,/* globals from xattr.c */ #ifdef CONFIG_NTFS3_FS_POSIX_ACL -struct posix_acl *ntfs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry, +struct posix_acl *ntfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type);int ntfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);
fs/ntfs3/xattr.c +1 -1
@@ -543,7 +543,7 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name,/* * ntfs_get_acl - inode_operations::get_acl */ -struct posix_acl *ntfs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry, +struct posix_acl *ntfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type) {struct inode *inode =d_inode (dentry);
fs/overlayfs/overlayfs.h +1 -1
@@ -814,7 +814,7 @@ static inline struct posix_acl *ovl_get_inode_acl(struct inode *inode, int type, {return do_ovl_get_acl (&nop_mnt_idmap, inode, type, rcu, true); } -static inline struct posix_acl *ovl_get_acl (struct mnt_idmap *idmap, +static inline struct posix_acl *ovl_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type) {return do_ovl_get_acl (idmap,d_inode (dentry), type, false, false);
fs/posix_acl.c +3 -3
@@ -118,7 +118,7 @@ void forget_all_cached_acls(struct inode *inode) }EXPORT_SYMBOL (forget_all_cached_acls); -static struct posix_acl *__get_acl (struct mnt_idmap *idmap, +static struct posix_acl *__get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct inode *inode,int type) {
@@ -1168,7 +1168,7 @@ EXPORT_SYMBOL_GPL(vfs_set_acl);* * Return: On success POSIX ACLs in VFS format, on error negative errno. */ -struct posix_acl *vfs_get_acl (struct mnt_idmap *idmap, +struct posix_acl *vfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {struct inode *inode =d_inode (dentry);
@@ -1286,7 +1286,7 @@ int do_set_acl(const struct mnt_idmap *idmap, struct dentry *dentry,return error; } -ssize_t do_get_acl (struct mnt_idmap *idmap,struct dentry *dentry, +ssize_t do_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,void *kvalue,size_t size) {ssize_t error;
fs/smb/client/cifsacl.c +1 -1
@@ -1867,7 +1867,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,return rc; } -struct posix_acl *cifs_get_acl (struct mnt_idmap *idmap, +struct posix_acl *cifs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type) {#if defined(CONFIG_CIFS_ALLOW_INSECURE_LEGACY ) && defined(CONFIG_CIFS_POSIX )
fs/smb/client/cifsproto.h +1 -1
@@ -212,7 +212,7 @@ struct smb_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb,struct smb_ntsd *get_cifs_acl_by_fid (struct cifs_sb_info *cifs_sb,const struct cifs_fid *cifsfid,u32 *pacllen,u32 info); -struct posix_acl *cifs_get_acl (struct mnt_idmap *idmap,struct dentry *dentry, +struct posix_acl *cifs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,int type);int cifs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,struct posix_acl *acl,int type);
fs/xattr.c +1 -1
@@ -787,7 +787,7 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,* Extended attribute GET operations */ static ssize_t -do_getxattr (struct mnt_idmap *idmap,struct dentry *d, +do_getxattr (const struct mnt_idmap *idmap,struct dentry *d,struct kernel_xattr_ctx *ctx) {ssize_t error;
include/linux/fs.h +1 -1
@@ -2026,7 +2026,7 @@ struct inode_operations { umode_t create_mode);int (*tmpfile) (struct mnt_idmap *,struct inode *,struct file *,umode_t ); -struct posix_acl *(*get_acl)(struct mnt_idmap *,struct dentry *, +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 );
include/linux/posix_acl.h +2 -2
@@ -107,7 +107,7 @@ static inline void cache_no_acl(struct inode *inode)int vfs_set_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name,struct posix_acl *kacl); -struct posix_acl *vfs_get_acl (struct mnt_idmap *idmap, +struct posix_acl *vfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name);int vfs_remove_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name);
@@ -148,7 +148,7 @@ static inline int vfs_set_acl(const struct mnt_idmap *idmap,return -EOPNOTSUPP ; } -static inline struct posix_acl *vfs_get_acl (struct mnt_idmap *idmap, +static inline struct posix_acl *vfs_get_acl (const struct mnt_idmap *idmap,struct dentry *dentry,const char *acl_name) {
Signature · 1 line
2.53.0
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
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
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
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
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
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
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