aboutsummaryrefslogtreecommitdiffstats
path: root/mm/readahead.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/readahead.c')
-rw-r--r--mm/readahead.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index d7c6e143a129..a7f01fcce9e7 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -133,15 +133,12 @@ out:
133} 133}
134 134
135/* 135/*
136 * do_page_cache_readahead actually reads a chunk of disk. It allocates all 136 * __do_page_cache_readahead() actually reads a chunk of disk. It allocates all
137 * the pages first, then submits them all for I/O. This avoids the very bad 137 * the pages first, then submits them all for I/O. This avoids the very bad
138 * behaviour which would occur if page allocations are causing VM writeback. 138 * behaviour which would occur if page allocations are causing VM writeback.
139 * We really don't want to intermingle reads and writes like that. 139 * We really don't want to intermingle reads and writes like that.
140 * 140 *
141 * Returns the number of pages requested, or the maximum amount of I/O allowed. 141 * Returns the number of pages requested, or the maximum amount of I/O allowed.
142 *
143 * do_page_cache_readahead() returns -1 if it encountered request queue
144 * congestion.
145 */ 142 */
146static int 143static int
147__do_page_cache_readahead(struct address_space *mapping, struct file *filp, 144__do_page_cache_readahead(struct address_space *mapping, struct file *filp,
@@ -232,22 +229,6 @@ int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
232} 229}
233 230
234/* 231/*
235 * This version skips the IO if the queue is read-congested, and will tell the
236 * block layer to abandon the readahead if request allocation would block.
237 *
238 * force_page_cache_readahead() will ignore queue congestion and will block on
239 * request queues.
240 */
241int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
242 pgoff_t offset, unsigned long nr_to_read)
243{
244 if (bdi_read_congested(mapping->backing_dev_info))
245 return -1;
246
247 return __do_page_cache_readahead(mapping, filp, offset, nr_to_read, 0);
248}
249
250/*
251 * Given a desired number of PAGE_CACHE_SIZE readahead pages, return a 232 * Given a desired number of PAGE_CACHE_SIZE readahead pages, return a
252 * sensible upper limit. 233 * sensible upper limit.
253 */ 234 */
@@ -260,7 +241,7 @@ unsigned long max_sane_readahead(unsigned long nr)
260/* 241/*
261 * Submit IO for the read-ahead request in file_ra_state. 242 * Submit IO for the read-ahead request in file_ra_state.
262 */ 243 */
263static unsigned long ra_submit(struct file_ra_state *ra, 244unsigned long ra_submit(struct file_ra_state *ra,
264 struct address_space *mapping, struct file *filp) 245 struct address_space *mapping, struct file *filp)
265{ 246{
266 int actual; 247 int actual;