Commit f272c004 authored by David Sterba's avatar David Sterba
Browse files

btrfs: pass struct to btrfs_ioctl_subvol_getflags()



Pass a struct btrfs_inode to btrfs_ioctl_subvol_getflags() as it's an
internal interface, allowing to remove some use of BTRFS_I.

Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f6c2ccfc
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1337,15 +1337,15 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
	return ret;
}

static noinline int btrfs_ioctl_subvol_getflags(struct inode *inode,
static noinline int btrfs_ioctl_subvol_getflags(struct btrfs_inode *inode,
						void __user *arg)
{
	struct btrfs_fs_info *fs_info = inode_to_fs_info(inode);
	struct btrfs_root *root = BTRFS_I(inode)->root;
	struct btrfs_root *root = inode->root;
	struct btrfs_fs_info *fs_info = root->fs_info;
	int ret = 0;
	u64 flags = 0;

	if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID)
	if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID)
		return -EINVAL;

	down_read(&fs_info->subvol_sem);
@@ -5243,7 +5243,7 @@ long btrfs_ioctl(struct file *file, unsigned int
	case BTRFS_IOC_SNAP_DESTROY_V2:
		return btrfs_ioctl_snap_destroy(file, argp, true);
	case BTRFS_IOC_SUBVOL_GETFLAGS:
		return btrfs_ioctl_subvol_getflags(inode, argp);
		return btrfs_ioctl_subvol_getflags(BTRFS_I(inode), argp);
	case BTRFS_IOC_SUBVOL_SETFLAGS:
		return btrfs_ioctl_subvol_setflags(file, argp);
	case BTRFS_IOC_DEFAULT_SUBVOL: