Commit 0f29ce32 authored by Chuck Lever's avatar Chuck Lever

NFSD: Skip extra computation for RC_NOCACHE case

Force the compiler to skip unneeded initialization for cases that
don't need those values. For example, NFSv4 COMPOUND operations are
RC_NOCACHE.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 378a6109
...@@ -421,10 +421,10 @@ nfsd_cache_insert(struct nfsd_drc_bucket *b, struct svc_cacherep *key, ...@@ -421,10 +421,10 @@ nfsd_cache_insert(struct nfsd_drc_bucket *b, struct svc_cacherep *key,
*/ */
int nfsd_cache_lookup(struct svc_rqst *rqstp) int nfsd_cache_lookup(struct svc_rqst *rqstp)
{ {
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); struct nfsd_net *nn;
struct svc_cacherep *rp, *found; struct svc_cacherep *rp, *found;
__wsum csum; __wsum csum;
struct nfsd_drc_bucket *b = nfsd_cache_bucket_find(rqstp->rq_xid, nn); struct nfsd_drc_bucket *b;
int type = rqstp->rq_cachetype; int type = rqstp->rq_cachetype;
int rtn = RC_DOIT; int rtn = RC_DOIT;
...@@ -440,10 +440,12 @@ int nfsd_cache_lookup(struct svc_rqst *rqstp) ...@@ -440,10 +440,12 @@ int nfsd_cache_lookup(struct svc_rqst *rqstp)
* Since the common case is a cache miss followed by an insert, * Since the common case is a cache miss followed by an insert,
* preallocate an entry. * preallocate an entry.
*/ */
nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
rp = nfsd_reply_cache_alloc(rqstp, csum, nn); rp = nfsd_reply_cache_alloc(rqstp, csum, nn);
if (!rp) if (!rp)
goto out; goto out;
b = nfsd_cache_bucket_find(rqstp->rq_xid, nn);
spin_lock(&b->cache_lock); spin_lock(&b->cache_lock);
found = nfsd_cache_insert(b, rp, nn); found = nfsd_cache_insert(b, rp, nn);
if (found != rp) { if (found != rp) {
......
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