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

Configure Feed

Select the types of activity you want to include in your feed.

NFSD: pass nfsd_file to nfsd_iter_read()

Prepare for nfsd_iter_read() to use the DIO alignment stored in
nfsd_file by passing the nfsd_file to nfsd_iter_read() rather than
just the file which is associaed with the nfsd_file.

This means nfsd4_encode_readv() now also needs the nfsd_file rather
than the file. Instead of changing the file arg to be the nfsd_file,
we discard the file arg as the nfsd_file (and indeed the file) is
already available via the "read" argument.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: NeilBrown <neil@brown.name>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Mike Snitzer and committed by
Chuck Lever
803bc849 cc6c40e0

+9 -8
+4 -4
fs/nfsd/nfs4xdr.c
··· 4472 4472 4473 4473 static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, 4474 4474 struct nfsd4_read *read, 4475 - struct file *file, unsigned long maxcount) 4475 + unsigned long maxcount) 4476 4476 { 4477 4477 struct xdr_stream *xdr = resp->xdr; 4478 4478 unsigned int base = xdr->buf->page_len & ~PAGE_MASK; ··· 4483 4483 if (xdr_reserve_space_vec(xdr, maxcount) < 0) 4484 4484 return nfserr_resource; 4485 4485 4486 - nfserr = nfsd_iter_read(resp->rqstp, read->rd_fhp, file, 4486 + nfserr = nfsd_iter_read(resp->rqstp, read->rd_fhp, read->rd_nf, 4487 4487 read->rd_offset, &maxcount, base, 4488 4488 &read->rd_eof); 4489 4489 read->rd_length = maxcount; ··· 4530 4530 if (file->f_op->splice_read && splice_ok) 4531 4531 nfserr = nfsd4_encode_splice_read(resp, read, file, maxcount); 4532 4532 else 4533 - nfserr = nfsd4_encode_readv(resp, read, file, maxcount); 4533 + nfserr = nfsd4_encode_readv(resp, read, maxcount); 4534 4534 if (nfserr) { 4535 4535 xdr_truncate_encode(xdr, eof_offset); 4536 4536 return nfserr; ··· 5426 5426 if (file->f_op->splice_read && splice_ok) 5427 5427 nfserr = nfsd4_encode_splice_read(resp, read, file, maxcount); 5428 5428 else 5429 - nfserr = nfsd4_encode_readv(resp, read, file, maxcount); 5429 + nfserr = nfsd4_encode_readv(resp, read, maxcount); 5430 5430 if (nfserr) 5431 5431 return nfserr; 5432 5432
+4 -3
fs/nfsd/vfs.c
··· 1078 1078 * nfsd_iter_read - Perform a VFS read using an iterator 1079 1079 * @rqstp: RPC transaction context 1080 1080 * @fhp: file handle of file to be read 1081 - * @file: opened struct file of file to be read 1081 + * @nf: opened struct nfsd_file of file to be read 1082 1082 * @offset: starting byte offset 1083 1083 * @count: IN: requested number of bytes; OUT: number of bytes read 1084 1084 * @base: offset in first page of read buffer ··· 1091 1091 * returned. 1092 1092 */ 1093 1093 __be32 nfsd_iter_read(struct svc_rqst *rqstp, struct svc_fh *fhp, 1094 - struct file *file, loff_t offset, unsigned long *count, 1094 + struct nfsd_file *nf, loff_t offset, unsigned long *count, 1095 1095 unsigned int base, u32 *eof) 1096 1096 { 1097 + struct file *file = nf->nf_file; 1097 1098 unsigned long v, total; 1098 1099 struct iov_iter iter; 1099 1100 struct kiocb kiocb; ··· 1337 1336 if (file->f_op->splice_read && nfsd_read_splice_ok(rqstp)) 1338 1337 err = nfsd_splice_read(rqstp, fhp, file, offset, count, eof); 1339 1338 else 1340 - err = nfsd_iter_read(rqstp, fhp, file, offset, count, 0, eof); 1339 + err = nfsd_iter_read(rqstp, fhp, nf, offset, count, 0, eof); 1341 1340 1342 1341 nfsd_file_put(nf); 1343 1342 trace_nfsd_read_done(rqstp, fhp, offset, *count);
+1 -1
fs/nfsd/vfs.h
··· 121 121 unsigned long *count, 122 122 u32 *eof); 123 123 __be32 nfsd_iter_read(struct svc_rqst *rqstp, struct svc_fh *fhp, 124 - struct file *file, loff_t offset, 124 + struct nfsd_file *nf, loff_t offset, 125 125 unsigned long *count, unsigned int base, 126 126 u32 *eof); 127 127 bool nfsd_read_splice_ok(struct svc_rqst *rqstp);