summaryrefslogtreecommitdiff
path: root/fs/nfsd/netns.h
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2019-05-17 09:03:38 -0400
committerJ. Bruce Fields <bfields@redhat.com>2019-07-03 17:52:08 -0400
commit3ba75830ce175550ef45c6524ec62faab8f62c1b (patch)
tree1ba1eb10a0500a75b3b5f568a75b1bf68bf6d343 /fs/nfsd/netns.h
parentb401170f6d9cd4270e0159d9b016f4ccb06caa85 (diff)
nfsd4: drc containerization
The nfsd duplicate reply cache should not be shared between network namespaces. The most straightforward way to fix this is just to move every global in the code to per-net-namespace memory, so that's what we do. Still todo: sort out which members of nfsd_stats should be global and which per-net-namespace. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/netns.h')
-rw-r--r--fs/nfsd/netns.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h
index 7c686a270d60..46240c4d9184 100644
--- a/fs/nfsd/netns.h
+++ b/fs/nfsd/netns.h
@@ -127,6 +127,41 @@ struct nfsd_net {
*/
bool *nfsd_versions;
bool *nfsd4_minorversions;
+
+ /*
+ * Duplicate reply cache
+ */
+ struct nfsd_drc_bucket *drc_hashtbl;
+ struct kmem_cache *drc_slab;
+
+ /* max number of entries allowed in the cache */
+ unsigned int max_drc_entries;
+
+ /* number of significant bits in the hash value */
+ unsigned int maskbits;
+ unsigned int drc_hashsize;
+
+ /*
+ * Stats and other tracking of on the duplicate reply cache. All of these and
+ * the "rc" fields in nfsdstats are protected by the cache_lock
+ */
+
+ /* total number of entries */
+ atomic_t num_drc_entries;
+
+ /* cache misses due only to checksum comparison failures */
+ unsigned int payload_misses;
+
+ /* amount of memory (in bytes) currently consumed by the DRC */
+ unsigned int drc_mem_usage;
+
+ /* longest hash chain seen */
+ unsigned int longest_chain;
+
+ /* size of cache when we saw the longest hash chain */
+ unsigned int longest_chain_cachesize;
+
+ struct shrinker nfsd_reply_cache_shrinker;
};
/* Simple check to find out if a given net was properly initialized */