lkml.org 
[lkml]   [2020]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v10 24/25] fuse: Convert from readpages to readahead
On Wed, Mar 25, 2020 at 1:02 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Wed, Mar 25, 2020 at 10:42:56AM +0100, Miklos Szeredi wrote:
> > > + while ((page = readahead_page(rac))) {
> > > + if (fuse_readpages_fill(&data, page) != 0)
> >
> > Shouldn't this unlock + put page on error?
>
> We're certainly inconsistent between the two error exits from
> fuse_readpages_fill(). But I think we can simplify the whole thing
> ... how does this look to you?

Nice, overall.

>
> - while ((page = readahead_page(rac))) {
> - if (fuse_readpages_fill(&data, page) != 0)
> + nr_pages = min(readahead_count(rac), fc->max_pages);

Missing fc->max_read clamp.

> + ia = fuse_io_alloc(NULL, nr_pages);
> + if (!ia)
> return;
> + ap = &ia->ap;
> + __readahead_batch(rac, ap->pages, nr_pages);

nr_pages = __readahead_batch(...)?

This will give consecutive pages, right?

Thanks,
Miklos

\
 
 \ /
  Last update: 2020-03-25 15:44    [W:0.076 / U:2.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site