Commit b4935239 authored by Jeff Layton's avatar Jeff Layton Committed by J. Bruce Fields

nfsd: hook up nfsd_write to the new nfsd_file cache

Signed-off-by: default avatarJeff Layton <jeff.layton@primarydata.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 65294c1f
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "nfsd.h" #include "nfsd.h"
#include "vfs.h" #include "vfs.h"
#include "filecache.h"
#include "trace.h" #include "trace.h"
#define NFSDDBG_FACILITY NFSDDBG_FILEOP #define NFSDDBG_FACILITY NFSDDBG_FILEOP
...@@ -1104,17 +1105,18 @@ __be32 ...@@ -1104,17 +1105,18 @@ __be32
nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
struct kvec *vec, int vlen, unsigned long *cnt, int stable) struct kvec *vec, int vlen, unsigned long *cnt, int stable)
{ {
struct file *file = NULL; struct nfsd_file *nf;
__be32 err = 0; __be32 err;
trace_nfsd_write_start(rqstp, fhp, offset, *cnt); 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) if (err)
goto out; goto out;
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt, stable); err = nfsd_vfs_write(rqstp, fhp, nf->nf_file, offset, vec,
fput(file); vlen, cnt, stable);
nfsd_file_put(nf);
out: out:
trace_nfsd_write_done(rqstp, fhp, offset, *cnt); trace_nfsd_write_done(rqstp, fhp, offset, *cnt);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment