Skip to content

Commit 9c1036f

Browse files
lorddoskiaskdave
authored andcommitted
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: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> [ add comment ] Signed-off-by: David Sterba <[email protected]>
1 parent c75e839 commit 9c1036f

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

fs/btrfs/ioctl.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,8 +1818,6 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
18181818
{
18191819
struct btrfs_ioctl_vol_args_v2 *vol_args;
18201820
int ret;
1821-
u64 transid = 0;
1822-
u64 *ptr = NULL;
18231821
bool readonly = false;
18241822
struct btrfs_qgroup_inherit *inherit = NULL;
18251823

@@ -1836,15 +1834,6 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
18361834
goto free_args;
18371835
}
18381836

1839-
if (vol_args->flags & BTRFS_SUBVOL_CREATE_ASYNC) {
1840-
struct inode *inode = file_inode(file);
1841-
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
1842-
1843-
btrfs_warn(fs_info,
1844-
"SNAP_CREATE_V2 ioctl with CREATE_ASYNC is deprecated and will be removed in kernel 5.7");
1845-
1846-
ptr = &transid;
1847-
}
18481837
if (vol_args->flags & BTRFS_SUBVOL_RDONLY)
18491838
readonly = true;
18501839
if (vol_args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) {
@@ -1860,17 +1849,10 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
18601849
}
18611850

18621851
ret = btrfs_ioctl_snap_create_transid(file, vol_args->name,
1863-
vol_args->fd, subvol, ptr,
1852+
vol_args->fd, subvol, NULL,
18641853
readonly, inherit);
18651854
if (ret)
18661855
goto free_inherit;
1867-
1868-
if (ptr && copy_to_user(arg +
1869-
offsetof(struct btrfs_ioctl_vol_args_v2,
1870-
transid),
1871-
ptr, sizeof(*ptr)))
1872-
ret = -EFAULT;
1873-
18741856
free_inherit:
18751857
kfree(inherit);
18761858
free_args:
@@ -1929,11 +1911,6 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
19291911
goto out_drop_write;
19301912
}
19311913

1932-
if (flags & BTRFS_SUBVOL_CREATE_ASYNC) {
1933-
ret = -EINVAL;
1934-
goto out_drop_write;
1935-
}
1936-
19371914
if (flags & ~BTRFS_SUBVOL_RDONLY) {
19381915
ret = -EOPNOTSUPP;
19391916
goto out_drop_write;

include/uapi/linux/btrfs.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ struct btrfs_ioctl_vol_args {
3636
#define BTRFS_DEVICE_PATH_NAME_MAX 1024
3737
#define BTRFS_SUBVOL_NAME_MAX 4039
3838

39-
#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
39+
/*
40+
* Deprecated since 5.7:
41+
*
42+
* BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
43+
*/
44+
4045
#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
4146
#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
4247

@@ -45,8 +50,7 @@ struct btrfs_ioctl_vol_args {
4550
#define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4)
4651

4752
#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
48-
(BTRFS_SUBVOL_CREATE_ASYNC | \
49-
BTRFS_SUBVOL_RDONLY | \
53+
(BTRFS_SUBVOL_RDONLY | \
5054
BTRFS_SUBVOL_QGROUP_INHERIT | \
5155
BTRFS_DEVICE_SPEC_BY_ID | \
5256
BTRFS_SUBVOL_SPEC_BY_ID)
@@ -116,8 +120,7 @@ struct btrfs_ioctl_qgroup_limit_args {
116120

117121
/* Supported flags for BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SUBVOL_CREATE_V2 */
118122
#define BTRFS_SUBVOL_CREATE_ARGS_MASK \
119-
(BTRFS_SUBVOL_CREATE_ASYNC | \
120-
BTRFS_SUBVOL_RDONLY | \
123+
(BTRFS_SUBVOL_RDONLY | \
121124
BTRFS_SUBVOL_QGROUP_INHERIT)
122125

123126
/* Supported flags for BTRFS_IOC_SNAP_DESTROY_V2 */

0 commit comments

Comments
 (0)