Re: [PATCH v3 3/5] nfs: Introduce nfs_release_request_list helper

From: Pranjal Shrivastava

Date: Mon Jul 20 2026 - 10:27:27 EST


On Mon, Jul 20, 2026 at 11:15:05AM +0200, Christoph Hellwig wrote:
> On Wed, Jul 15, 2026 at 02:35:38PM +0000, Pranjal Shrivastava wrote:
> > Introduce a centralized helper, nfs_release_request_list, to handle
> > the bulk release of nfs_page requests from a list.
> >
> > This serves as a preparatory step for two upcoming improvements:
> >
> > 1. Pin-Aware Cleanup: As we migrate to iov_iter_extract_* API,
> > requests will hold pins (GUP) instead of standard references. The
> > helper ensures that the correct unpinning logic gets applied
> > consistently across all requests in a list.
> >
> > 2. Folio Support: In subsequent patches where nfs_page structures
> > will cover multi-page folios, this helper provides a clean
> > infrastructure to unlock these larger units of I/O in bulk during
> > completion, similat to the pattern in bio_release_pages.
> >
> > Additionally, refactor nfs_read_sync_pgio_error() to utilize this new
> > helper.
> >

[...]

> > +/*
> > + * nfs_release_request_list - Release a list of NFS read/write requests
> > + * @head: list of requests to release
> > + *
> > + * Removes each request from the list and drops it's refcount.
> > + */
> > +void nfs_release_request_list(struct list_head *head)
> > +{
> > + struct nfs_page *req;
> > +
> > + while (!list_empty(head)) {
> > + req = nfs_list_entry(head->next);
>
> req could/should be local here. Or you switch to list_first_or_null,
> which some folks prefer.
>

Ack. Made it local

> > +extern void nfs_release_request(struct nfs_page *req);
> > +extern void nfs_release_request_list(struct list_head *head);
>
> Please drop the superflous externs for new code.
>

Ack. Dropping the externs.

Thanks,
Praan