Commit 2c445a0e authored by Chuck Lever's avatar Chuck Lever

NFSD: De-duplicate net_generic(nf->nf_net, nfsd_net_id)

Since this pointer is used repeatedly, move it to a stack variable.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent fb7622c2
...@@ -1103,6 +1103,7 @@ __be32 ...@@ -1103,6 +1103,7 @@ __be32
nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
loff_t offset, unsigned long count, __be32 *verf) loff_t offset, unsigned long count, __be32 *verf)
{ {
struct nfsd_net *nn;
struct nfsd_file *nf; struct nfsd_file *nf;
loff_t end = LLONG_MAX; loff_t end = LLONG_MAX;
__be32 err = nfserr_inval; __be32 err = nfserr_inval;
...@@ -1119,6 +1120,7 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1119,6 +1120,7 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
NFSD_MAY_WRITE|NFSD_MAY_NOT_BREAK_LEASE, &nf); NFSD_MAY_WRITE|NFSD_MAY_NOT_BREAK_LEASE, &nf);
if (err) if (err)
goto out; goto out;
nn = net_generic(nf->nf_net, nfsd_net_id);
if (EX_ISSYNC(fhp->fh_export)) { if (EX_ISSYNC(fhp->fh_export)) {
errseq_t since = READ_ONCE(nf->nf_file->f_wb_err); errseq_t since = READ_ONCE(nf->nf_file->f_wb_err);
int err2; int err2;
...@@ -1126,8 +1128,7 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1126,8 +1128,7 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
err2 = vfs_fsync_range(nf->nf_file, offset, end, 0); err2 = vfs_fsync_range(nf->nf_file, offset, end, 0);
switch (err2) { switch (err2) {
case 0: case 0:
nfsd_copy_boot_verifier(verf, net_generic(nf->nf_net, nfsd_copy_boot_verifier(verf, nn);
nfsd_net_id));
err2 = filemap_check_wb_err(nf->nf_file->f_mapping, err2 = filemap_check_wb_err(nf->nf_file->f_mapping,
since); since);
break; break;
...@@ -1135,13 +1136,11 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1135,13 +1136,11 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
err = nfserr_notsupp; err = nfserr_notsupp;
break; break;
default: default:
nfsd_reset_boot_verifier(net_generic(nf->nf_net, nfsd_reset_boot_verifier(nn);
nfsd_net_id));
} }
err = nfserrno(err2); err = nfserrno(err2);
} else } else
nfsd_copy_boot_verifier(verf, net_generic(nf->nf_net, nfsd_copy_boot_verifier(verf, nn);
nfsd_net_id));
nfsd_file_put(nf); nfsd_file_put(nf);
out: out:
......
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