aboutsummaryrefslogtreecommitdiffstats
path: root/mm/readahead.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/readahead.c')
-rw-r--r--mm/readahead.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index 88ea0f29aac8..7f9bf588c936 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -21,8 +21,16 @@ void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
21} 21}
22EXPORT_SYMBOL(default_unplug_io_fn); 22EXPORT_SYMBOL(default_unplug_io_fn);
23 23
24/*
25 * Convienent macros for min/max read-ahead pages.
26 * Note that MAX_RA_PAGES is rounded down, while MIN_RA_PAGES is rounded up.
27 * The latter is necessary for systems with large page size(i.e. 64k).
28 */
29#define MAX_RA_PAGES (VM_MAX_READAHEAD*1024 / PAGE_CACHE_SIZE)
30#define MIN_RA_PAGES DIV_ROUND_UP(VM_MIN_READAHEAD*1024, PAGE_CACHE_SIZE)
31
24struct backing_dev_info default_backing_dev_info = { 32struct backing_dev_info default_backing_dev_info = {
25 .ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE, 33 .ra_pages = MAX_RA_PAGES,
26 .state = 0, 34 .state = 0,
27 .capabilities = BDI_CAP_MAP_COPY, 35 .capabilities = BDI_CAP_MAP_COPY,
28 .unplug_io_fn = default_unplug_io_fn, 36 .unplug_io_fn = default_unplug_io_fn,
@@ -51,7 +59,7 @@ static inline unsigned long get_max_readahead(struct file_ra_state *ra)
51 59
52static inline unsigned long get_min_readahead(struct file_ra_state *ra) 60static inline unsigned long get_min_readahead(struct file_ra_state *ra)
53{ 61{
54 return (VM_MIN_READAHEAD * 1024) / PAGE_CACHE_SIZE; 62 return MIN_RA_PAGES;
55} 63}
56 64
57static inline void reset_ahead_window(struct file_ra_state *ra) 65static inline void reset_ahead_window(struct file_ra_state *ra)