Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: port ->mkdir() to pass mnt_idmap

Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>

+69 -65
+1 -1
Documentation/filesystems/locking.rst
··· 61 61 int (*link) (struct dentry *,struct inode *,struct dentry *); 62 62 int (*unlink) (struct inode *,struct dentry *); 63 63 int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); 64 - int (*mkdir) (struct inode *,struct dentry *,umode_t); 64 + int (*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); 65 65 int (*rmdir) (struct inode *,struct dentry *); 66 66 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 67 67 int (*rename) (struct inode *, struct dentry *,
+1 -1
Documentation/filesystems/vfs.rst
··· 426 426 int (*link) (struct dentry *,struct inode *,struct dentry *); 427 427 int (*unlink) (struct inode *,struct dentry *); 428 428 int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *); 429 - int (*mkdir) (struct user_namespace *, struct inode *,struct dentry *,umode_t); 429 + int (*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t); 430 430 int (*rmdir) (struct inode *,struct dentry *); 431 431 int (*mknod) (struct user_namespace *, struct inode *,struct dentry *,umode_t,dev_t); 432 432 int (*rename) (struct user_namespace *, struct inode *, struct dentry *,
+2 -2
fs/9p/vfs_inode.c
··· 704 704 705 705 /** 706 706 * v9fs_vfs_mkdir - VFS mkdir hook to create a directory 707 - * @mnt_userns: The user namespace of the mount 707 + * @idmap: idmap of the mount 708 708 * @dir: inode that is being unlinked 709 709 * @dentry: dentry that is being unlinked 710 710 * @mode: mode for new directory 711 711 * 712 712 */ 713 713 714 - static int v9fs_vfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 714 + static int v9fs_vfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 715 715 struct dentry *dentry, umode_t mode) 716 716 { 717 717 int err;
+2 -2
fs/9p/vfs_inode_dotl.c
··· 357 357 358 358 /** 359 359 * v9fs_vfs_mkdir_dotl - VFS mkdir hook to create a directory 360 - * @mnt_userns: The user namespace of the mount 360 + * @idmap: The idmap of the mount 361 361 * @dir: inode that is being unlinked 362 362 * @dentry: dentry that is being unlinked 363 363 * @omode: mode for new directory 364 364 * 365 365 */ 366 366 367 - static int v9fs_vfs_mkdir_dotl(struct user_namespace *mnt_userns, 367 + static int v9fs_vfs_mkdir_dotl(struct mnt_idmap *idmap, 368 368 struct inode *dir, struct dentry *dentry, 369 369 umode_t omode) 370 370 {
+1 -1
fs/affs/affs.h
··· 169 169 extern int affs_unlink(struct inode *dir, struct dentry *dentry); 170 170 extern int affs_create(struct mnt_idmap *idmap, struct inode *dir, 171 171 struct dentry *dentry, umode_t mode, bool); 172 - extern int affs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 172 + extern int affs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 173 173 struct dentry *dentry, umode_t mode); 174 174 extern int affs_rmdir(struct inode *dir, struct dentry *dentry); 175 175 extern int affs_link(struct dentry *olddentry, struct inode *dir,
+1 -1
fs/affs/namei.c
··· 274 274 } 275 275 276 276 int 277 - affs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 277 + affs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 278 278 struct dentry *dentry, umode_t mode) 279 279 { 280 280 struct inode *inode;
+2 -2
fs/afs/dir.c
··· 30 30 loff_t fpos, u64 ino, unsigned dtype); 31 31 static int afs_create(struct mnt_idmap *idmap, struct inode *dir, 32 32 struct dentry *dentry, umode_t mode, bool excl); 33 - static int afs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 33 + static int afs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 34 34 struct dentry *dentry, umode_t mode); 35 35 static int afs_rmdir(struct inode *dir, struct dentry *dentry); 36 36 static int afs_unlink(struct inode *dir, struct dentry *dentry); ··· 1332 1332 /* 1333 1333 * create a directory on an AFS filesystem 1334 1334 */ 1335 - static int afs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 1335 + static int afs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 1336 1336 struct dentry *dentry, umode_t mode) 1337 1337 { 1338 1338 struct afs_operation *op;
+2 -2
fs/autofs/root.c
··· 15 15 struct dentry *, const char *); 16 16 static int autofs_dir_unlink(struct inode *, struct dentry *); 17 17 static int autofs_dir_rmdir(struct inode *, struct dentry *); 18 - static int autofs_dir_mkdir(struct user_namespace *, struct inode *, 18 + static int autofs_dir_mkdir(struct mnt_idmap *, struct inode *, 19 19 struct dentry *, umode_t); 20 20 static long autofs_root_ioctl(struct file *, unsigned int, unsigned long); 21 21 #ifdef CONFIG_COMPAT ··· 720 720 return 0; 721 721 } 722 722 723 - static int autofs_dir_mkdir(struct user_namespace *mnt_userns, 723 + static int autofs_dir_mkdir(struct mnt_idmap *idmap, 724 724 struct inode *dir, struct dentry *dentry, 725 725 umode_t mode) 726 726 {
+1 -1
fs/bad_inode.c
··· 58 58 return -EIO; 59 59 } 60 60 61 - static int bad_inode_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 61 + static int bad_inode_mkdir(struct mnt_idmap *idmap, struct inode *dir, 62 62 struct dentry *dentry, umode_t mode) 63 63 { 64 64 return -EIO;
+2 -1
fs/btrfs/inode.c
··· 6839 6839 return err; 6840 6840 } 6841 6841 6842 - static int btrfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 6842 + static int btrfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 6843 6843 struct dentry *dentry, umode_t mode) 6844 6844 { 6845 + struct user_namespace *mnt_userns = mnt_idmap_owner(idmap); 6845 6846 struct inode *inode; 6846 6847 6847 6848 inode = new_inode(dir->i_sb);
+1 -1
fs/ceph/dir.c
··· 971 971 return err; 972 972 } 973 973 974 - static int ceph_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 974 + static int ceph_mkdir(struct mnt_idmap *idmap, struct inode *dir, 975 975 struct dentry *dentry, umode_t mode) 976 976 { 977 977 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(dir->i_sb);
+1 -1
fs/cifs/cifsfs.h
··· 59 59 extern int cifs_hardlink(struct dentry *, struct inode *, struct dentry *); 60 60 extern int cifs_mknod(struct user_namespace *, struct inode *, struct dentry *, 61 61 umode_t, dev_t); 62 - extern int cifs_mkdir(struct user_namespace *, struct inode *, struct dentry *, 62 + extern int cifs_mkdir(struct mnt_idmap *, struct inode *, struct dentry *, 63 63 umode_t); 64 64 extern int cifs_rmdir(struct inode *, struct dentry *); 65 65 extern int cifs_rename2(struct user_namespace *, struct inode *,
+1 -1
fs/cifs/inode.c
··· 1910 1910 } 1911 1911 #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ 1912 1912 1913 - int cifs_mkdir(struct user_namespace *mnt_userns, struct inode *inode, 1913 + int cifs_mkdir(struct mnt_idmap *idmap, struct inode *inode, 1914 1914 struct dentry *direntry, umode_t mode) 1915 1915 { 1916 1916 int rc = 0;
+1 -1
fs/coda/dir.c
··· 166 166 return error; 167 167 } 168 168 169 - static int coda_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 169 + static int coda_mkdir(struct mnt_idmap *idmap, struct inode *dir, 170 170 struct dentry *de, umode_t mode) 171 171 { 172 172 struct inode *inode;
+1 -1
fs/configfs/dir.c
··· 1251 1251 } 1252 1252 EXPORT_SYMBOL(configfs_depend_item_unlocked); 1253 1253 1254 - static int configfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 1254 + static int configfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 1255 1255 struct dentry *dentry, umode_t mode) 1256 1256 { 1257 1257 int ret = 0;
+1 -1
fs/ecryptfs/inode.c
··· 495 495 return rc; 496 496 } 497 497 498 - static int ecryptfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 498 + static int ecryptfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 499 499 struct dentry *dentry, umode_t mode) 500 500 { 501 501 int rc;
+1 -1
fs/exfat/namei.c
··· 834 834 return err; 835 835 } 836 836 837 - static int exfat_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 837 + static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, 838 838 struct dentry *dentry, umode_t mode) 839 839 { 840 840 struct super_block *sb = dir->i_sb;
+1 -1
fs/ext2/namei.c
··· 225 225 return err; 226 226 } 227 227 228 - static int ext2_mkdir(struct user_namespace * mnt_userns, 228 + static int ext2_mkdir(struct mnt_idmap * idmap, 229 229 struct inode * dir, struct dentry * dentry, umode_t mode) 230 230 { 231 231 struct inode * inode;
+2 -1
fs/ext4/namei.c
··· 2973 2973 return err; 2974 2974 } 2975 2975 2976 - static int ext4_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 2976 + static int ext4_mkdir(struct mnt_idmap *idmap, struct inode *dir, 2977 2977 struct dentry *dentry, umode_t mode) 2978 2978 { 2979 + struct user_namespace *mnt_userns = mnt_idmap_owner(idmap); 2979 2980 handle_t *handle; 2980 2981 struct inode *inode; 2981 2982 int err, err2 = 0, credits, retries = 0;
+2 -1
fs/f2fs/namei.c
··· 741 741 return err; 742 742 } 743 743 744 - static int f2fs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 744 + static int f2fs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 745 745 struct dentry *dentry, umode_t mode) 746 746 { 747 + struct user_namespace *mnt_userns = mnt_idmap_owner(idmap); 747 748 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); 748 749 struct inode *inode; 749 750 int err;
+1 -1
fs/fat/namei_msdos.c
··· 339 339 } 340 340 341 341 /***** Make a directory */ 342 - static int msdos_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 342 + static int msdos_mkdir(struct mnt_idmap *idmap, struct inode *dir, 343 343 struct dentry *dentry, umode_t mode) 344 344 { 345 345 struct super_block *sb = dir->i_sb;
+1 -1
fs/fat/namei_vfat.c
··· 844 844 return err; 845 845 } 846 846 847 - static int vfat_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 847 + static int vfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, 848 848 struct dentry *dentry, umode_t mode) 849 849 { 850 850 struct super_block *sb = dir->i_sb;
+1 -1
fs/fuse/dir.c
··· 819 819 return err; 820 820 } 821 821 822 - static int fuse_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 822 + static int fuse_mkdir(struct mnt_idmap *idmap, struct inode *dir, 823 823 struct dentry *entry, umode_t mode) 824 824 { 825 825 struct fuse_mkdir_in inarg;
+2 -2
fs/gfs2/inode.c
··· 1229 1229 1230 1230 /** 1231 1231 * gfs2_mkdir - Make a directory 1232 - * @mnt_userns: User namespace of the mount the inode was found from 1232 + * @idmap: idmap of the mount the inode was found from 1233 1233 * @dir: The parent directory of the new one 1234 1234 * @dentry: The dentry of the new directory 1235 1235 * @mode: The mode of the new directory ··· 1237 1237 * Returns: errno 1238 1238 */ 1239 1239 1240 - static int gfs2_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 1240 + static int gfs2_mkdir(struct mnt_idmap *idmap, struct inode *dir, 1241 1241 struct dentry *dentry, umode_t mode) 1242 1242 { 1243 1243 unsigned dsize = gfs2_max_stuffed_size(GFS2_I(dir));
+1 -1
fs/hfs/dir.c
··· 219 219 * in a directory, given the inode for the parent directory and the 220 220 * name (and its length) of the new directory. 221 221 */ 222 - static int hfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 222 + static int hfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 223 223 struct dentry *dentry, umode_t mode) 224 224 { 225 225 struct inode *inode;
+1 -1
fs/hfsplus/dir.c
··· 523 523 return hfsplus_mknod(&init_user_ns, dir, dentry, mode, 0); 524 524 } 525 525 526 - static int hfsplus_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 526 + static int hfsplus_mkdir(struct mnt_idmap *idmap, struct inode *dir, 527 527 struct dentry *dentry, umode_t mode) 528 528 { 529 529 return hfsplus_mknod(&init_user_ns, dir, dentry, mode | S_IFDIR, 0);
+1 -1
fs/hostfs/hostfs_kern.c
··· 671 671 return err; 672 672 } 673 673 674 - static int hostfs_mkdir(struct user_namespace *mnt_userns, struct inode *ino, 674 + static int hostfs_mkdir(struct mnt_idmap *idmap, struct inode *ino, 675 675 struct dentry *dentry, umode_t mode) 676 676 { 677 677 char *file;
+1 -1
fs/hpfs/namei.c
··· 20 20 hpfs_write_inode_nolock(dir); 21 21 } 22 22 23 - static int hpfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 23 + static int hpfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 24 24 struct dentry *dentry, umode_t mode) 25 25 { 26 26 const unsigned char *name = dentry->d_name.name;
+1 -1
fs/hugetlbfs/inode.c
··· 1033 1033 return 0; 1034 1034 } 1035 1035 1036 - static int hugetlbfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 1036 + static int hugetlbfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 1037 1037 struct dentry *dentry, umode_t mode) 1038 1038 { 1039 1039 int retval = hugetlbfs_mknod(&init_user_ns, dir, dentry,
+2 -2
fs/jffs2/dir.c
··· 32 32 static int jffs2_unlink (struct inode *,struct dentry *); 33 33 static int jffs2_symlink (struct mnt_idmap *, struct inode *, 34 34 struct dentry *, const char *); 35 - static int jffs2_mkdir (struct user_namespace *, struct inode *,struct dentry *, 35 + static int jffs2_mkdir (struct mnt_idmap *, struct inode *,struct dentry *, 36 36 umode_t); 37 37 static int jffs2_rmdir (struct inode *,struct dentry *); 38 38 static int jffs2_mknod (struct user_namespace *, struct inode *,struct dentry *, ··· 442 442 } 443 443 444 444 445 - static int jffs2_mkdir (struct user_namespace *mnt_userns, struct inode *dir_i, 445 + static int jffs2_mkdir (struct mnt_idmap *idmap, struct inode *dir_i, 446 446 struct dentry *dentry, umode_t mode) 447 447 { 448 448 struct jffs2_inode_info *f, *dir_f;
+1 -1
fs/jfs/namei.c
··· 192 192 * note: 193 193 * EACCES: user needs search+write permission on the parent directory 194 194 */ 195 - static int jfs_mkdir(struct user_namespace *mnt_userns, struct inode *dip, 195 + static int jfs_mkdir(struct mnt_idmap *idmap, struct inode *dip, 196 196 struct dentry *dentry, umode_t mode) 197 197 { 198 198 int rc = 0;
+1 -1
fs/kernfs/dir.c
··· 1200 1200 return d_splice_alias(inode, dentry); 1201 1201 } 1202 1202 1203 - static int kernfs_iop_mkdir(struct user_namespace *mnt_userns, 1203 + static int kernfs_iop_mkdir(struct mnt_idmap *idmap, 1204 1204 struct inode *dir, struct dentry *dentry, 1205 1205 umode_t mode) 1206 1206 {
+1 -1
fs/minix/namei.c
··· 111 111 return add_nondir(dentry, inode); 112 112 } 113 113 114 - static int minix_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 114 + static int minix_mkdir(struct mnt_idmap *idmap, struct inode *dir, 115 115 struct dentry *dentry, umode_t mode) 116 116 { 117 117 struct inode * inode;
+1 -1
fs/namei.c
··· 4044 4044 if (max_links && dir->i_nlink >= max_links) 4045 4045 return -EMLINK; 4046 4046 4047 - error = dir->i_op->mkdir(mnt_userns, dir, dentry, mode); 4047 + error = dir->i_op->mkdir(idmap, dir, dentry, mode); 4048 4048 if (!error) 4049 4049 fsnotify_mkdir(dir, dentry); 4050 4050 return error;
+1 -1
fs/nfs/dir.c
··· 2352 2352 /* 2353 2353 * See comments for nfs_proc_create regarding failed operations. 2354 2354 */ 2355 - int nfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 2355 + int nfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 2356 2356 struct dentry *dentry, umode_t mode) 2357 2357 { 2358 2358 struct iattr attr;
+1 -1
fs/nfs/internal.h
··· 386 386 void nfs_d_prune_case_insensitive_aliases(struct inode *inode); 387 387 int nfs_create(struct mnt_idmap *, struct inode *, struct dentry *, 388 388 umode_t, bool); 389 - int nfs_mkdir(struct user_namespace *, struct inode *, struct dentry *, 389 + int nfs_mkdir(struct mnt_idmap *, struct inode *, struct dentry *, 390 390 umode_t); 391 391 int nfs_rmdir(struct inode *, struct dentry *); 392 392 int nfs_unlink(struct inode *, struct dentry *);
+1 -1
fs/nilfs2/namei.c
··· 202 202 return err; 203 203 } 204 204 205 - static int nilfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 205 + static int nilfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 206 206 struct dentry *dentry, umode_t mode) 207 207 { 208 208 struct inode *inode;
+2 -1
fs/ntfs3/namei.c
··· 200 200 /* 201 201 * ntfs_mkdir- inode_operations::mkdir 202 202 */ 203 - static int ntfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 203 + static int ntfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 204 204 struct dentry *dentry, umode_t mode) 205 205 { 206 + struct user_namespace *mnt_userns = mnt_idmap_owner(idmap); 206 207 struct inode *inode; 207 208 208 209 inode = ntfs_create_inode(mnt_userns, dir, dentry, NULL, S_IFDIR | mode,
+1 -1
fs/ocfs2/dlmfs/dlmfs.c
··· 402 402 * File creation. Allocate an inode, and we're done.. 403 403 */ 404 404 /* SMP-safe */ 405 - static int dlmfs_mkdir(struct user_namespace * mnt_userns, 405 + static int dlmfs_mkdir(struct mnt_idmap * idmap, 406 406 struct inode * dir, 407 407 struct dentry * dentry, 408 408 umode_t mode)
+1 -1
fs/ocfs2/namei.c
··· 642 642 fe_blkno, suballoc_loc, suballoc_bit); 643 643 } 644 644 645 - static int ocfs2_mkdir(struct user_namespace *mnt_userns, 645 + static int ocfs2_mkdir(struct mnt_idmap *idmap, 646 646 struct inode *dir, 647 647 struct dentry *dentry, 648 648 umode_t mode)
+1 -1
fs/omfs/dir.c
··· 279 279 return err; 280 280 } 281 281 282 - static int omfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 282 + static int omfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 283 283 struct dentry *dentry, umode_t mode) 284 284 { 285 285 return omfs_add_node(dir, dentry, mode | S_IFDIR);
+1 -1
fs/orangefs/namei.c
··· 305 305 return ret; 306 306 } 307 307 308 - static int orangefs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 308 + static int orangefs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 309 309 struct dentry *dentry, umode_t mode) 310 310 { 311 311 struct orangefs_inode_s *parent = ORANGEFS_I(dir);
+1 -1
fs/overlayfs/dir.c
··· 661 661 return ovl_create_object(dentry, (mode & 07777) | S_IFREG, 0, NULL); 662 662 } 663 663 664 - static int ovl_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 664 + static int ovl_mkdir(struct mnt_idmap *idmap, struct inode *dir, 665 665 struct dentry *dentry, umode_t mode) 666 666 { 667 667 return ovl_create_object(dentry, (mode & 07777) | S_IFDIR, 0, NULL);
+1 -1
fs/ramfs/inode.c
··· 110 110 return error; 111 111 } 112 112 113 - static int ramfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 113 + static int ramfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 114 114 struct dentry *dentry, umode_t mode) 115 115 { 116 116 int retval = ramfs_mknod(&init_user_ns, dir, dentry, mode | S_IFDIR, 0);
+1 -1
fs/reiserfs/namei.c
··· 784 784 return retval; 785 785 } 786 786 787 - static int reiserfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 787 + static int reiserfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 788 788 struct dentry *dentry, umode_t mode) 789 789 { 790 790 int retval;
+1 -1
fs/reiserfs/xattr.c
··· 73 73 static int xattr_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 74 74 { 75 75 BUG_ON(!inode_is_locked(dir)); 76 - return dir->i_op->mkdir(&init_user_ns, dir, dentry, mode); 76 + return dir->i_op->mkdir(&nop_mnt_idmap, dir, dentry, mode); 77 77 } 78 78 79 79 /*
+1 -1
fs/sysv/namei.c
··· 110 110 return add_nondir(dentry, inode); 111 111 } 112 112 113 - static int sysv_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 113 + static int sysv_mkdir(struct mnt_idmap *idmap, struct inode *dir, 114 114 struct dentry *dentry, umode_t mode) 115 115 { 116 116 struct inode * inode;
+1 -1
fs/tracefs/inode.c
··· 67 67 return name; 68 68 } 69 69 70 - static int tracefs_syscall_mkdir(struct user_namespace *mnt_userns, 70 + static int tracefs_syscall_mkdir(struct mnt_idmap *idmap, 71 71 struct inode *inode, struct dentry *dentry, 72 72 umode_t mode) 73 73 {
+1 -1
fs/ubifs/dir.c
··· 979 979 return err; 980 980 } 981 981 982 - static int ubifs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 982 + static int ubifs_mkdir(struct mnt_idmap *idmap, struct inode *dir, 983 983 struct dentry *dentry, umode_t mode) 984 984 { 985 985 struct inode *inode;
+1 -1
fs/udf/namei.c
··· 661 661 return udf_add_nondir(dentry, inode); 662 662 } 663 663 664 - static int udf_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 664 + static int udf_mkdir(struct mnt_idmap *idmap, struct inode *dir, 665 665 struct dentry *dentry, umode_t mode) 666 666 { 667 667 struct inode *inode;
+1 -1
fs/ufs/namei.c
··· 166 166 return error; 167 167 } 168 168 169 - static int ufs_mkdir(struct user_namespace * mnt_userns, struct inode * dir, 169 + static int ufs_mkdir(struct mnt_idmap * idmap, struct inode * dir, 170 170 struct dentry * dentry, umode_t mode) 171 171 { 172 172 struct inode * inode;
+1 -1
fs/vboxsf/dir.c
··· 301 301 return vboxsf_dir_create(parent, dentry, mode, false, excl, NULL); 302 302 } 303 303 304 - static int vboxsf_dir_mkdir(struct user_namespace *mnt_userns, 304 + static int vboxsf_dir_mkdir(struct mnt_idmap *idmap, 305 305 struct inode *parent, struct dentry *dentry, 306 306 umode_t mode) 307 307 {
+3 -3
fs/xfs/xfs_iops.c
··· 278 278 279 279 STATIC int 280 280 xfs_vn_mkdir( 281 - struct user_namespace *mnt_userns, 281 + struct mnt_idmap *idmap, 282 282 struct inode *dir, 283 283 struct dentry *dentry, 284 284 umode_t mode) 285 285 { 286 - return xfs_generic_create(mnt_userns, dir, dentry, mode | S_IFDIR, 0, 287 - NULL); 286 + return xfs_generic_create(mnt_idmap_owner(idmap), dir, dentry, 287 + mode | S_IFDIR, 0, NULL); 288 288 } 289 289 290 290 STATIC struct dentry *
+1 -1
include/linux/fs.h
··· 2145 2145 int (*unlink) (struct inode *,struct dentry *); 2146 2146 int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *, 2147 2147 const char *); 2148 - int (*mkdir) (struct user_namespace *, struct inode *,struct dentry *, 2148 + int (*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *, 2149 2149 umode_t); 2150 2150 int (*rmdir) (struct inode *,struct dentry *); 2151 2151 int (*mknod) (struct user_namespace *, struct inode *,struct dentry *,
+1 -1
kernel/bpf/inode.c
··· 152 152 dir->i_ctime = dir->i_mtime; 153 153 } 154 154 155 - static int bpf_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 155 + static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir, 156 156 struct dentry *dentry, umode_t mode) 157 157 { 158 158 struct inode *inode;
+1 -1
mm/shmem.c
··· 2970 2970 return error; 2971 2971 } 2972 2972 2973 - static int shmem_mkdir(struct user_namespace *mnt_userns, struct inode *dir, 2973 + static int shmem_mkdir(struct mnt_idmap *idmap, struct inode *dir, 2974 2974 struct dentry *dentry, umode_t mode) 2975 2975 { 2976 2976 int error;
+1 -1
security/apparmor/apparmorfs.c
··· 1793 1793 return error; 1794 1794 } 1795 1795 1796 - static int ns_mkdir_op(struct user_namespace *mnt_userns, struct inode *dir, 1796 + static int ns_mkdir_op(struct mnt_idmap *idmap, struct inode *dir, 1797 1797 struct dentry *dentry, umode_t mode) 1798 1798 { 1799 1799 struct aa_ns *ns, *parent;