Skip to content

Commit 76fa884

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
net: convert sunrpc from pagevec to folio_batch
Remove the last usage of pagevecs. There is a slight change here; we now free the folio_batch as soon as it fills up instead of freeing the folio_batch when we try to add a page to a full batch. This should have no effect in practice. Link: https://lkml.kernel.org/r/20230621164557.3510324-10-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent f8a101f commit 76fa884

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

include/linux/sunrpc/svc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ struct svc_rqst {
223223
struct page * *rq_next_page; /* next reply page to use */
224224
struct page * *rq_page_end; /* one past the last page */
225225

226-
struct pagevec rq_pvec;
226+
struct folio_batch rq_fbatch;
227227
struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */
228228
struct bio_vec rq_bvec[RPCSVC_MAXPAGES];
229229

net/sunrpc/svc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ svc_rqst_alloc(struct svc_serv *serv, struct svc_pool *pool, int node)
649649
if (!rqstp)
650650
return rqstp;
651651

652-
pagevec_init(&rqstp->rq_pvec);
652+
folio_batch_init(&rqstp->rq_fbatch);
653653

654654
__set_bit(RQ_BUSY, &rqstp->rq_flags);
655655
rqstp->rq_server = serv;
@@ -860,9 +860,9 @@ bool svc_rqst_replace_page(struct svc_rqst *rqstp, struct page *page)
860860
}
861861

862862
if (*rqstp->rq_next_page) {
863-
if (!pagevec_space(&rqstp->rq_pvec))
864-
__pagevec_release(&rqstp->rq_pvec);
865-
pagevec_add(&rqstp->rq_pvec, *rqstp->rq_next_page);
863+
if (!folio_batch_add(&rqstp->rq_fbatch,
864+
page_folio(*rqstp->rq_next_page)))
865+
__folio_batch_release(&rqstp->rq_fbatch);
866866
}
867867

868868
get_page(page);
@@ -896,7 +896,7 @@ void svc_rqst_release_pages(struct svc_rqst *rqstp)
896896
void
897897
svc_rqst_free(struct svc_rqst *rqstp)
898898
{
899-
pagevec_release(&rqstp->rq_pvec);
899+
folio_batch_release(&rqstp->rq_fbatch);
900900
svc_release_buffer(rqstp);
901901
if (rqstp->rq_scratch_page)
902902
put_page(rqstp->rq_scratch_page);

0 commit comments

Comments
 (0)