mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 15:19:51 +00:00
NFSD: De-duplicate net_generic(SVC_NET(rqstp), nfsd_net_id)
Since this pointer is used repeatedly, move it to a stack variable. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
33388b3aef
commit
fb7622c2db
@ -954,6 +954,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
|
|||||||
unsigned long *cnt, int stable,
|
unsigned long *cnt, int stable,
|
||||||
__be32 *verf)
|
__be32 *verf)
|
||||||
{
|
{
|
||||||
|
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
|
||||||
struct file *file = nf->nf_file;
|
struct file *file = nf->nf_file;
|
||||||
struct super_block *sb = file_inode(file)->i_sb;
|
struct super_block *sb = file_inode(file)->i_sb;
|
||||||
struct svc_export *exp;
|
struct svc_export *exp;
|
||||||
@ -998,13 +999,10 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
|
|||||||
iov_iter_kvec(&iter, WRITE, vec, vlen, *cnt);
|
iov_iter_kvec(&iter, WRITE, vec, vlen, *cnt);
|
||||||
since = READ_ONCE(file->f_wb_err);
|
since = READ_ONCE(file->f_wb_err);
|
||||||
if (verf)
|
if (verf)
|
||||||
nfsd_copy_boot_verifier(verf,
|
nfsd_copy_boot_verifier(verf, nn);
|
||||||
net_generic(SVC_NET(rqstp),
|
|
||||||
nfsd_net_id));
|
|
||||||
host_err = vfs_iter_write(file, &iter, &pos, flags);
|
host_err = vfs_iter_write(file, &iter, &pos, flags);
|
||||||
if (host_err < 0) {
|
if (host_err < 0) {
|
||||||
nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp),
|
nfsd_reset_boot_verifier(nn);
|
||||||
nfsd_net_id));
|
|
||||||
goto out_nfserr;
|
goto out_nfserr;
|
||||||
}
|
}
|
||||||
*cnt = host_err;
|
*cnt = host_err;
|
||||||
@ -1017,8 +1015,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
|
|||||||
if (stable && use_wgather) {
|
if (stable && use_wgather) {
|
||||||
host_err = wait_for_concurrent_writes(file);
|
host_err = wait_for_concurrent_writes(file);
|
||||||
if (host_err < 0)
|
if (host_err < 0)
|
||||||
nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp),
|
nfsd_reset_boot_verifier(nn);
|
||||||
nfsd_net_id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out_nfserr:
|
out_nfserr:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user