aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
authorDavid Sterba <dsterba@suse.com>2026-04-14 17:30:33 +0200
committerDavid Sterba <dsterba@suse.com>2026-05-24 03:01:00 +0200
commit554ffe4d2c70bc30b16937c900dfcaf5acdaa60d (patch)
treeca0b6597c623a80ea2f9c03006d60d0425330080 /fs
parentafd5c965c6ea9625890b75401261fc5d407c11cd (diff)
downloadlinux-next-history-554ffe4d2c70bc30b16937c900dfcaf5acdaa60d.tar.gz
btrfs: do more kmalloc_obj()/kmalloc_objs() conversions
Do a few more (trivial) conversions that started in commit 69050f8d6d075d ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types"). Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/relocation.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 3ebaf5880125f..9cbae3cf8bdd1 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -590,7 +590,7 @@ static struct btrfs_root *create_reloc_root(struct btrfs_trans_handle *trans,
struct btrfs_key root_key;
int ret = 0;
- root_item = kmalloc(sizeof(*root_item), GFP_NOFS);
+ root_item = kmalloc_obj(*root_item, GFP_NOFS);
if (!root_item)
return ERR_PTR(-ENOMEM);
@@ -2944,7 +2944,7 @@ static int relocate_file_extent_cluster(struct reloc_control *rc)
if (!cluster->nr)
return 0;
- ra = kzalloc(sizeof(*ra), GFP_NOFS);
+ ra = kzalloc_obj(*ra, GFP_NOFS);
if (!ra)
return -ENOMEM;
@@ -3863,7 +3863,7 @@ static int add_remap_tree_entries(struct btrfs_trans_handle *trans, struct btrfs
max_items = BTRFS_LEAF_DATA_SIZE(trans->fs_info) / sizeof(struct btrfs_item);
- data_sizes = kzalloc(sizeof(u32) * min_t(u32, num_entries, max_items), GFP_NOFS);
+ data_sizes = kzalloc_objs(u32, min_t(u32, num_entries, max_items), GFP_NOFS);
if (!data_sizes)
return -ENOMEM;
@@ -4454,7 +4454,7 @@ static int create_remap_tree_entries(struct btrfs_trans_handle *trans,
btrfs_release_path(path);
- space_runs = kmalloc(sizeof(*space_runs) * extent_count, GFP_NOFS);
+ space_runs = kmalloc_objs(*space_runs, extent_count, GFP_NOFS);
if (!space_runs) {
mutex_unlock(&bg->free_space_lock);
return -ENOMEM;
@@ -4543,7 +4543,7 @@ static int create_remap_tree_entries(struct btrfs_trans_handle *trans,
mutex_unlock(&bg->free_space_lock);
max_entries = extent_count + 2;
- entries = kmalloc(sizeof(*entries) * max_entries, GFP_NOFS);
+ entries = kmalloc_objs(*entries, max_entries, GFP_NOFS);
if (!entries) {
ret = -ENOMEM;
goto out;