Skip to content

Commit 8395cd9

Browse files
htejunaxboe
authored andcommitted
writeback: add @gfp to wb_init()
wb_init() currently always uses GFP_KERNEL but the planned cgroup writeback support needs using other allocation masks. Add @gfp to wb_init(). This patch doesn't introduce any behavior changes. Signed-off-by: Tejun Heo <[email protected]> Reviewed-by: Jan Kara <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent a212b10 commit 8395cd9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mm/backing-dev.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ void wb_wakeup_delayed(struct bdi_writeback *wb)
291291
*/
292292
#define INIT_BW (100 << (20 - PAGE_SHIFT))
293293

294-
static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi)
294+
static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi,
295+
gfp_t gfp)
295296
{
296297
int i, err;
297298

@@ -315,12 +316,12 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi)
315316
INIT_LIST_HEAD(&wb->work_list);
316317
INIT_DELAYED_WORK(&wb->dwork, wb_workfn);
317318

318-
err = fprop_local_init_percpu(&wb->completions, GFP_KERNEL);
319+
err = fprop_local_init_percpu(&wb->completions, gfp);
319320
if (err)
320321
return err;
321322

322323
for (i = 0; i < NR_WB_STAT_ITEMS; i++) {
323-
err = percpu_counter_init(&wb->stat[i], 0, GFP_KERNEL);
324+
err = percpu_counter_init(&wb->stat[i], 0, gfp);
324325
if (err) {
325326
while (--i)
326327
percpu_counter_destroy(&wb->stat[i]);
@@ -378,7 +379,7 @@ int bdi_init(struct backing_dev_info *bdi)
378379
bdi->max_prop_frac = FPROP_FRAC_BASE;
379380
INIT_LIST_HEAD(&bdi->bdi_list);
380381

381-
err = wb_init(&bdi->wb, bdi);
382+
err = wb_init(&bdi->wb, bdi, GFP_KERNEL);
382383
if (err)
383384
return err;
384385

0 commit comments

Comments
 (0)