diff options
Diffstat (limited to 'mm/readahead.c')
-rw-r--r-- | mm/readahead.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/mm/readahead.c b/mm/readahead.c index 77506a291a2d..2c0cc489e288 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -109,9 +109,12 @@ EXPORT_SYMBOL(read_cache_pages); | |||
109 | static int read_pages(struct address_space *mapping, struct file *filp, | 109 | static int read_pages(struct address_space *mapping, struct file *filp, |
110 | struct list_head *pages, unsigned nr_pages) | 110 | struct list_head *pages, unsigned nr_pages) |
111 | { | 111 | { |
112 | struct blk_plug plug; | ||
112 | unsigned page_idx; | 113 | unsigned page_idx; |
113 | int ret; | 114 | int ret; |
114 | 115 | ||
116 | blk_start_plug(&plug); | ||
117 | |||
115 | if (mapping->a_ops->readpages) { | 118 | if (mapping->a_ops->readpages) { |
116 | ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages); | 119 | ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages); |
117 | /* Clean up the remaining pages */ | 120 | /* Clean up the remaining pages */ |
@@ -129,7 +132,10 @@ static int read_pages(struct address_space *mapping, struct file *filp, | |||
129 | page_cache_release(page); | 132 | page_cache_release(page); |
130 | } | 133 | } |
131 | ret = 0; | 134 | ret = 0; |
135 | |||
132 | out: | 136 | out: |
137 | blk_finish_plug(&plug); | ||
138 | |||
133 | return ret; | 139 | return ret; |
134 | } | 140 | } |
135 | 141 | ||
@@ -554,17 +560,5 @@ page_cache_async_readahead(struct address_space *mapping, | |||
554 | 560 | ||
555 | /* do read-ahead */ | 561 | /* do read-ahead */ |
556 | ondemand_readahead(mapping, ra, filp, true, offset, req_size); | 562 | ondemand_readahead(mapping, ra, filp, true, offset, req_size); |
557 | |||
558 | #ifdef CONFIG_BLOCK | ||
559 | /* | ||
560 | * Normally the current page is !uptodate and lock_page() will be | ||
561 | * immediately called to implicitly unplug the device. However this | ||
562 | * is not always true for RAID conifgurations, where data arrives | ||
563 | * not strictly in their submission order. In this case we need to | ||
564 | * explicitly kick off the IO. | ||
565 | */ | ||
566 | if (PageUptodate(page)) | ||
567 | blk_run_backing_dev(mapping->backing_dev_info, NULL); | ||
568 | #endif | ||
569 | } | 563 | } |
570 | EXPORT_SYMBOL_GPL(page_cache_async_readahead); | 564 | EXPORT_SYMBOL_GPL(page_cache_async_readahead); |