Re: [PATCH v4 08/28] netfs: Provide readahead and readpage netfs helpers

2021-03-22 Thread David Howells
Matthew Wilcox wrote: > > + while ((page = readahead_page(ractl))) > > + put_page(page); > > You don't need this pair of lines (unless I'm missing something). > read_pages() in mm/readahead.c puts the reference and unlocks any > pages which are not read by the readahead op. Indeed,

Re: [PATCH v4 08/28] netfs: Provide readahead and readpage netfs helpers

2021-03-20 Thread Matthew Wilcox
On Wed, Mar 10, 2021 at 04:56:13PM +, David Howells wrote: > +void netfs_readahead(struct readahead_control *ractl, > + const struct netfs_read_request_ops *ops, > + void *netfs_priv) > +{ > + struct netfs_read_request *rreq; > + struct page *page; > +

Re: [PATCH v4 08/28] netfs: Provide readahead and readpage netfs helpers

2021-03-16 Thread David Howells
I'm going to make the code generate more information when warning about a subread reporting having over-read (see attached). David --- diff --git a/fs/netfs/read_helper.c b/fs/netfs/read_helper.c index ce11ca4c32e4..765e88ee132d 100644 --- a/fs/netfs/read_helper.c +++ b/fs/netfs/read_helper.c @@

[PATCH v4 08/28] netfs: Provide readahead and readpage netfs helpers

2021-03-10 Thread David Howells
Add a pair of helper functions: (*) netfs_readahead() (*) netfs_readpage() to do the work of handling a readahead or a readpage, where the page(s) that form part of the request may be split between the local cache, the server or just require clearing, and may be single pages and transparent