aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c252
1 files changed, 194 insertions, 58 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index f87552a1d7ea..5fdb2abc4fa7 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -147,6 +147,9 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
147 unsigned int flags, oldflags; 147 unsigned int flags, oldflags;
148 int ret; 148 int ret;
149 149
150 if (btrfs_root_readonly(root))
151 return -EROFS;
152
150 if (copy_from_user(&flags, arg, sizeof(flags))) 153 if (copy_from_user(&flags, arg, sizeof(flags)))
151 return -EFAULT; 154 return -EFAULT;
152 155
@@ -200,7 +203,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
200 203
201 204
202 trans = btrfs_join_transaction(root, 1); 205 trans = btrfs_join_transaction(root, 1);
203 BUG_ON(!trans); 206 BUG_ON(IS_ERR(trans));
204 207
205 ret = btrfs_update_inode(trans, root, inode); 208 ret = btrfs_update_inode(trans, root, inode);
206 BUG_ON(ret); 209 BUG_ON(ret);
@@ -360,7 +363,8 @@ fail:
360} 363}
361 364
362static int create_snapshot(struct btrfs_root *root, struct dentry *dentry, 365static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
363 char *name, int namelen, u64 *async_transid) 366 char *name, int namelen, u64 *async_transid,
367 bool readonly)
364{ 368{
365 struct inode *inode; 369 struct inode *inode;
366 struct dentry *parent; 370 struct dentry *parent;
@@ -378,6 +382,7 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
378 btrfs_init_block_rsv(&pending_snapshot->block_rsv); 382 btrfs_init_block_rsv(&pending_snapshot->block_rsv);
379 pending_snapshot->dentry = dentry; 383 pending_snapshot->dentry = dentry;
380 pending_snapshot->root = root; 384 pending_snapshot->root = root;
385 pending_snapshot->readonly = readonly;
381 386
382 trans = btrfs_start_transaction(root->fs_info->extent_root, 5); 387 trans = btrfs_start_transaction(root->fs_info->extent_root, 5);
383 if (IS_ERR(trans)) { 388 if (IS_ERR(trans)) {
@@ -509,7 +514,7 @@ static inline int btrfs_may_create(struct inode *dir, struct dentry *child)
509static noinline int btrfs_mksubvol(struct path *parent, 514static noinline int btrfs_mksubvol(struct path *parent,
510 char *name, int namelen, 515 char *name, int namelen,
511 struct btrfs_root *snap_src, 516 struct btrfs_root *snap_src,
512 u64 *async_transid) 517 u64 *async_transid, bool readonly)
513{ 518{
514 struct inode *dir = parent->dentry->d_inode; 519 struct inode *dir = parent->dentry->d_inode;
515 struct dentry *dentry; 520 struct dentry *dentry;
@@ -541,7 +546,7 @@ static noinline int btrfs_mksubvol(struct path *parent,
541 546
542 if (snap_src) { 547 if (snap_src) {
543 error = create_snapshot(snap_src, dentry, 548 error = create_snapshot(snap_src, dentry,
544 name, namelen, async_transid); 549 name, namelen, async_transid, readonly);
545 } else { 550 } else {
546 error = create_subvol(BTRFS_I(dir)->root, dentry, 551 error = create_subvol(BTRFS_I(dir)->root, dentry,
547 name, namelen, async_transid); 552 name, namelen, async_transid);
@@ -638,9 +643,11 @@ static int btrfs_defrag_file(struct file *file,
638 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; 643 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
639 struct btrfs_ordered_extent *ordered; 644 struct btrfs_ordered_extent *ordered;
640 struct page *page; 645 struct page *page;
646 struct btrfs_super_block *disk_super;
641 unsigned long last_index; 647 unsigned long last_index;
642 unsigned long ra_pages = root->fs_info->bdi.ra_pages; 648 unsigned long ra_pages = root->fs_info->bdi.ra_pages;
643 unsigned long total_read = 0; 649 unsigned long total_read = 0;
650 u64 features;
644 u64 page_start; 651 u64 page_start;
645 u64 page_end; 652 u64 page_end;
646 u64 last_len = 0; 653 u64 last_len = 0;
@@ -648,6 +655,14 @@ static int btrfs_defrag_file(struct file *file,
648 u64 defrag_end = 0; 655 u64 defrag_end = 0;
649 unsigned long i; 656 unsigned long i;
650 int ret; 657 int ret;
658 int compress_type = BTRFS_COMPRESS_ZLIB;
659
660 if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) {
661 if (range->compress_type > BTRFS_COMPRESS_TYPES)
662 return -EINVAL;
663 if (range->compress_type)
664 compress_type = range->compress_type;
665 }
651 666
652 if (inode->i_size == 0) 667 if (inode->i_size == 0)
653 return 0; 668 return 0;
@@ -683,7 +698,7 @@ static int btrfs_defrag_file(struct file *file,
683 total_read++; 698 total_read++;
684 mutex_lock(&inode->i_mutex); 699 mutex_lock(&inode->i_mutex);
685 if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) 700 if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS)
686 BTRFS_I(inode)->force_compress = 1; 701 BTRFS_I(inode)->force_compress = compress_type;
687 702
688 ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE); 703 ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE);
689 if (ret) 704 if (ret)
@@ -781,10 +796,17 @@ loop_unlock:
781 atomic_dec(&root->fs_info->async_submit_draining); 796 atomic_dec(&root->fs_info->async_submit_draining);
782 797
783 mutex_lock(&inode->i_mutex); 798 mutex_lock(&inode->i_mutex);
784 BTRFS_I(inode)->force_compress = 0; 799 BTRFS_I(inode)->force_compress = BTRFS_COMPRESS_NONE;
785 mutex_unlock(&inode->i_mutex); 800 mutex_unlock(&inode->i_mutex);
786 } 801 }
787 802
803 disk_super = &root->fs_info->super_copy;
804 features = btrfs_super_incompat_flags(disk_super);
805 if (range->compress_type == BTRFS_COMPRESS_LZO) {
806 features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO;
807 btrfs_set_super_incompat_flags(disk_super, features);
808 }
809
788 return 0; 810 return 0;
789 811
790err_reservations: 812err_reservations:
@@ -885,6 +907,10 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root,
885 907
886 if (new_size > old_size) { 908 if (new_size > old_size) {
887 trans = btrfs_start_transaction(root, 0); 909 trans = btrfs_start_transaction(root, 0);
910 if (IS_ERR(trans)) {
911 ret = PTR_ERR(trans);
912 goto out_unlock;
913 }
888 ret = btrfs_grow_device(trans, device, new_size); 914 ret = btrfs_grow_device(trans, device, new_size);
889 btrfs_commit_transaction(trans, root); 915 btrfs_commit_transaction(trans, root);
890 } else { 916 } else {
@@ -901,7 +927,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
901 char *name, 927 char *name,
902 unsigned long fd, 928 unsigned long fd,
903 int subvol, 929 int subvol,
904 u64 *transid) 930 u64 *transid,
931 bool readonly)
905{ 932{
906 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 933 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
907 struct file *src_file; 934 struct file *src_file;
@@ -919,7 +946,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
919 946
920 if (subvol) { 947 if (subvol) {
921 ret = btrfs_mksubvol(&file->f_path, name, namelen, 948 ret = btrfs_mksubvol(&file->f_path, name, namelen,
922 NULL, transid); 949 NULL, transid, readonly);
923 } else { 950 } else {
924 struct inode *src_inode; 951 struct inode *src_inode;
925 src_file = fget(fd); 952 src_file = fget(fd);
@@ -938,7 +965,7 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
938 } 965 }
939 ret = btrfs_mksubvol(&file->f_path, name, namelen, 966 ret = btrfs_mksubvol(&file->f_path, name, namelen,
940 BTRFS_I(src_inode)->root, 967 BTRFS_I(src_inode)->root,
941 transid); 968 transid, readonly);
942 fput(src_file); 969 fput(src_file);
943 } 970 }
944out: 971out:
@@ -946,58 +973,142 @@ out:
946} 973}
947 974
948static noinline int btrfs_ioctl_snap_create(struct file *file, 975static noinline int btrfs_ioctl_snap_create(struct file *file,
949 void __user *arg, int subvol, 976 void __user *arg, int subvol)
950 int v2)
951{ 977{
952 struct btrfs_ioctl_vol_args *vol_args = NULL; 978 struct btrfs_ioctl_vol_args *vol_args;
953 struct btrfs_ioctl_vol_args_v2 *vol_args_v2 = NULL;
954 char *name;
955 u64 fd;
956 int ret; 979 int ret;
957 980
958 if (v2) { 981 vol_args = memdup_user(arg, sizeof(*vol_args));
959 u64 transid = 0; 982 if (IS_ERR(vol_args))
960 u64 *ptr = NULL; 983 return PTR_ERR(vol_args);
984 vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
961 985
962 vol_args_v2 = memdup_user(arg, sizeof(*vol_args_v2)); 986 ret = btrfs_ioctl_snap_create_transid(file, vol_args->name,
963 if (IS_ERR(vol_args_v2)) 987 vol_args->fd, subvol,
964 return PTR_ERR(vol_args_v2); 988 NULL, false);
965 989
966 if (vol_args_v2->flags & ~BTRFS_SUBVOL_CREATE_ASYNC) { 990 kfree(vol_args);
967 ret = -EINVAL; 991 return ret;
968 goto out; 992}
969 }
970
971 name = vol_args_v2->name;
972 fd = vol_args_v2->fd;
973 vol_args_v2->name[BTRFS_SUBVOL_NAME_MAX] = '\0';
974 993
975 if (vol_args_v2->flags & BTRFS_SUBVOL_CREATE_ASYNC) 994static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
976 ptr = &transid; 995 void __user *arg, int subvol)
996{
997 struct btrfs_ioctl_vol_args_v2 *vol_args;
998 int ret;
999 u64 transid = 0;
1000 u64 *ptr = NULL;
1001 bool readonly = false;
977 1002
978 ret = btrfs_ioctl_snap_create_transid(file, name, fd, 1003 vol_args = memdup_user(arg, sizeof(*vol_args));
979 subvol, ptr); 1004 if (IS_ERR(vol_args))
1005 return PTR_ERR(vol_args);
1006 vol_args->name[BTRFS_SUBVOL_NAME_MAX] = '\0';
980 1007
981 if (ret == 0 && ptr && 1008 if (vol_args->flags &
982 copy_to_user(arg + 1009 ~(BTRFS_SUBVOL_CREATE_ASYNC | BTRFS_SUBVOL_RDONLY)) {
983 offsetof(struct btrfs_ioctl_vol_args_v2, 1010 ret = -EOPNOTSUPP;
984 transid), ptr, sizeof(*ptr))) 1011 goto out;
985 ret = -EFAULT;
986 } else {
987 vol_args = memdup_user(arg, sizeof(*vol_args));
988 if (IS_ERR(vol_args))
989 return PTR_ERR(vol_args);
990 name = vol_args->name;
991 fd = vol_args->fd;
992 vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
993
994 ret = btrfs_ioctl_snap_create_transid(file, name, fd,
995 subvol, NULL);
996 } 1012 }
1013
1014 if (vol_args->flags & BTRFS_SUBVOL_CREATE_ASYNC)
1015 ptr = &transid;
1016 if (vol_args->flags & BTRFS_SUBVOL_RDONLY)
1017 readonly = true;
1018
1019 ret = btrfs_ioctl_snap_create_transid(file, vol_args->name,
1020 vol_args->fd, subvol,
1021 ptr, readonly);
1022
1023 if (ret == 0 && ptr &&
1024 copy_to_user(arg +
1025 offsetof(struct btrfs_ioctl_vol_args_v2,
1026 transid), ptr, sizeof(*ptr)))
1027 ret = -EFAULT;
997out: 1028out:
998 kfree(vol_args); 1029 kfree(vol_args);
999 kfree(vol_args_v2); 1030 return ret;
1031}
1032
1033static noinline int btrfs_ioctl_subvol_getflags(struct file *file,
1034 void __user *arg)
1035{
1036 struct inode *inode = fdentry(file)->d_inode;
1037 struct btrfs_root *root = BTRFS_I(inode)->root;
1038 int ret = 0;
1039 u64 flags = 0;
1040
1041 if (inode->i_ino != BTRFS_FIRST_FREE_OBJECTID)
1042 return -EINVAL;
1043
1044 down_read(&root->fs_info->subvol_sem);
1045 if (btrfs_root_readonly(root))
1046 flags |= BTRFS_SUBVOL_RDONLY;
1047 up_read(&root->fs_info->subvol_sem);
1048
1049 if (copy_to_user(arg, &flags, sizeof(flags)))
1050 ret = -EFAULT;
1051
1052 return ret;
1053}
1054
1055static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
1056 void __user *arg)
1057{
1058 struct inode *inode = fdentry(file)->d_inode;
1059 struct btrfs_root *root = BTRFS_I(inode)->root;
1060 struct btrfs_trans_handle *trans;
1061 u64 root_flags;
1062 u64 flags;
1063 int ret = 0;
1064
1065 if (root->fs_info->sb->s_flags & MS_RDONLY)
1066 return -EROFS;
1067
1068 if (inode->i_ino != BTRFS_FIRST_FREE_OBJECTID)
1069 return -EINVAL;
1070
1071 if (copy_from_user(&flags, arg, sizeof(flags)))
1072 return -EFAULT;
1073
1074 if (flags & BTRFS_SUBVOL_CREATE_ASYNC)
1075 return -EINVAL;
1076
1077 if (flags & ~BTRFS_SUBVOL_RDONLY)
1078 return -EOPNOTSUPP;
1079
1080 if (!is_owner_or_cap(inode))
1081 return -EACCES;
1082
1083 down_write(&root->fs_info->subvol_sem);
1084
1085 /* nothing to do */
1086 if (!!(flags & BTRFS_SUBVOL_RDONLY) == btrfs_root_readonly(root))
1087 goto out;
1000 1088
1089 root_flags = btrfs_root_flags(&root->root_item);
1090 if (flags & BTRFS_SUBVOL_RDONLY)
1091 btrfs_set_root_flags(&root->root_item,
1092 root_flags | BTRFS_ROOT_SUBVOL_RDONLY);
1093 else
1094 btrfs_set_root_flags(&root->root_item,
1095 root_flags & ~BTRFS_ROOT_SUBVOL_RDONLY);
1096
1097 trans = btrfs_start_transaction(root, 1);
1098 if (IS_ERR(trans)) {
1099 ret = PTR_ERR(trans);
1100 goto out_reset;
1101 }
1102
1103 ret = btrfs_update_root(trans, root->fs_info->tree_root,
1104 &root->root_key, &root->root_item);
1105
1106 btrfs_commit_transaction(trans, root);
1107out_reset:
1108 if (ret)
1109 btrfs_set_root_flags(&root->root_item, root_flags);
1110out:
1111 up_write(&root->fs_info->subvol_sem);
1001 return ret; 1112 return ret;
1002} 1113}
1003 1114
@@ -1509,6 +1620,9 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
1509 struct btrfs_ioctl_defrag_range_args *range; 1620 struct btrfs_ioctl_defrag_range_args *range;
1510 int ret; 1621 int ret;
1511 1622
1623 if (btrfs_root_readonly(root))
1624 return -EROFS;
1625
1512 ret = mnt_want_write(file->f_path.mnt); 1626 ret = mnt_want_write(file->f_path.mnt);
1513 if (ret) 1627 if (ret)
1514 return ret; 1628 return ret;
@@ -1637,6 +1751,9 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1637 if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) 1751 if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND))
1638 return -EINVAL; 1752 return -EINVAL;
1639 1753
1754 if (btrfs_root_readonly(root))
1755 return -EROFS;
1756
1640 ret = mnt_want_write(file->f_path.mnt); 1757 ret = mnt_want_write(file->f_path.mnt);
1641 if (ret) 1758 if (ret)
1642 return ret; 1759 return ret;
@@ -1788,7 +1905,10 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1788 1905
1789 memcpy(&new_key, &key, sizeof(new_key)); 1906 memcpy(&new_key, &key, sizeof(new_key));
1790 new_key.objectid = inode->i_ino; 1907 new_key.objectid = inode->i_ino;
1791 new_key.offset = key.offset + destoff - off; 1908 if (off <= key.offset)
1909 new_key.offset = key.offset + destoff - off;
1910 else
1911 new_key.offset = destoff;
1792 1912
1793 trans = btrfs_start_transaction(root, 1); 1913 trans = btrfs_start_transaction(root, 1);
1794 if (IS_ERR(trans)) { 1914 if (IS_ERR(trans)) {
@@ -1958,6 +2078,10 @@ static long btrfs_ioctl_trans_start(struct file *file)
1958 if (file->private_data) 2078 if (file->private_data)
1959 goto out; 2079 goto out;
1960 2080
2081 ret = -EROFS;
2082 if (btrfs_root_readonly(root))
2083 goto out;
2084
1961 ret = mnt_want_write(file->f_path.mnt); 2085 ret = mnt_want_write(file->f_path.mnt);
1962 if (ret) 2086 if (ret)
1963 goto out; 2087 goto out;
@@ -1968,7 +2092,7 @@ static long btrfs_ioctl_trans_start(struct file *file)
1968 2092
1969 ret = -ENOMEM; 2093 ret = -ENOMEM;
1970 trans = btrfs_start_ioctl_transaction(root, 0); 2094 trans = btrfs_start_ioctl_transaction(root, 0);
1971 if (!trans) 2095 if (IS_ERR(trans))
1972 goto out_drop; 2096 goto out_drop;
1973 2097
1974 file->private_data = trans; 2098 file->private_data = trans;
@@ -2024,9 +2148,9 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
2024 path->leave_spinning = 1; 2148 path->leave_spinning = 1;
2025 2149
2026 trans = btrfs_start_transaction(root, 1); 2150 trans = btrfs_start_transaction(root, 1);
2027 if (!trans) { 2151 if (IS_ERR(trans)) {
2028 btrfs_free_path(path); 2152 btrfs_free_path(path);
2029 return -ENOMEM; 2153 return PTR_ERR(trans);
2030 } 2154 }
2031 2155
2032 dir_id = btrfs_super_root_dir(&root->fs_info->super_copy); 2156 dir_id = btrfs_super_root_dir(&root->fs_info->super_copy);
@@ -2087,7 +2211,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
2087 int num_types = 4; 2211 int num_types = 4;
2088 int alloc_size; 2212 int alloc_size;
2089 int ret = 0; 2213 int ret = 0;
2090 int slot_count = 0; 2214 u64 slot_count = 0;
2091 int i, c; 2215 int i, c;
2092 2216
2093 if (copy_from_user(&space_args, 2217 if (copy_from_user(&space_args,
@@ -2126,7 +2250,7 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
2126 goto out; 2250 goto out;
2127 } 2251 }
2128 2252
2129 slot_count = min_t(int, space_args.space_slots, slot_count); 2253 slot_count = min_t(u64, space_args.space_slots, slot_count);
2130 2254
2131 alloc_size = sizeof(*dest) * slot_count; 2255 alloc_size = sizeof(*dest) * slot_count;
2132 2256
@@ -2146,6 +2270,9 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
2146 for (i = 0; i < num_types; i++) { 2270 for (i = 0; i < num_types; i++) {
2147 struct btrfs_space_info *tmp; 2271 struct btrfs_space_info *tmp;
2148 2272
2273 if (!slot_count)
2274 break;
2275
2149 info = NULL; 2276 info = NULL;
2150 rcu_read_lock(); 2277 rcu_read_lock();
2151 list_for_each_entry_rcu(tmp, &root->fs_info->space_info, 2278 list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
@@ -2167,7 +2294,10 @@ long btrfs_ioctl_space_info(struct btrfs_root *root, void __user *arg)
2167 memcpy(dest, &space, sizeof(space)); 2294 memcpy(dest, &space, sizeof(space));
2168 dest++; 2295 dest++;
2169 space_args.total_spaces++; 2296 space_args.total_spaces++;
2297 slot_count--;
2170 } 2298 }
2299 if (!slot_count)
2300 break;
2171 } 2301 }
2172 up_read(&info->groups_sem); 2302 up_read(&info->groups_sem);
2173 } 2303 }
@@ -2220,6 +2350,8 @@ static noinline long btrfs_ioctl_start_sync(struct file *file, void __user *argp
2220 u64 transid; 2350 u64 transid;
2221 2351
2222 trans = btrfs_start_transaction(root, 0); 2352 trans = btrfs_start_transaction(root, 0);
2353 if (IS_ERR(trans))
2354 return PTR_ERR(trans);
2223 transid = trans->transid; 2355 transid = trans->transid;
2224 btrfs_commit_transaction_async(trans, root, 0); 2356 btrfs_commit_transaction_async(trans, root, 0);
2225 2357
@@ -2257,13 +2389,17 @@ long btrfs_ioctl(struct file *file, unsigned int
2257 case FS_IOC_GETVERSION: 2389 case FS_IOC_GETVERSION:
2258 return btrfs_ioctl_getversion(file, argp); 2390 return btrfs_ioctl_getversion(file, argp);
2259 case BTRFS_IOC_SNAP_CREATE: 2391 case BTRFS_IOC_SNAP_CREATE:
2260 return btrfs_ioctl_snap_create(file, argp, 0, 0); 2392 return btrfs_ioctl_snap_create(file, argp, 0);
2261 case BTRFS_IOC_SNAP_CREATE_V2: 2393 case BTRFS_IOC_SNAP_CREATE_V2:
2262 return btrfs_ioctl_snap_create(file, argp, 0, 1); 2394 return btrfs_ioctl_snap_create_v2(file, argp, 0);
2263 case BTRFS_IOC_SUBVOL_CREATE: 2395 case BTRFS_IOC_SUBVOL_CREATE:
2264 return btrfs_ioctl_snap_create(file, argp, 1, 0); 2396 return btrfs_ioctl_snap_create(file, argp, 1);
2265 case BTRFS_IOC_SNAP_DESTROY: 2397 case BTRFS_IOC_SNAP_DESTROY:
2266 return btrfs_ioctl_snap_destroy(file, argp); 2398 return btrfs_ioctl_snap_destroy(file, argp);
2399 case BTRFS_IOC_SUBVOL_GETFLAGS:
2400 return btrfs_ioctl_subvol_getflags(file, argp);
2401 case BTRFS_IOC_SUBVOL_SETFLAGS:
2402 return btrfs_ioctl_subvol_setflags(file, argp);
2267 case BTRFS_IOC_DEFAULT_SUBVOL: 2403 case BTRFS_IOC_DEFAULT_SUBVOL:
2268 return btrfs_ioctl_default_subvol(file, argp); 2404 return btrfs_ioctl_default_subvol(file, argp);
2269 case BTRFS_IOC_DEFRAG: 2405 case BTRFS_IOC_DEFRAG: