Skip to content

Commit

Permalink
fs: make fsync_buffers_list() plug
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jens Axboe committed Mar 17, 2011
1 parent 9b6096a commit 4ee2491
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4ee2491

Please sign in to comment.