Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFSD: Clean up nfsd_splice_actor()

nfsd_splice_actor() checks that the page being spliced does not
match the previous element in the svc_rqst::rq_pages array. We
believe this is to prevent a double put_page() in cases where the
READ payload is partially contained in the xdr_buf's head buffer.

However, the NFSD READ proc functions no longer place any part of
the READ payload in the head buffer, in order to properly support
NFS/RDMA READ with Write chunks. Therefore, simplify the logic in
nfsd_splice_actor() to remove this unnecessary check.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+2 -8
+2 -8
fs/nfsd/vfs.c
··· 849 849 struct splice_desc *sd) 850 850 { 851 851 struct svc_rqst *rqstp = sd->u.data; 852 - struct page **pp = rqstp->rq_next_page; 853 - struct page *page = buf->page; 854 852 855 - if (rqstp->rq_res.page_len == 0) { 856 - svc_rqst_replace_page(rqstp, page); 853 + svc_rqst_replace_page(rqstp, buf->page); 854 + if (rqstp->rq_res.page_len == 0) 857 855 rqstp->rq_res.page_base = buf->offset; 858 - } else if (page != pp[-1]) { 859 - svc_rqst_replace_page(rqstp, page); 860 - } 861 856 rqstp->rq_res.page_len += sd->len; 862 - 863 857 return sd->len; 864 858 } 865 859