Lines Matching refs:dev_state
712 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_open_one_device()
716 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_open_one_device()
718 set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_open_one_device()
726 clear_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in btrfs_open_one_device()
730 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in btrfs_open_one_device()
860 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) { in device_list_add()
862 clear_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in device_list_add()
943 &device->dev_state)) { in btrfs_free_extra_devids()
945 &device->dev_state) && in btrfs_free_extra_devids()
965 &device->dev_state)) { in btrfs_free_extra_devids()
974 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_free_extra_devids()
976 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_free_extra_devids()
978 &device->dev_state)) in btrfs_free_extra_devids()
1009 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_close_bdev()
1026 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in btrfs_close_one_device()
1032 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) in btrfs_close_one_device()
1370 test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) { in find_free_dev_extent_start()
1577 WARN_ON(!test_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state)); in btrfs_alloc_dev_extent()
1578 WARN_ON(test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)); in btrfs_alloc_dev_extent()
1822 !test_bit(BTRFS_DEV_STATE_MISSING, &next_device->dev_state) in btrfs_find_next_active_device()
1885 if (test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) { in btrfs_rm_device()
1890 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in btrfs_rm_device()
1896 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_rm_device()
1918 clear_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in btrfs_rm_device()
1946 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) in btrfs_rm_device()
1966 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) in btrfs_rm_device()
1990 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_rm_device()
2017 if (test_bit(BTRFS_DEV_STATE_MISSING, &srcdev->dev_state)) in btrfs_rm_dev_replace_remove_srcdev()
2020 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &srcdev->dev_state)) in btrfs_rm_dev_replace_remove_srcdev()
2032 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &srcdev->dev_state)) { in btrfs_rm_dev_replace_free_srcdev()
2138 &tmp->dev_state) && !tmp->bdev) { in btrfs_find_device_missing_or_by_path()
2378 set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); in btrfs_init_new_device()
2389 set_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in btrfs_init_new_device()
2390 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state); in btrfs_init_new_device()
2595 if (!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) in btrfs_grow_device()
2605 test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) { in btrfs_grow_device()
3459 if (!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) || in __btrfs_balance()
3462 test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) in __btrfs_balance()
4351 if (test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) in btrfs_shrink_device()
4363 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in btrfs_shrink_device()
4505 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) in btrfs_shrink_device()
4668 if (!test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) { in __btrfs_alloc_chunk()
4675 &device->dev_state) || in __btrfs_alloc_chunk()
4676 test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) in __btrfs_alloc_chunk()
5035 &map->stripes[i].dev->dev_state)) { in btrfs_chunk_readonly()
5040 &map->stripes[i].dev->dev_state)) { in btrfs_chunk_readonly()
6075 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state) || in btrfs_schedule_bio()
6211 !test_bit(BTRFS_DEV_STATE_WRITEABLE, &dev->dev_state))) { in btrfs_map_bio()
6260 set_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in add_missing_dev()
6509 &(map->stripes[i].dev->dev_state)); in read_one_chunk()
6543 clear_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state); in fill_device_from_item()
6655 !test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) { in read_one_dev()
6663 set_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state); in read_one_dev()
6669 &device->dev_state)); in read_one_dev()
6683 BUG_ON(test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)); in read_one_dev()
6690 set_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state); in read_one_dev()
6691 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && in read_one_dev()
6692 !test_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state)) { in read_one_dev()
6859 test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state) || in btrfs_check_rw_degradable()