Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[platform/kernel/linux-starfive.git] / fs / ext4 / ioctl.c
index 2e8c340..12435d6 100644 (file)
@@ -355,12 +355,12 @@ void ext4_reset_inode_seed(struct inode *inode)
  * important fields of the inodes.
  *
  * @sb:         the super block of the filesystem
- * @mnt_userns:        user namespace of the mount the inode was found from
+ * @idmap:     idmap of the mount the inode was found from
  * @inode:      the inode to swap with EXT4_BOOT_LOADER_INO
  *
  */
 static long swap_inode_boot_loader(struct super_block *sb,
-                               struct user_namespace *mnt_userns,
+                               struct mnt_idmap *idmap,
                                struct inode *inode)
 {
        handle_t *handle;
@@ -390,7 +390,7 @@ static long swap_inode_boot_loader(struct super_block *sb,
        }
 
        if (IS_RDONLY(inode) || IS_APPEND(inode) || IS_IMMUTABLE(inode) ||
-           !inode_owner_or_capable(mnt_userns, inode) ||
+           !inode_owner_or_capable(idmap, inode) ||
            !capable(CAP_SYS_ADMIN)) {
                err = -EPERM;
                goto journal_err_out;
@@ -976,7 +976,7 @@ int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        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);
@@ -1214,7 +1214,7 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
        struct inode *inode = file_inode(filp);
        struct super_block *sb = inode->i_sb;
-       struct user_namespace *mnt_userns = file_mnt_user_ns(filp);
+       struct mnt_idmap *idmap = file_mnt_idmap(filp);
 
        ext4_debug("cmd = %u, arg = %lu\n", cmd, arg);
 
@@ -1231,7 +1231,7 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                __u32 generation;
                int err;
 
-               if (!inode_owner_or_capable(mnt_userns, inode))
+               if (!inode_owner_or_capable(idmap, inode))
                        return -EPERM;
 
                if (ext4_has_metadata_csum(inode->i_sb)) {
@@ -1373,7 +1373,7 @@ mext_out:
        case EXT4_IOC_MIGRATE:
        {
                int err;
-               if (!inode_owner_or_capable(mnt_userns, inode))
+               if (!inode_owner_or_capable(idmap, inode))
                        return -EACCES;
 
                err = mnt_want_write_file(filp);
@@ -1395,7 +1395,7 @@ mext_out:
        case EXT4_IOC_ALLOC_DA_BLKS:
        {
                int err;
-               if (!inode_owner_or_capable(mnt_userns, inode))
+               if (!inode_owner_or_capable(idmap, inode))
                        return -EACCES;
 
                err = mnt_want_write_file(filp);
@@ -1414,7 +1414,7 @@ mext_out:
                err = mnt_want_write_file(filp);
                if (err)
                        return err;
-               err = swap_inode_boot_loader(sb, mnt_userns, inode);
+               err = swap_inode_boot_loader(sb, idmap, inode);
                mnt_drop_write_file(filp);
                return err;
        }
@@ -1539,7 +1539,7 @@ resizefs_out:
 
        case EXT4_IOC_CLEAR_ES_CACHE:
        {
-               if (!inode_owner_or_capable(mnt_userns, inode))
+               if (!inode_owner_or_capable(idmap, inode))
                        return -EACCES;
                ext4_clear_inode_es(inode);
                return 0;