summaryrefslogtreecommitdiff
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 68228bf89b82..22a1996c00cd 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -653,7 +653,7 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
if (atomic_read(&isw_nr_in_flight) > WB_FRN_MAX_IN_FLIGHT)
return;
- isw = kzalloc(struct_size(isw, inodes, 2), GFP_ATOMIC);
+ isw = kzalloc_flex(*isw, inodes, 2, GFP_ATOMIC);
if (!isw)
return;
@@ -724,8 +724,7 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)
int nr;
bool restart = false;
- isw = kzalloc(struct_size(isw, inodes, WB_MAX_INODES_PER_ISW),
- GFP_KERNEL);
+ isw = kzalloc_flex(*isw, inodes, WB_MAX_INODES_PER_ISW, GFP_KERNEL);
if (!isw)
return restart;
@@ -1075,7 +1074,7 @@ restart:
nr_pages = wb_split_bdi_pages(wb, base_work->nr_pages);
- work = kmalloc(sizeof(*work), GFP_ATOMIC);
+ work = kmalloc_obj(*work, GFP_ATOMIC);
if (work) {
*work = *base_work;
work->nr_pages = nr_pages;
@@ -1173,7 +1172,7 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
dirty = dirty * 10 / 8;
/* issue the writeback work */
- work = kzalloc(sizeof(*work), GFP_NOWAIT);
+ work = kzalloc_obj(*work, GFP_NOWAIT);
if (work) {
work->nr_pages = dirty;
work->sync_mode = WB_SYNC_NONE;