diff options
author | Jeff Layton <jeff.layton@primarydata.com> | 2019-08-18 14:18:50 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2019-08-19 11:00:40 -0400 |
commit | 48cd7b51258c1a158293cefb97dda988080f5e13 (patch) | |
tree | 18eb01d6f664181f5733ff512c9349ba44b59d5d /fs/nfsd/vfs.c | |
parent | b493523926f9b466db3c440ac64beb93d8068cdf (diff) |
nfsd: hook up nfsd_read to the nfsd_file cache
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 2f5b52004a18..8593c6423336 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1071,25 +1071,22 @@ out_nfserr: | |||
1071 | __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, | 1071 | __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, |
1072 | loff_t offset, struct kvec *vec, int vlen, unsigned long *count) | 1072 | loff_t offset, struct kvec *vec, int vlen, unsigned long *count) |
1073 | { | 1073 | { |
1074 | struct nfsd_file *nf; | ||
1074 | struct file *file; | 1075 | struct file *file; |
1075 | struct raparms *ra; | ||
1076 | __be32 err; | 1076 | __be32 err; |
1077 | 1077 | ||
1078 | trace_nfsd_read_start(rqstp, fhp, offset, *count); | 1078 | trace_nfsd_read_start(rqstp, fhp, offset, *count); |
1079 | err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); | 1079 | err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_READ, &nf); |
1080 | if (err) | 1080 | if (err) |
1081 | return err; | 1081 | return err; |
1082 | 1082 | ||
1083 | ra = nfsd_init_raparms(file); | 1083 | file = nf->nf_file; |
1084 | |||
1085 | if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags)) | 1084 | if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags)) |
1086 | err = nfsd_splice_read(rqstp, fhp, file, offset, count); | 1085 | err = nfsd_splice_read(rqstp, fhp, file, offset, count); |
1087 | else | 1086 | else |
1088 | err = nfsd_readv(rqstp, fhp, file, offset, vec, vlen, count); | 1087 | err = nfsd_readv(rqstp, fhp, file, offset, vec, vlen, count); |
1089 | 1088 | ||
1090 | if (ra) | 1089 | nfsd_file_put(nf); |
1091 | nfsd_put_raparams(file, ra); | ||
1092 | fput(file); | ||
1093 | 1090 | ||
1094 | trace_nfsd_read_done(rqstp, fhp, offset, *count); | 1091 | trace_nfsd_read_done(rqstp, fhp, offset, *count); |
1095 | 1092 | ||