diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2014-04-02 19:51:05 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-06-09 17:20:40 -0700 |
commit | 27cdeb7096b86f05ad018a24cdb63acdf0850a5d (patch) | |
tree | 1e795214fd0456f83c85843bea354d7331328bd1 /fs/btrfs/ioctl.c | |
parent | f959492fc15b60d874a9cbf55ae4760f2ef261ed (diff) | |
download | linux-27cdeb7096b86f05ad018a24cdb63acdf0850a5d.tar.bz2 |
Btrfs: use bitfield instead of integer data type for the some variants in btrfs_root
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 4 |
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, struct btrfs_trans_handle *trans; int ret; - if (!root->ref_cows) + if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state)) return -EINVAL; atomic_inc(&root->will_be_snapshoted); @@ -2369,7 +2369,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file, dest->root_item.drop_level = 0; btrfs_set_root_refs(&dest->root_item, 0); - if (!xchg(&dest->orphan_item_inserted, 1)) { + if (!test_and_set_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &dest->state)) { ret = btrfs_insert_orphan_item(trans, root->fs_info->tree_root, dest->root_key.objectid); |