diff options
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r-- | mm/backing-dev.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index eaa4a5bbe063..65d420499a61 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -30,6 +30,7 @@ EXPORT_SYMBOL_GPL(default_backing_dev_info); | |||
30 | 30 | ||
31 | struct backing_dev_info noop_backing_dev_info = { | 31 | struct backing_dev_info noop_backing_dev_info = { |
32 | .name = "noop", | 32 | .name = "noop", |
33 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, | ||
33 | }; | 34 | }; |
34 | EXPORT_SYMBOL_GPL(noop_backing_dev_info); | 35 | EXPORT_SYMBOL_GPL(noop_backing_dev_info); |
35 | 36 | ||
@@ -243,6 +244,7 @@ static int __init default_bdi_init(void) | |||
243 | err = bdi_init(&default_backing_dev_info); | 244 | err = bdi_init(&default_backing_dev_info); |
244 | if (!err) | 245 | if (!err) |
245 | bdi_register(&default_backing_dev_info, NULL, "default"); | 246 | bdi_register(&default_backing_dev_info, NULL, "default"); |
247 | err = bdi_init(&noop_backing_dev_info); | ||
246 | 248 | ||
247 | return err; | 249 | return err; |
248 | } | 250 | } |
@@ -445,8 +447,8 @@ static int bdi_forker_thread(void *ptr) | |||
445 | switch (action) { | 447 | switch (action) { |
446 | case FORK_THREAD: | 448 | case FORK_THREAD: |
447 | __set_current_state(TASK_RUNNING); | 449 | __set_current_state(TASK_RUNNING); |
448 | task = kthread_run(bdi_writeback_thread, &bdi->wb, "flush-%s", | 450 | task = kthread_create(bdi_writeback_thread, &bdi->wb, |
449 | dev_name(bdi->dev)); | 451 | "flush-%s", dev_name(bdi->dev)); |
450 | if (IS_ERR(task)) { | 452 | if (IS_ERR(task)) { |
451 | /* | 453 | /* |
452 | * If thread creation fails, force writeout of | 454 | * If thread creation fails, force writeout of |
@@ -457,10 +459,13 @@ static int bdi_forker_thread(void *ptr) | |||
457 | /* | 459 | /* |
458 | * The spinlock makes sure we do not lose | 460 | * The spinlock makes sure we do not lose |
459 | * wake-ups when racing with 'bdi_queue_work()'. | 461 | * wake-ups when racing with 'bdi_queue_work()'. |
462 | * And as soon as the bdi thread is visible, we | ||
463 | * can start it. | ||
460 | */ | 464 | */ |
461 | spin_lock_bh(&bdi->wb_lock); | 465 | spin_lock_bh(&bdi->wb_lock); |
462 | bdi->wb.task = task; | 466 | bdi->wb.task = task; |
463 | spin_unlock_bh(&bdi->wb_lock); | 467 | spin_unlock_bh(&bdi->wb_lock); |
468 | wake_up_process(task); | ||
464 | } | 469 | } |
465 | break; | 470 | break; |
466 | 471 | ||