umode_t create_mode);
        int (*tmpfile) (struct mnt_idmap *, struct inode *,
                        struct file *, umode_t);
-       int (*fileattr_set)(struct user_namespace *mnt_userns,
+       int (*fileattr_set)(struct mnt_idmap *idmap,
                            struct dentry *dentry, struct fileattr *fa);
        int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
        struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
 
                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 user_namespace *mnt_userns,
+               int (*fileattr_set)(struct mnt_idmap *idmap,
                                    struct dentry *dentry, struct fileattr *fa);
                int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
        };
 
        return 0;
 }
 
-int btrfs_fileattr_set(struct user_namespace *mnt_userns,
+int btrfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 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 fileattr *fa);
-int btrfs_fileattr_set(struct user_namespace *mnt_userns,
+int btrfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa);
 int btrfs_ioctl_get_supported_features(void __user *arg);
 void btrfs_sync_inode_flags_to_i_flags(struct inode *inode);
 
        return vfs_fileattr_get(ecryptfs_dentry_to_lower(dentry), fa);
 }
 
-static int ecryptfs_fileattr_set(struct user_namespace *mnt_userns,
+static int ecryptfs_fileattr_set(struct mnt_idmap *idmap,
                                 struct dentry *dentry, struct fileattr *fa)
 {
        struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
        int rc;
 
-       rc = vfs_fileattr_set(&init_user_ns, lower_dentry, fa);
+       rc = vfs_fileattr_set(&nop_mnt_idmap, lower_dentry, fa);
        fsstack_copy_attr_all(d_inode(dentry), d_inode(lower_dentry));
 
        return rc;
 
 }
 
 static int
-efivarfs_fileattr_set(struct user_namespace *mnt_userns,
+efivarfs_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        unsigned int i_flags = 0;
 
 
 /* ioctl.c */
 extern int ext2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-extern int ext2_fileattr_set(struct user_namespace *mnt_userns,
+extern int ext2_fileattr_set(struct mnt_idmap *idmap,
                             struct dentry *dentry, struct fileattr *fa);
 extern long ext2_ioctl(struct file *, unsigned int, unsigned long);
 extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long);
 
        return 0;
 }
 
-int ext2_fileattr_set(struct user_namespace *mnt_userns,
+int ext2_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 /* 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 user_namespace *mnt_userns,
+int ext4_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa);
 int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa);
 extern void ext4_reset_inode_seed(struct inode *inode);
 
        return 0;
 }
 
-int ext4_fileattr_set(struct user_namespace *mnt_userns,
+int ext4_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count);
 int f2fs_precache_extents(struct inode *inode);
 int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int f2fs_fileattr_set(struct user_namespace *mnt_userns,
+int f2fs_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *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);
 
        return 0;
 }
 
-int f2fs_fileattr_set(struct user_namespace *mnt_userns,
+int f2fs_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 long fuse_file_compat_ioctl(struct file *file, unsigned int cmd,
                            unsigned long arg);
 int fuse_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int fuse_fileattr_set(struct user_namespace *mnt_userns,
+int fuse_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa);
 
 /* file.c */
 
        return err;
 }
 
-int fuse_fileattr_set(struct user_namespace *mnt_userns,
+int fuse_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
        return error;
 }
 
-int gfs2_fileattr_set(struct user_namespace *mnt_userns,
+int gfs2_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 extern const struct file_operations gfs2_dir_fops_nolock;
 
 extern int gfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-extern int gfs2_fileattr_set(struct user_namespace *mnt_userns,
+extern int gfs2_fileattr_set(struct mnt_idmap *idmap,
                             struct dentry *dentry, struct fileattr *fa);
 extern void gfs2_set_inode_flags(struct inode *inode);
  
 
 int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
                       int datasync);
 int hfsplus_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int hfsplus_fileattr_set(struct user_namespace *mnt_userns,
+int hfsplus_fileattr_set(struct mnt_idmap *idmap,
                         struct dentry *dentry, struct fileattr *fa);
 
 /* ioctl.c */
 
        return 0;
 }
 
-int hfsplus_fileattr_set(struct user_namespace *mnt_userns,
+int hfsplus_fileattr_set(struct mnt_idmap *idmap,
                         struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 
 /**
  * vfs_fileattr_set - change miscellaneous file attributes
- * @mnt_userns:        user namespace of the mount
+ * @idmap:     idmap of the mount
  * @dentry:    the object to change
  * @fa:                fileattr pointer
  *
  *
  * Return: 0 on success, or a negative error on failure.
  */
-int vfs_fileattr_set(struct user_namespace *mnt_userns, struct dentry *dentry,
+int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
                     struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
        if (!inode->i_op->fileattr_set)
                return -ENOIOCTLCMD;
 
-       if (!inode_owner_or_capable(mnt_userns, inode))
+       if (!inode_owner_or_capable(mnt_idmap_owner(idmap), inode))
                return -EPERM;
 
        inode_lock(inode);
                }
                err = fileattr_set_prepare(inode, &old_ma, fa);
                if (!err)
-                       err = inode->i_op->fileattr_set(mnt_userns, dentry, fa);
+                       err = inode->i_op->fileattr_set(idmap, dentry, fa);
        }
        inode_unlock(inode);
 
 
 static int ioctl_setflags(struct file *file, unsigned int __user *argp)
 {
-       struct user_namespace *mnt_userns = file_mnt_user_ns(file);
+       struct mnt_idmap *idmap = file_mnt_idmap(file);
        struct dentry *dentry = file->f_path.dentry;
        struct fileattr fa;
        unsigned int flags;
                err = mnt_want_write_file(file);
                if (!err) {
                        fileattr_fill_flags(&fa, flags);
-                       err = vfs_fileattr_set(mnt_userns, dentry, &fa);
+                       err = vfs_fileattr_set(idmap, dentry, &fa);
                        mnt_drop_write_file(file);
                }
        }
 
 static int ioctl_fssetxattr(struct file *file, void __user *argp)
 {
-       struct user_namespace *mnt_userns = file_mnt_user_ns(file);
+       struct mnt_idmap *idmap = file_mnt_idmap(file);
        struct dentry *dentry = file->f_path.dentry;
        struct fileattr fa;
        int err;
        if (!err) {
                err = mnt_want_write_file(file);
                if (!err) {
-                       err = vfs_fileattr_set(mnt_userns, dentry, &fa);
+                       err = vfs_fileattr_set(idmap, dentry, &fa);
                        mnt_drop_write_file(file);
                }
        }
 
        return 0;
 }
 
-int jfs_fileattr_set(struct user_namespace *mnt_userns,
+int jfs_fileattr_set(struct mnt_idmap *idmap,
                     struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 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 fileattr *fa);
-extern int jfs_fileattr_set(struct user_namespace *mnt_userns,
+extern int jfs_fileattr_set(struct mnt_idmap *idmap,
                            struct dentry *dentry, struct fileattr *fa);
 extern long jfs_ioctl(struct file *, unsigned int, unsigned long);
 extern struct inode *jfs_iget(struct super_block *, unsigned long);
 
 /**
  * nilfs_fileattr_set - ioctl to support chattr
  */
-int nilfs_fileattr_set(struct user_namespace *mnt_userns,
+int nilfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 
 /* ioctl.c */
 int nilfs_fileattr_get(struct dentry *dentry, struct fileattr *m);
-int nilfs_fileattr_set(struct user_namespace *mnt_userns,
+int nilfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa);
 long nilfs_ioctl(struct file *, unsigned int, unsigned long);
 long nilfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 
        return status;
 }
 
-int ocfs2_fileattr_set(struct user_namespace *mnt_userns,
+int ocfs2_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 #define OCFS2_IOCTL_PROTO_H
 
 int ocfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int ocfs2_fileattr_set(struct user_namespace *mnt_userns,
+int ocfs2_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *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);
 
        return 0;
 }
 
-static int orangefs_fileattr_set(struct user_namespace *mnt_userns,
+static int orangefs_fileattr_set(struct mnt_idmap *idmap,
                                 struct dentry *dentry, struct fileattr *fa)
 {
        u64 val = 0;
 
        if (err)
                return err;
 
-       return vfs_fileattr_set(mnt_user_ns(realpath->mnt), realpath->dentry, fa);
+       return vfs_fileattr_set(mnt_idmap(realpath->mnt), realpath->dentry, fa);
 }
 
-int ovl_fileattr_set(struct user_namespace *mnt_userns,
+int ovl_fileattr_set(struct mnt_idmap *idmap,
                     struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 int ovl_real_fileattr_get(const struct path *realpath, struct fileattr *fa);
 int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa);
 int ovl_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int ovl_fileattr_set(struct user_namespace *mnt_userns,
+int ovl_fileattr_set(struct mnt_idmap *idmap,
                     struct dentry *dentry, struct fileattr *fa);
 
 /* copy_up.c */
 
        return 0;
 }
 
-int reiserfs_fileattr_set(struct user_namespace *mnt_userns,
+int reiserfs_fileattr_set(struct mnt_idmap *idmap,
                          struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 
 /* prototypes from ioctl.c */
 int reiserfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int reiserfs_fileattr_set(struct user_namespace *mnt_userns,
+int reiserfs_fileattr_set(struct mnt_idmap *idmap,
                          struct dentry *dentry, struct fileattr *fa);
 long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 long reiserfs_compat_ioctl(struct file *filp,
 
        return 0;
 }
 
-int ubifs_fileattr_set(struct user_namespace *mnt_userns,
+int ubifs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
 
 
 /* ioctl.c */
 int ubifs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int ubifs_fileattr_set(struct user_namespace *mnt_userns,
+int ubifs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa);
 long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 void ubifs_set_inode_flags(struct inode *inode);
 
 
 int
 xfs_fileattr_set(
-       struct user_namespace   *mnt_userns,
+       struct mnt_idmap        *idmap,
        struct dentry           *dentry,
        struct fileattr         *fa)
 {
+       struct user_namespace *mnt_userns = mnt_idmap_owner(idmap);
        struct xfs_inode        *ip = XFS_I(d_inode(dentry));
        struct xfs_mount        *mp = ip->i_mount;
        struct xfs_trans        *tp;
 
 
 extern int
 xfs_fileattr_set(
-       struct user_namespace   *mnt_userns,
+       struct mnt_idmap        *idmap,
        struct dentry           *dentry,
        struct fileattr         *fa);
 
 
 }
 
 int vfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int vfs_fileattr_set(struct user_namespace *mnt_userns, struct dentry *dentry,
+int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
                     struct fileattr *fa);
 
 #endif /* _LINUX_FILEATTR_H */
 
                                     int);
        int (*set_acl)(struct mnt_idmap *, struct dentry *,
                       struct posix_acl *, int);
-       int (*fileattr_set)(struct user_namespace *mnt_userns,
+       int (*fileattr_set)(struct mnt_idmap *idmap,
                            struct dentry *dentry, struct fileattr *fa);
        int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
 } ____cacheline_aligned;
 
        return 0;
 }
 
-static int shmem_fileattr_set(struct user_namespace *mnt_userns,
+static int shmem_fileattr_set(struct mnt_idmap *idmap,
                              struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);