Convert alloc_chunk_ctl::type to take the original type in
btrfs_alloc_chunk(). This will help refactoring in the following commits.

Signed-off-by: Naohiro Aota <naohiro.a...@wdc.com>
---
 kernel-shared/volumes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c
index 3b1b8fc0b560..ea14a9413157 100644
--- a/kernel-shared/volumes.c
+++ b/kernel-shared/volumes.c
@@ -149,7 +149,7 @@ const struct btrfs_raid_attr 
btrfs_raid_array[BTRFS_NR_RAID_TYPES] = {
 };
 
 struct alloc_chunk_ctl {
-       enum btrfs_raid_types type;
+       u64 type;
        int num_stripes;
        int max_stripes;
        int min_stripes;
@@ -1008,7 +1008,7 @@ error:
 static void init_alloc_chunk_ctl(struct btrfs_fs_info *info,
                                 struct alloc_chunk_ctl *ctl)
 {
-       int type = ctl->type;
+       enum btrfs_raid_types type = btrfs_bg_flags_to_raid_index(ctl->type);
 
        ctl->num_stripes = btrfs_raid_array[type].dev_stripes;
        ctl->min_stripes = btrfs_raid_array[type].devs_min;
@@ -1069,7 +1069,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
                return -ENOSPC;
        }
 
-       ctl.type = btrfs_bg_flags_to_raid_index(type);
+       ctl.type = type;
        ctl.max_stripes = 0;
        ctl.total_devs = btrfs_super_num_devices(info->super_copy);
 
-- 
2.31.1

Reply via email to