summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorDavid Sterba2019-05-17 11:43:41 +0200
committerDavid Sterba2019-07-01 13:34:58 +0200
commit158da513b13deb04b266e4ad171871d1a8531f26 (patch)
tree8be777b2534ca3cf51195be6670cf8663e3dab1b /fs/btrfs/extent-tree.c
parentbtrfs: factor out devs_max setting in __btrfs_alloc_chunk (diff)
downloadkernel-qcow2-linux-158da513b13deb04b266e4ad171871d1a8531f26.tar.gz
kernel-qcow2-linux-158da513b13deb04b266e4ad171871d1a8531f26.tar.xz
kernel-qcow2-linux-158da513b13deb04b266e4ad171871d1a8531f26.zip
btrfs: refactor helper for bg flags to name conversion
The helper lacks the btrfs_ prefix and the parameter is the raw blockgroup type, so none of the callers has to do the flags -> index conversion. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 326fd8660efb..af73264e33a5 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -10146,7 +10146,6 @@ void btrfs_add_raid_kobjects(struct btrfs_fs_info *fs_info)
struct btrfs_space_info *space_info;
struct raid_kobject *rkobj;
LIST_HEAD(list);
- int index;
int ret = 0;
spin_lock(&fs_info->pending_raid_kobjs_lock);
@@ -10155,10 +10154,9 @@ void btrfs_add_raid_kobjects(struct btrfs_fs_info *fs_info)
list_for_each_entry(rkobj, &list, list) {
space_info = __find_space_info(fs_info, rkobj->flags);
- index = btrfs_bg_flags_to_raid_index(rkobj->flags);
ret = kobject_add(&rkobj->kobj, &space_info->kobj,
- "%s", get_raid_name(index));
+ "%s", btrfs_bg_type_to_raid_name(rkobj->flags));
if (ret) {
kobject_put(&rkobj->kobj);
break;