aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/pagemap.h6
-rw-r--r--mm/readahead.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index ea268080380d..716875e53520 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -219,6 +219,12 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x)
219 return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD); 219 return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD);
220} 220}
221 221
222static inline struct page *page_cache_alloc_readahead(struct address_space *x)
223{
224 return __page_cache_alloc(mapping_gfp_mask(x) |
225 __GFP_COLD | __GFP_NORETRY | __GFP_NOWARN);
226}
227
222typedef int filler_t(void *, struct page *); 228typedef int filler_t(void *, struct page *);
223 229
224extern struct page * find_get_page(struct address_space *mapping, 230extern struct page * find_get_page(struct address_space *mapping,
diff --git a/mm/readahead.c b/mm/readahead.c
index 2c0cc489e288..867f9dd82dcd 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -180,7 +180,7 @@ __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
180 if (page) 180 if (page)
181 continue; 181 continue;
182 182
183 page = page_cache_alloc_cold(mapping); 183 page = page_cache_alloc_readahead(mapping);
184 if (!page) 184 if (!page)
185 break; 185 break;
186 page->index = page_offset; 186 page->index = page_offset;