From: Jens Axboe Date: Thu, 17 Mar 2011 09:51:40 +0000 (+0100) Subject: fs: make fsync_buffers_list() plug X-Git-Tag: firefly_0821_release~7613^2~1808^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4ee2491ed8569f370bf4c1a4c046a6efb8032bd2;p=firefly-linux-kernel-4.4.55.git fs: make fsync_buffers_list() plug It used WRITE_SYNC_PLUG before and potentially submits a batch of IO, so lets enable plugging for this case. Signed-off-by: Jens Axboe --- diff --git a/fs/buffer.c b/fs/buffer.c index 42534f67d71b..2e6b1a387b7e 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -743,8 +743,10 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list) struct list_head tmp; struct address_space *mapping; int err = 0, err2; + struct blk_plug plug; INIT_LIST_HEAD(&tmp); + blk_start_plug(&plug); spin_lock(lock); while (!list_empty(list)) { @@ -781,6 +783,10 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list) } } + spin_unlock(lock); + blk_finish_plug(&plug); + spin_lock(lock); + while (!list_empty(&tmp)) { bh = BH_ENTRY(tmp.prev); get_bh(bh);