summaryrefslogtreecommitdiff
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r--fs/btrfs/compression.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 1e7174ad32e2..7fde7698c331 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -662,7 +662,7 @@ static struct list_head *alloc_heuristic_ws(struct btrfs_fs_info *fs_info)
{
struct heuristic_ws *ws;
- ws = kzalloc(sizeof(*ws), GFP_KERNEL);
+ ws = kzalloc_obj(*ws, GFP_KERNEL);
if (!ws)
return ERR_PTR(-ENOMEM);
@@ -670,11 +670,11 @@ static struct list_head *alloc_heuristic_ws(struct btrfs_fs_info *fs_info)
if (!ws->sample)
goto fail;
- ws->bucket = kcalloc(BUCKET_SIZE, sizeof(*ws->bucket), GFP_KERNEL);
+ ws->bucket = kzalloc_objs(*ws->bucket, BUCKET_SIZE, GFP_KERNEL);
if (!ws->bucket)
goto fail;
- ws->bucket_b = kcalloc(BUCKET_SIZE, sizeof(*ws->bucket_b), GFP_KERNEL);
+ ws->bucket_b = kzalloc_objs(*ws->bucket_b, BUCKET_SIZE, GFP_KERNEL);
if (!ws->bucket_b)
goto fail;
@@ -734,7 +734,7 @@ static int alloc_workspace_manager(struct btrfs_fs_info *fs_info,
struct list_head *workspace;
ASSERT(fs_info->compr_wsm[type] == NULL);
- gwsm = kzalloc(sizeof(*gwsm), GFP_KERNEL);
+ gwsm = kzalloc_obj(*gwsm, GFP_KERNEL);
if (!gwsm)
return -ENOMEM;