diff options
author | Jeff Layton <jeff.layton@primarydata.com> | 2019-08-18 20:18:49 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2019-08-19 17:00:39 +0200 |
commit | b493523926f9b466db3c440ac64beb93d8068cdf (patch) | |
tree | 52702a39cfbae63c2d4ee1070b0fd3f597a05f1c /fs/nfsd/vfs.c | |
parent | nfsd: add a new struct file caching facility to nfsd (diff) | |
download | linux-b493523926f9b466db3c440ac64beb93d8068cdf.tar.xz linux-b493523926f9b466db3c440ac64beb93d8068cdf.zip |
nfsd: hook up nfsd_write to the new 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 '')
-rw-r--r-- | fs/nfsd/vfs.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 5983206ab036..2f5b52004a18 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -44,6 +44,7 @@ #include "nfsd.h" #include "vfs.h" +#include "filecache.h" #include "trace.h" #define NFSDDBG_FACILITY NFSDDBG_FILEOP @@ -1104,17 +1105,18 @@ __be32 nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, struct kvec *vec, int vlen, unsigned long *cnt, int stable) { - struct file *file = NULL; - __be32 err = 0; + struct nfsd_file *nf; + __be32 err; trace_nfsd_write_start(rqstp, fhp, offset, *cnt); - err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file); + err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_WRITE, &nf); if (err) goto out; - err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt, stable); - fput(file); + err = nfsd_vfs_write(rqstp, fhp, nf->nf_file, offset, vec, + vlen, cnt, stable); + nfsd_file_put(nf); out: trace_nfsd_write_done(rqstp, fhp, offset, *cnt); return err; |