mm/readahead: make do_page_cache_ra take a readahead_control

Rename __do_page_cache_readahead() to do_page_cache_ra() and call it
directly from ondemand_readahead() instead of indirecting via ra_submit().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Eric Biggers <ebiggers@google.com>
Link: https://lkml.kernel.org/r/20200903140844.14194-5-willy@infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Matthew Wilcox (Oracle)
2020-10-15 20:06:17 -07:00
committed by Linus Torvalds
parent 73bb49da50
commit 8238287ead
2 changed files with 20 additions and 19 deletions

View File

@@ -51,18 +51,17 @@ void unmap_page_range(struct mmu_gather *tlb,
void force_page_cache_readahead(struct address_space *, struct file *,
pgoff_t index, unsigned long nr_to_read);
void __do_page_cache_readahead(struct address_space *, struct file *,
pgoff_t index, unsigned long nr_to_read,
unsigned long lookahead_size);
void do_page_cache_ra(struct readahead_control *,
unsigned long nr_to_read, unsigned long lookahead_size);
/*
* Submit IO for the read-ahead request in file_ra_state.
*/
static inline void ra_submit(struct file_ra_state *ra,
struct address_space *mapping, struct file *filp)
struct address_space *mapping, struct file *file)
{
__do_page_cache_readahead(mapping, filp,
ra->start, ra->size, ra->async_size);
DEFINE_READAHEAD(ractl, file, mapping, ra->start);
do_page_cache_ra(&ractl, ra->size, ra->async_size);
}
struct page *find_get_entry(struct address_space *mapping, pgoff_t index);