diff options
Diffstat (limited to 'mm/readahead.c')
-rw-r--r-- | mm/readahead.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/mm/readahead.c b/mm/readahead.c index 0f142a40984b..aa7ec424656a 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -118,8 +118,7 @@ static inline unsigned long get_next_ra_size(struct file_ra_state *ra) | |||
118 | #define list_to_page(head) (list_entry((head)->prev, struct page, lru)) | 118 | #define list_to_page(head) (list_entry((head)->prev, struct page, lru)) |
119 | 119 | ||
120 | /** | 120 | /** |
121 | * read_cache_pages - populate an address space with some pages, and | 121 | * read_cache_pages - populate an address space with some pages & start reads against them |
122 | * start reads against them. | ||
123 | * @mapping: the address_space | 122 | * @mapping: the address_space |
124 | * @pages: The address of a list_head which contains the target pages. These | 123 | * @pages: The address of a list_head which contains the target pages. These |
125 | * pages have their ->index populated and are otherwise uninitialised. | 124 | * pages have their ->index populated and are otherwise uninitialised. |
@@ -182,14 +181,11 @@ static int read_pages(struct address_space *mapping, struct file *filp, | |||
182 | list_del(&page->lru); | 181 | list_del(&page->lru); |
183 | if (!add_to_page_cache(page, mapping, | 182 | if (!add_to_page_cache(page, mapping, |
184 | page->index, GFP_KERNEL)) { | 183 | page->index, GFP_KERNEL)) { |
185 | ret = mapping->a_ops->readpage(filp, page); | 184 | mapping->a_ops->readpage(filp, page); |
186 | if (ret != AOP_TRUNCATED_PAGE) { | 185 | if (!pagevec_add(&lru_pvec, page)) |
187 | if (!pagevec_add(&lru_pvec, page)) | 186 | __pagevec_lru_add(&lru_pvec); |
188 | __pagevec_lru_add(&lru_pvec); | 187 | } else |
189 | continue; | 188 | page_cache_release(page); |
190 | } /* else fall through to release */ | ||
191 | } | ||
192 | page_cache_release(page); | ||
193 | } | 189 | } |
194 | pagevec_lru_add(&lru_pvec); | 190 | pagevec_lru_add(&lru_pvec); |
195 | ret = 0; | 191 | ret = 0; |
@@ -394,8 +390,8 @@ int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | |||
394 | * Read 'nr_to_read' pages starting at page 'offset'. If the flag 'block' | 390 | * Read 'nr_to_read' pages starting at page 'offset'. If the flag 'block' |
395 | * is set wait till the read completes. Otherwise attempt to read without | 391 | * is set wait till the read completes. Otherwise attempt to read without |
396 | * blocking. | 392 | * blocking. |
397 | * Returns 1 meaning 'success' if read is succesfull without switching off | 393 | * Returns 1 meaning 'success' if read is successful without switching off |
398 | * readhaead mode. Otherwise return failure. | 394 | * readahead mode. Otherwise return failure. |
399 | */ | 395 | */ |
400 | static int | 396 | static int |
401 | blockable_page_cache_readahead(struct address_space *mapping, struct file *filp, | 397 | blockable_page_cache_readahead(struct address_space *mapping, struct file *filp, |