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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index ebac486f59af..242a37cd26b2 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -638,7 +638,7 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
638 struct btrfs_trans_handle *trans; 638 struct btrfs_trans_handle *trans;
639 int ret; 639 int ret;
640 640
641 if (!root->ref_cows) 641 if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))
642 return -EINVAL; 642 return -EINVAL;
643 643
644 atomic_inc(&root->will_be_snapshoted); 644 atomic_inc(&root->will_be_snapshoted);
@@ -2369,7 +2369,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
2369 dest->root_item.drop_level = 0; 2369 dest->root_item.drop_level = 0;
2370 btrfs_set_root_refs(&dest->root_item, 0); 2370 btrfs_set_root_refs(&dest->root_item, 0);
2371 2371
2372 if (!xchg(&dest->orphan_item_inserted, 1)) { 2372 if (!test_and_set_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &dest->state)) {
2373 ret = btrfs_insert_orphan_item(trans, 2373 ret = btrfs_insert_orphan_item(trans,
2374 root->fs_info->tree_root, 2374 root->fs_info->tree_root,
2375 dest->root_key.objectid); 2375 dest->root_key.objectid);