summaryrefslogtreecommitdiff
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2017-12-04 07:54:53 +0300
committerDavid Sterba <dsterba@suse.com>2018-01-22 18:08:15 +0300
commite12c96214d28f9211b4035cf20e76d677ff5611f (patch)
treec3e1781eac93c02d64fe09eb928031a0fed2b4a0 /fs/btrfs/super.c
parentebbede42d47dc77d1c20e7468418826e5efa6b29 (diff)
downloadlinux-e12c96214d28f9211b4035cf20e76d677ff5611f.tar.xz
btrfs: cleanup device states define BTRFS_DEV_STATE_IN_FS_METADATA
Currently device state is being managed by each individual int variable such as struct btrfs_device::in_fs_metadata. Instead of that declare device state BTRFS_DEV_STATE_IN_FS_METADATA and use the bit operations. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> [ whitespace adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 7a7abe827ac4..bc55c5e6badd 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1972,8 +1972,9 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
rcu_read_lock();
list_for_each_entry_rcu(device, &fs_devices->devices, dev_list) {
- if (!device->in_fs_metadata || !device->bdev ||
- device->is_tgtdev_for_dev_replace)
+ if (!test_bit(BTRFS_DEV_STATE_IN_FS_METADATA,
+ &device->dev_state) ||
+ !device->bdev || device->is_tgtdev_for_dev_replace)
continue;
if (i >= nr_devices)