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>
此提交包含在:
Anand Jain
2017-12-04 12:54:52 +08:00
提交者 David Sterba
父節點 3c958bd23b
當前提交 ebbede42d4
共有 7 個檔案被更改,包括 49 行新增34 行删除

查看文件

@@ -47,6 +47,8 @@ struct btrfs_pending_bios {
#define btrfs_device_data_ordered_init(device) do { } while (0)
#endif
#define BTRFS_DEV_STATE_WRITEABLE (0)
struct btrfs_device {
struct list_head dev_list;
struct list_head dev_alloc_list;
@@ -69,7 +71,7 @@ struct btrfs_device {
/* the mode sent to blkdev_get */
fmode_t mode;
int writeable;
unsigned long dev_state;
int in_fs_metadata;
int missing;
int is_tgtdev_for_dev_replace;