Lines Matching refs:dev_state
684 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_open_one_device()
688 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_open_one_device()
690 set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_open_one_device()
701 clear_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in btrfs_open_one_device()
714 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in btrfs_open_one_device()
975 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) { in device_list_add()
977 clear_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in device_list_add()
1061 if (test_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state)) { in __btrfs_free_extra_devids()
1063 &device->dev_state) && in __btrfs_free_extra_devids()
1065 &device->dev_state) && in __btrfs_free_extra_devids()
1086 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in __btrfs_free_extra_devids()
1088 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in __btrfs_free_extra_devids()
1123 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_close_bdev()
1135 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in btrfs_close_one_device()
1142 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state); in btrfs_close_one_device()
1144 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) { in btrfs_close_one_device()
1145 clear_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in btrfs_close_one_device()
1155 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_close_one_device()
1176 WARN_ON(test_bit(BTRFS_DEV_STATE_FLUSH_SENT, &device->dev_state)); in btrfs_close_one_device()
1177 WARN_ON(test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)); in btrfs_close_one_device()
1708 test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) { in find_free_dev_extent()
2084 !test_bit(BTRFS_DEV_STATE_MISSING, &next_device->dev_state) in btrfs_find_next_active_device()
2221 if (test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) in btrfs_rm_device()
2224 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in btrfs_rm_device()
2228 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_rm_device()
2256 clear_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in btrfs_rm_device()
2284 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) in btrfs_rm_device()
2309 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_rm_device()
2340 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_rm_device()
2367 if (test_bit(BTRFS_DEV_STATE_MISSING, &srcdev->dev_state)) in btrfs_rm_dev_replace_remove_srcdev()
2370 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &srcdev->dev_state)) in btrfs_rm_dev_replace_remove_srcdev()
2768 set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_init_new_device()
2777 set_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in btrfs_init_new_device()
2778 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state); in btrfs_init_new_device()
2993 if (!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) in btrfs_grow_device()
3003 test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) { in btrfs_grow_device()
4883 if (test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) in btrfs_shrink_device()
4901 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_shrink_device()
5050 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_shrink_device()
5255 if (!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in gather_device_info()
5262 &device->dev_state) || in gather_device_info()
5263 test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) in gather_device_info()
5829 &map->stripes[i].dev->dev_state)) { in btrfs_chunk_writeable()
5834 &map->stripes[i].dev->dev_state)) { in btrfs_chunk_writeable()
6806 if (test_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state) && in dev_args_match_device()
6874 set_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in add_missing_dev()
7109 &(map->stripes[i].dev->dev_state)); in read_one_chunk()
7140 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state); in fill_device_from_item()
7259 !test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) { in read_one_dev()
7267 set_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in read_one_dev()
7273 &device->dev_state)); in read_one_dev()
7287 BUG_ON(test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)); in read_one_dev()
7304 set_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in read_one_dev()
7305 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in read_one_dev()
7306 !test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) { in read_one_dev()
7417 test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state) || in btrfs_check_rw_degradable()