From: Andrew Morton CONFIG_ADAPTIVE_READAHEAD=n: mm/readahead.c: In function 'page_cache_readahead_adaptive': mm/readahead.c:1606: warning: implicit declaration of function 'get_readahead_bounds' mm/readahead.c:1618: warning: implicit declaration of function 'initial_readahead' mm/readahead.c:1624: error: 'struct file_ra_state' has no member named 'lookahead_index' mm/readahead.c:1626: warning: implicit declaration of function 'state_based_readahead' mm/readahead.c:1632: warning: implicit declaration of function 'ra_has_index' mm/readahead.c:1633: warning: implicit declaration of function 'thrashing_recovery_readahead' mm/readahead.c:1639: warning: implicit declaration of function 'try_backward_prefetching' mm/readahead.c:1640: warning: implicit declaration of function 'ra_submit' mm/readahead.c:1645: warning: implicit declaration of function 'try_context_based_readahead' Cc: Wu Fengguang Signed-off-by: Andrew Morton --- include/linux/mm.h | 14 ++++++++++++++ mm/readahead.c | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff -puN include/linux/mm.h~readahead-call-scheme-build-fix include/linux/mm.h --- a/include/linux/mm.h~readahead-call-scheme-build-fix +++ a/include/linux/mm.h @@ -1087,6 +1087,8 @@ unsigned long page_cache_readahead(struc void handle_ra_miss(struct address_space *mapping, struct file_ra_state *ra, pgoff_t offset); unsigned long max_sane_readahead(unsigned long nr); + +#ifdef CONFIG_ADAPTIVE_READAHEAD unsigned long page_cache_readahead_adaptive(struct address_space *mapping, struct file_ra_state *ra, @@ -1094,6 +1096,18 @@ page_cache_readahead_adaptive(struct add struct page *page, pgoff_t offset, unsigned long size); +#else +static inline unsigned long +page_cache_readahead_adaptive(struct address_space *mapping, + struct file_ra_state *ra, + struct file *filp, + struct page *page, + pgoff_t offset, + unsigned long size) +{ + return page_cache_readahead(mapping, ra, filp, offset, size); +} +#endif #if defined(CONFIG_DEBUG_READAHEAD) void readahead_cache_hit(struct file_ra_state *ra, struct page *page); diff -puN mm/readahead.c~readahead-call-scheme-build-fix mm/readahead.c --- a/mm/readahead.c~readahead-call-scheme-build-fix +++ a/mm/readahead.c @@ -1557,8 +1557,6 @@ static inline void get_readahead_bounds( *ra_max / 8); } -#endif /* CONFIG_ADAPTIVE_READAHEAD */ - /** * page_cache_readahead_adaptive - thrashing safe adaptive read-ahead * @mapping, @ra, @filp, @offset, @req_size: the same as page_cache_readahead() @@ -1671,6 +1669,7 @@ readit: return ra_size; } EXPORT_SYMBOL_GPL(page_cache_readahead_adaptive); +#endif /* CONFIG_ADAPTIVE_READAHEAD */ #ifdef CONFIG_DEBUG_READAHEAD /** _