Commit 9c1036fd authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove BTRFS_SUBVOL_CREATE_ASYNC support

This functionality was deprecated in kernel 5.4. Since no one has
complained of the impending removal it's time we did so.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
[ add comment ]
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c75e8394
...@@ -1818,8 +1818,6 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file, ...@@ -1818,8 +1818,6 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
{ {
struct btrfs_ioctl_vol_args_v2 *vol_args; struct btrfs_ioctl_vol_args_v2 *vol_args;
int ret; int ret;
u64 transid = 0;
u64 *ptr = NULL;
bool readonly = false; bool readonly = false;
struct btrfs_qgroup_inherit *inherit = NULL; struct btrfs_qgroup_inherit *inherit = NULL;
...@@ -1836,15 +1834,6 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file, ...@@ -1836,15 +1834,6 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
goto free_args; goto free_args;
} }
if (vol_args->flags & BTRFS_SUBVOL_CREATE_ASYNC) {
struct inode *inode = file_inode(file);
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
btrfs_warn(fs_info,
"SNAP_CREATE_V2 ioctl with CREATE_ASYNC is deprecated and will be removed in kernel 5.7");
ptr = &transid;
}
if (vol_args->flags & BTRFS_SUBVOL_RDONLY) if (vol_args->flags & BTRFS_SUBVOL_RDONLY)
readonly = true; readonly = true;
if (vol_args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) { if (vol_args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) {
...@@ -1860,17 +1849,10 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file, ...@@ -1860,17 +1849,10 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
} }
ret = btrfs_ioctl_snap_create_transid(file, vol_args->name, ret = btrfs_ioctl_snap_create_transid(file, vol_args->name,
vol_args->fd, subvol, ptr, vol_args->fd, subvol, NULL,
readonly, inherit); readonly, inherit);
if (ret) if (ret)
goto free_inherit; goto free_inherit;
if (ptr && copy_to_user(arg +
offsetof(struct btrfs_ioctl_vol_args_v2,
transid),
ptr, sizeof(*ptr)))
ret = -EFAULT;
free_inherit: free_inherit:
kfree(inherit); kfree(inherit);
free_args: free_args:
...@@ -1929,11 +1911,6 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file, ...@@ -1929,11 +1911,6 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
goto out_drop_write; goto out_drop_write;
} }
if (flags & BTRFS_SUBVOL_CREATE_ASYNC) {
ret = -EINVAL;
goto out_drop_write;
}
if (flags & ~BTRFS_SUBVOL_RDONLY) { if (flags & ~BTRFS_SUBVOL_RDONLY) {
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto out_drop_write; goto out_drop_write;
......
...@@ -36,7 +36,12 @@ struct btrfs_ioctl_vol_args { ...@@ -36,7 +36,12 @@ struct btrfs_ioctl_vol_args {
#define BTRFS_DEVICE_PATH_NAME_MAX 1024 #define BTRFS_DEVICE_PATH_NAME_MAX 1024
#define BTRFS_SUBVOL_NAME_MAX 4039 #define BTRFS_SUBVOL_NAME_MAX 4039
#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) /*
* Deprecated since 5.7:
*
* BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
*/
#define BTRFS_SUBVOL_RDONLY (1ULL << 1) #define BTRFS_SUBVOL_RDONLY (1ULL << 1)
#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2) #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
...@@ -45,8 +50,7 @@ struct btrfs_ioctl_vol_args { ...@@ -45,8 +50,7 @@ struct btrfs_ioctl_vol_args {
#define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4) #define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4)
#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \ #define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
(BTRFS_SUBVOL_CREATE_ASYNC | \ (BTRFS_SUBVOL_RDONLY | \
BTRFS_SUBVOL_RDONLY | \
BTRFS_SUBVOL_QGROUP_INHERIT | \ BTRFS_SUBVOL_QGROUP_INHERIT | \
BTRFS_DEVICE_SPEC_BY_ID | \ BTRFS_DEVICE_SPEC_BY_ID | \
BTRFS_SUBVOL_SPEC_BY_ID) BTRFS_SUBVOL_SPEC_BY_ID)
...@@ -116,8 +120,7 @@ struct btrfs_ioctl_qgroup_limit_args { ...@@ -116,8 +120,7 @@ struct btrfs_ioctl_qgroup_limit_args {
/* Supported flags for BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SUBVOL_CREATE_V2 */ /* Supported flags for BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SUBVOL_CREATE_V2 */
#define BTRFS_SUBVOL_CREATE_ARGS_MASK \ #define BTRFS_SUBVOL_CREATE_ARGS_MASK \
(BTRFS_SUBVOL_CREATE_ASYNC | \ (BTRFS_SUBVOL_RDONLY | \
BTRFS_SUBVOL_RDONLY | \
BTRFS_SUBVOL_QGROUP_INHERIT) BTRFS_SUBVOL_QGROUP_INHERIT)
/* Supported flags for BTRFS_IOC_SNAP_DESTROY_V2 */ /* Supported flags for BTRFS_IOC_SNAP_DESTROY_V2 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment