Skip to content

Commit 37fe6f1

Browse files
committed
NFSD: Use vfs_iocb_iter_read()
Refactor: Enable the use of IOCB flags to control NFSD's individual read operations (when not using splice). This allows the eventual use of atomic, uncached, direct, or asynchronous reads. Suggested-by: Christoph Hellwig <hch@infradead.org> Reviewed-by: NeilBrown <neil@brown.name> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 61df439 commit 37fe6f1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

fs/nfsd/vfs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,10 +1086,13 @@ __be32 nfsd_iter_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
10861086
{
10871087
unsigned long v, total;
10881088
struct iov_iter iter;
1089-
loff_t ppos = offset;
1089+
struct kiocb kiocb;
10901090
ssize_t host_err;
10911091
size_t len;
10921092

1093+
init_sync_kiocb(&kiocb, file);
1094+
kiocb.ki_pos = offset;
1095+
10931096
v = 0;
10941097
total = *count;
10951098
while (total) {
@@ -1104,7 +1107,7 @@ __be32 nfsd_iter_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
11041107

11051108
trace_nfsd_read_vector(rqstp, fhp, offset, *count);
11061109
iov_iter_bvec(&iter, ITER_DEST, rqstp->rq_bvec, v, *count);
1107-
host_err = vfs_iter_read(file, &iter, &ppos, 0);
1110+
host_err = vfs_iocb_iter_read(file, &kiocb, &iter);
11081111
return nfsd_finish_read(rqstp, fhp, file, offset, count, eof, host_err);
11091112
}
11101113

0 commit comments

Comments
 (0)