]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFSD: Use rqstp->rq_bvec in nfsd_iter_write()
authorChuck Lever <chuck.lever@oracle.com>
Tue, 6 May 2025 20:42:25 +0000 (16:42 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 15 May 2025 20:16:24 +0000 (16:16 -0400)
If we can get rid of all uses of rq_vec, then it can be removed.
Replace one use of rqstp::rq_vec with rqstp::rq_bvec.

The feeling of layering violation grows stronger now that
<linux/sunrpc/xdr.h> is included in fs/nfsd/vfs.c.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/vfs.c

index 43ecc5ae0c3f12af0fa49b1c29a6235a5ad78587..fac53cd145e78f35689df438cbcd482416a20d4d 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/exportfs.h>
 #include <linux/writeback.h>
 #include <linux/security.h>
+#include <linux/sunrpc/xdr.h>
 
 #include "xdr3.h"
 
@@ -1206,8 +1207,8 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,
        if (stable && !fhp->fh_use_wgather)
                flags |= RWF_SYNC;
 
-       nvecs = svc_fill_write_vector(rqstp, payload);
-       iov_iter_kvec(&iter, ITER_SOURCE, rqstp->rq_vec, nvecs, *cnt);
+       nvecs = xdr_buf_to_bvec(rqstp->rq_bvec, rqstp->rq_maxpages, payload);
+       iov_iter_bvec(&iter, ITER_SOURCE, rqstp->rq_bvec, nvecs, *cnt);
        since = READ_ONCE(file->f_wb_err);
        if (verf)
                nfsd_copy_write_verifier(verf, nn);