btrfs: cleanup device states define BTRFS_DEV_STATE_MISSING
[sfrench/cifs-2.6.git] / fs / btrfs / scrub.c
index dc58005cb9f6ab2501fc929b6f7a8ae45545c559..f8a073ce490bbe449260434cb00d72da6a5b8f37 100644 (file)
@@ -2535,7 +2535,7 @@ leave_nomem:
        }
 
        WARN_ON(sblock->page_count == 0);
-       if (dev->missing) {
+       if (test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state)) {
                /*
                 * This case should only be hit for RAID 5/6 device replace. See
                 * the comment in scrub_missing_raid56_pages() for details.
@@ -2870,7 +2870,7 @@ static int scrub_extent_for_parity(struct scrub_parity *sparity,
        u8 csum[BTRFS_CSUM_SIZE];
        u32 blocksize;
 
-       if (dev->missing) {
+       if (test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state)) {
                scrub_parity_mark_sectors_error(sparity, logical, len);
                return 0;
        }
@@ -4112,7 +4112,8 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
 
        mutex_lock(&fs_info->fs_devices->device_list_mutex);
        dev = btrfs_find_device(fs_info, devid, NULL, NULL);
-       if (!dev || (dev->missing && !is_dev_replace)) {
+       if (!dev || (test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state) &&
+                    !is_dev_replace)) {
                mutex_unlock(&fs_info->fs_devices->device_list_mutex);
                return -ENODEV;
        }