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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user