diff options
| author | Christoph Hellwig <[email protected]> | 2021-10-20 14:41:19 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2021-10-20 15:56:11 +0000 |
| commit | 008f75a20e7072d0840ec323c39b42206f3fa8a0 (patch) | |
| tree | f5e446c0d7e9024e7eb1be8e57fb842663f91c41 /fs/fs-writeback.c | |
| parent | block: optimise blk_flush_plug_list (diff) | |
| download | kernel-008f75a20e7072d0840ec323c39b42206f3fa8a0.tar.gz kernel-008f75a20e7072d0840ec323c39b42206f3fa8a0.zip | |
block: cleanup the flush plug helpers
Consolidate the various helpers into a single blk_flush_plug helper that
takes a plk_plug and the from_scheduler bool and switch all callsites to
call it directly. Checks that the plug is non-NULL must be performed by
the caller, something that most already do anyway.
Signed-off-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'fs/fs-writeback.c')
| -rw-r--r-- | fs/fs-writeback.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 81ec192ce067..4124a89a1a5d 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1893,7 +1893,8 @@ static long writeback_sb_inodes(struct super_block *sb, * unplug, so get our IOs out the door before we * give up the CPU. */ - blk_flush_plug(current); + if (current->plug) + blk_flush_plug(current->plug, false); cond_resched(); } @@ -2291,7 +2292,7 @@ void wakeup_flusher_threads(enum wb_reason reason) * If we are expecting writeback progress we must submit plugged IO. */ if (blk_needs_flush_plug(current)) - blk_schedule_flush_plug(current); + blk_flush_plug(current->plug, true); rcu_read_lock(); list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) |
