btrfs: convert kmalloc_array to kmalloc_objs in btrfs_calc_avail_data_space()

There's one use of kmalloc_array() that can be transformed to
kmalloc_objs() in the same way as suggested in commit 69050f8d6d
("treewide: Replace kmalloc with kmalloc_obj for non-scalar types"),
swap the arguments and drop GFP flags. All the other cases of
kmalloc_array() do not use a simple type so this is the only one.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2026-04-14 17:30:34 +02:00
parent 9f4ab0787e
commit 37f1f51fba

View File

@ -1633,8 +1633,7 @@ static inline int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
}
}
devices_info = kmalloc_array(nr_devices, sizeof(*devices_info),
GFP_KERNEL);
devices_info = kmalloc_objs(*devices_info, nr_devices);
if (!devices_info)
return -ENOMEM;