summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorAnand Jain2017-12-04 05:54:55 +0100
committerDavid Sterba2018-01-22 16:08:15 +0100
commit401e29c124eac2b9373eb72f36f202561da339d2 (patch)
treeeb32408cafe3f1f2b5f24a8f2a5e2e6d23150d9e /fs/btrfs/super.c
parentbtrfs: cleanup device states define BTRFS_DEV_STATE_MISSING (diff)
downloadkernel-qcow2-linux-401e29c124eac2b9373eb72f36f202561da339d2.tar.gz
kernel-qcow2-linux-401e29c124eac2b9373eb72f36f202561da339d2.tar.xz
kernel-qcow2-linux-401e29c124eac2b9373eb72f36f202561da339d2.zip
btrfs: cleanup device states define BTRFS_DEV_STATE_REPLACE_TGT
Currently device state is being managed by each individual int variable such as struct btrfs_device::is_tgtdev_for_dev_replace. Instead of that declare btrfs_device::dev_state BTRFS_DEV_STATE_MISSING and use the bit operations. Signed-off-by: Anand Jain <anand.jain@oracle.com> [ whitespace adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index ba5324523995..84707e77c051 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1974,7 +1974,8 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
list_for_each_entry_rcu(device, &fs_devices->devices, dev_list) {
if (!test_bit(BTRFS_DEV_STATE_IN_FS_METADATA,
&device->dev_state) ||
- !device->bdev || device->is_tgtdev_for_dev_replace)
+ !device->bdev ||
+ test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state))
continue;
if (i >= nr_devices)