瀏覽代碼

read-ahead: use plugging

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Jens Axboe 15 年之前
父節點
當前提交
5b417b1873
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      mm/readahead.c

+ 6 - 0
mm/readahead.c

@@ -109,9 +109,12 @@ EXPORT_SYMBOL(read_cache_pages);
 static int read_pages(struct address_space *mapping, struct file *filp,
 static int read_pages(struct address_space *mapping, struct file *filp,
 		struct list_head *pages, unsigned nr_pages)
 		struct list_head *pages, unsigned nr_pages)
 {
 {
+	struct blk_plug plug;
 	unsigned page_idx;
 	unsigned page_idx;
 	int ret;
 	int ret;
 
 
+	blk_start_plug(&plug);
+
 	if (mapping->a_ops->readpages) {
 	if (mapping->a_ops->readpages) {
 		ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
 		ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
 		/* Clean up the remaining pages */
 		/* Clean up the remaining pages */
@@ -129,7 +132,10 @@ static int read_pages(struct address_space *mapping, struct file *filp,
 		page_cache_release(page);
 		page_cache_release(page);
 	}
 	}
 	ret = 0;
 	ret = 0;
+
 out:
 out:
+	blk_finish_plug(&plug);
+
 	return ret;
 	return ret;
 }
 }