lkml.org 
[lkml]   [2020]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 3/6] mm: Push readahead_control down into force_page_cache_readahead() [ver #2]
On Wed, Sep 02, 2020 at 04:44:38PM +0100, David Howells wrote:
> +++ b/mm/fadvise.c
> @@ -104,7 +104,10 @@ int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
> if (!nrpages)
> nrpages = ~0UL;
>
> - force_page_cache_readahead(mapping, file, start_index, nrpages);
> + {
> + DEFINE_READAHEAD(rac, file, mapping, start_index);
> + force_page_cache_readahead(&rac, nrpages);
> + }
> break;

This is kind of awkward. How about this:

static void force_page_cache_readahead(struct address_space *mapping,
struct file *file, pgoff_t index, unsigned long nr_to_read)
{
DEFINE_READAHEAD(rac, file, mapping, index);
force_page_cache_ra(&rac, nr_to_read);
}

in mm/internal.h for now (and it can migrate if it needs to be somewhere else)

\
 
 \ /
  Last update: 2020-09-02 17:54    [W:0.053 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site