btrfs: open code btrfs_init_dev_replace_tgtdev_for_resume()
[sfrench/cifs-2.6.git] / fs / btrfs / dev-replace.c
index a428d528220f4cc1e112fa1c72372c392fc23fa3..dd717e204b5e104bde541e6dfcc0eade543c9ba1 100644 (file)
@@ -173,8 +173,14 @@ no_valid_dev_replace_entry_found:
                        }
                        set_bit(BTRFS_DEV_STATE_REPLACE_TGT,
                                &dev_replace->tgtdev->dev_state);
-                       btrfs_init_dev_replace_tgtdev_for_resume(fs_info,
-                               dev_replace->tgtdev);
+
+                       WARN_ON(fs_info->fs_devices->rw_devices == 0);
+                       dev_replace->tgtdev->io_width = fs_info->sectorsize;
+                       dev_replace->tgtdev->io_align = fs_info->sectorsize;
+                       dev_replace->tgtdev->sector_size = fs_info->sectorsize;
+                       dev_replace->tgtdev->fs_info = fs_info;
+                       set_bit(BTRFS_DEV_STATE_IN_FS_METADATA,
+                               &dev_replace->tgtdev->dev_state);
                }
                break;
        }