Skip to content

Commit

Permalink
nfsd: hook up nfsd_write to the new nfsd_file cache
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Aug 19, 2019
1 parent 65294c1 commit b493523
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#include "nfsd.h"
#include "vfs.h"
#include "filecache.h"
#include "trace.h"

#define NFSDDBG_FACILITY NFSDDBG_FILEOP
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b493523

Please sign in to comment.