btrfs: cleanup device states define BTRFS_DEV_STATE_WRITEABLE
Currently device state is being managed by each individual int variable such as struct btrfs_device::writeable. Instead of that declare device state BTRFS_DEV_STATE_WRITEABLE and use the bit operations. Signed-off-by: Anand Jain <anand.jain@oracle.com> [ whitespace adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -10878,7 +10878,7 @@ static int btrfs_trim_free_extents(struct btrfs_device *device,
|
||||
*trimmed = 0;
|
||||
|
||||
/* Not writeable = nothing to do. */
|
||||
if (!device->writeable)
|
||||
if (!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state))
|
||||
return 0;
|
||||
|
||||
/* No free space = nothing to do. */
|
||||
|
Reference in New Issue
Block a user