@@ -21,6 +21,7 @@
static struct hlist_head * cache_hash;
static struct list_head lru_head;
static struct kmem_cache *drc_slab;
+static unsigned int num_drc_entries;
/*
* Calculate the hash index from an XID.
@@ -65,6 +66,7 @@ nfsd_reply_cache_free_locked(struct svc_cacherep *rp)
kfree(rp->c_replvec.iov_base);
hlist_del(&rp->c_hash);
list_del(&rp->c_lru);
+ --num_drc_entries;
kmem_cache_free(drc_slab, rp);
}
@@ -88,6 +90,7 @@ int nfsd_reply_cache_init(void)
goto out_nomem;
INIT_LIST_HEAD(&lru_head);
+ num_drc_entries = 0;
return 0;
out_nomem:
printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
@@ -257,6 +260,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
return RC_DOIT;
}
spin_lock(&cache_lock);
+ ++num_drc_entries;
/*
* Must search again just in case someone inserted one
Signed-off-by: Jeff Layton <jlayton@redhat.com> --- fs/nfsd/nfscache.c | 4 ++++ 1 file changed, 4 insertions(+)