summaryrefslogtreecommitdiffstats
path: root/module/os/linux
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-10-10 15:45:52 -0700
committerBrian Behlendorf <[email protected]>2019-10-10 15:45:52 -0700
commit6501906280f8f244710012116ef678007999da67 (patch)
treef615c1cba36cdcefd917972e0ab038889b17fb13 /module/os/linux
parenteedb3a62b9f16b989aa02d00db63de5dff200572 (diff)
Add kmem cache accessors
Make the metaslab platform agnostic again by adding accessor functions which can be implemented by each platform. Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9404
Diffstat (limited to 'module/os/linux')
-rw-r--r--module/os/linux/spl/spl-kmem-cache.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/module/os/linux/spl/spl-kmem-cache.c b/module/os/linux/spl/spl-kmem-cache.c
index b39867b03..853cf33f0 100644
--- a/module/os/linux/spl/spl-kmem-cache.c
+++ b/module/os/linux/spl/spl-kmem-cache.c
@@ -257,6 +257,20 @@ spl_obj_size(spl_kmem_cache_t *skc)
P2ROUNDUP_TYPED(sizeof (spl_kmem_obj_t), align, uint32_t));
}
+uint64_t
+spl_kmem_cache_inuse(kmem_cache_t *cache)
+{
+ return (cache->skc_obj_total);
+}
+EXPORT_SYMBOL(spl_kmem_cache_inuse);
+
+uint64_t
+spl_kmem_cache_entry_size(kmem_cache_t *cache)
+{
+ return (cache->skc_obj_size);
+}
+EXPORT_SYMBOL(spl_kmem_cache_entry_size);
+
/*
* Lookup the spl_kmem_object_t for an object given that object.
*/