From: Jeff Layton Date: Tue, 20 Oct 2015 17:33:46 +0000 (-0400) Subject: nfsd: hook up nfsd_read to the nfsd_file cache X-Git-Tag: KARO-TX6UL-2015-11-03~110^2~10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d61c29295bca8e418590ebf6a961ddcf557a7c4c;p=karo-tx-linux.git nfsd: hook up nfsd_read to the nfsd_file cache Signed-off-by: Jeff Layton Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index bd015974bffe..688e45fc5ddf 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1002,20 +1002,15 @@ out_nfserr: __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, struct kvec *vec, int vlen, unsigned long *count) { - struct file *file; - struct raparms *ra; - __be32 err; - - err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); - if (err) - return err; - - ra = nfsd_init_raparms(file); - err = nfsd_vfs_read(rqstp, file, offset, vec, vlen, count); - if (ra) - nfsd_put_raparams(file, ra); - fput(file); + __be32 err; + struct nfsd_file *nf; + err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_READ, &nf); + if (err == nfs_ok) { + err = nfsd_vfs_read(rqstp, nf->nf_file, offset, vec, vlen, + count); + nfsd_file_put(nf); + } return err; }