btrfs: open code btrfs_init_dev_replace_tgtdev_for_resume()
[sfrench/cifs-2.6.git] / fs / btrfs / volumes.c
index b2d05c6b1c5672a638ba8752333c10508e366885..bdfde42ebebf958247b5522047611d3f6fac216a 100644 (file)
@@ -2666,19 +2666,6 @@ error:
        return ret;
 }
 
-void btrfs_init_dev_replace_tgtdev_for_resume(struct btrfs_fs_info *fs_info,
-                                             struct btrfs_device *tgtdev)
-{
-       u32 sectorsize = fs_info->sectorsize;
-
-       WARN_ON(fs_info->fs_devices->rw_devices == 0);
-       tgtdev->io_width = sectorsize;
-       tgtdev->io_align = sectorsize;
-       tgtdev->sector_size = sectorsize;
-       tgtdev->fs_info = fs_info;
-       set_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &tgtdev->dev_state);
-}
-
 static noinline int btrfs_update_device(struct btrfs_trans_handle *trans,
                                        struct btrfs_device *device)
 {
@@ -4672,7 +4659,7 @@ static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type)
        btrfs_set_fs_incompat(info, RAID56);
 }
 
-#define BTRFS_MAX_DEVS(r) ((BTRFS_MAX_ITEM_SIZE(r->fs_info)            \
+#define BTRFS_MAX_DEVS(info) ((BTRFS_MAX_ITEM_SIZE(info)       \
                        - sizeof(struct btrfs_chunk))           \
                        / sizeof(struct btrfs_stripe) + 1)
 
@@ -4729,7 +4716,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
                max_stripe_size = SZ_1G;
                max_chunk_size = 10 * max_stripe_size;
                if (!devs_max)
-                       devs_max = BTRFS_MAX_DEVS(info->chunk_root);
+                       devs_max = BTRFS_MAX_DEVS(info);
        } else if (type & BTRFS_BLOCK_GROUP_METADATA) {
                /* for larger filesystems, use larger metadata chunks */
                if (fs_devices->total_rw_bytes > 50ULL * SZ_1G)
@@ -4738,7 +4725,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
                        max_stripe_size = SZ_256M;
                max_chunk_size = max_stripe_size;
                if (!devs_max)
-                       devs_max = BTRFS_MAX_DEVS(info->chunk_root);
+                       devs_max = BTRFS_MAX_DEVS(info);
        } else if (type & BTRFS_BLOCK_GROUP_SYSTEM) {
                max_stripe_size = SZ_32M;
                max_chunk_size = 2 * max_stripe_size;