Skip to content

Commit 56a4d67

Browse files
author
Matthew Wilcox (Oracle)
committed
mm/readahead: Switch to page_cache_ra_order
do_page_cache_ra() was being exposed for the benefit of do_sync_mmap_readahead(). Switch it over to page_cache_ra_order() partly because it's a better interface but mostly for the benefit of the next patch. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
1 parent 1854bc6 commit 56a4d67

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

mm/filemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3027,7 +3027,7 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf)
30273027
ra->size = ra->ra_pages;
30283028
ra->async_size = ra->ra_pages / 4;
30293029
ractl._index = ra->start;
3030-
do_page_cache_ra(&ractl, ra->size, ra->async_size);
3030+
page_cache_ra_order(&ractl, ra, 0);
30313031
return fpin;
30323032
}
30333033

mm/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ void unmap_page_range(struct mmu_gather *tlb,
7979
unsigned long addr, unsigned long end,
8080
struct zap_details *details);
8181

82-
void do_page_cache_ra(struct readahead_control *, unsigned long nr_to_read,
83-
unsigned long lookahead_size);
82+
void page_cache_ra_order(struct readahead_control *, struct file_ra_state *,
83+
unsigned int order);
8484
void force_page_cache_ra(struct readahead_control *, unsigned long nr);
8585
static inline void force_page_cache_readahead(struct address_space *mapping,
8686
struct file *file, pgoff_t index, unsigned long nr_to_read)

mm/readahead.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(page_cache_ra_unbounded);
247247
* behaviour which would occur if page allocations are causing VM writeback.
248248
* We really don't want to intermingle reads and writes like that.
249249
*/
250-
void do_page_cache_ra(struct readahead_control *ractl,
250+
static void do_page_cache_ra(struct readahead_control *ractl,
251251
unsigned long nr_to_read, unsigned long lookahead_size)
252252
{
253253
struct inode *inode = ractl->mapping->host;
@@ -462,7 +462,7 @@ static inline int ra_alloc_folio(struct readahead_control *ractl, pgoff_t index,
462462
return err;
463463
}
464464

465-
static void page_cache_ra_order(struct readahead_control *ractl,
465+
void page_cache_ra_order(struct readahead_control *ractl,
466466
struct file_ra_state *ra, unsigned int new_order)
467467
{
468468
struct address_space *mapping = ractl->mapping;

0 commit comments

Comments
 (0)