Эх сурвалжийг харах

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 <jaxboe@fusionio.com>
Jens Axboe 14 жил өмнө
parent
commit
4ee2491ed8
1 өөрчлөгдсөн 6 нэмэгдсэн , 0 устгасан
  1. 6 0
      fs/buffer.c

+ 6 - 0
fs/buffer.c

@@ -743,8 +743,10 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
 	struct list_head tmp;
 	struct list_head tmp;
 	struct address_space *mapping;
 	struct address_space *mapping;
 	int err = 0, err2;
 	int err = 0, err2;
+	struct blk_plug plug;
 
 
 	INIT_LIST_HEAD(&tmp);
 	INIT_LIST_HEAD(&tmp);
+	blk_start_plug(&plug);
 
 
 	spin_lock(lock);
 	spin_lock(lock);
 	while (!list_empty(list)) {
 	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)) {
 	while (!list_empty(&tmp)) {
 		bh = BH_ENTRY(tmp.prev);
 		bh = BH_ENTRY(tmp.prev);
 		get_bh(bh);
 		get_bh(bh);