mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
f8a101ff09
commit
76fa884290
2 changed files with 6 additions and 6 deletions
|
@ -223,7 +223,7 @@ struct svc_rqst {
|
||||||
struct page * *rq_next_page; /* next reply page to use */
|
struct page * *rq_next_page; /* next reply page to use */
|
||||||
struct page * *rq_page_end; /* one past the last page */
|
struct page * *rq_page_end; /* one past the last page */
|
||||||
|
|
||||||
struct pagevec rq_pvec;
|
struct folio_batch rq_fbatch;
|
||||||
struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */
|
struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */
|
||||||
struct bio_vec rq_bvec[RPCSVC_MAXPAGES];
|
struct bio_vec rq_bvec[RPCSVC_MAXPAGES];
|
||||||
|
|
||||||
|
|
|
@ -649,7 +649,7 @@ svc_rqst_alloc(struct svc_serv *serv, struct svc_pool *pool, int node)
|
||||||
if (!rqstp)
|
if (!rqstp)
|
||||||
return rqstp;
|
return rqstp;
|
||||||
|
|
||||||
pagevec_init(&rqstp->rq_pvec);
|
folio_batch_init(&rqstp->rq_fbatch);
|
||||||
|
|
||||||
__set_bit(RQ_BUSY, &rqstp->rq_flags);
|
__set_bit(RQ_BUSY, &rqstp->rq_flags);
|
||||||
rqstp->rq_server = serv;
|
rqstp->rq_server = serv;
|
||||||
|
@ -860,9 +860,9 @@ bool svc_rqst_replace_page(struct svc_rqst *rqstp, struct page *page)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*rqstp->rq_next_page) {
|
if (*rqstp->rq_next_page) {
|
||||||
if (!pagevec_space(&rqstp->rq_pvec))
|
if (!folio_batch_add(&rqstp->rq_fbatch,
|
||||||
__pagevec_release(&rqstp->rq_pvec);
|
page_folio(*rqstp->rq_next_page)))
|
||||||
pagevec_add(&rqstp->rq_pvec, *rqstp->rq_next_page);
|
__folio_batch_release(&rqstp->rq_fbatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
get_page(page);
|
get_page(page);
|
||||||
|
@ -896,7 +896,7 @@ void svc_rqst_release_pages(struct svc_rqst *rqstp)
|
||||||
void
|
void
|
||||||
svc_rqst_free(struct svc_rqst *rqstp)
|
svc_rqst_free(struct svc_rqst *rqstp)
|
||||||
{
|
{
|
||||||
pagevec_release(&rqstp->rq_pvec);
|
folio_batch_release(&rqstp->rq_fbatch);
|
||||||
svc_release_buffer(rqstp);
|
svc_release_buffer(rqstp);
|
||||||
if (rqstp->rq_scratch_page)
|
if (rqstp->rq_scratch_page)
|
||||||
put_page(rqstp->rq_scratch_page);
|
put_page(rqstp->rq_scratch_page);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue