From 6501906280f8f244710012116ef678007999da67 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Thu, 10 Oct 2019 15:45:52 -0700 Subject: 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 Reviewed-by: Brian Behlendorf Reviewed-by: Jorgen Lundman Reviewed-by: Ryan Moeller Signed-off-by: Matt Macy Closes #9404 --- module/os/linux/spl/spl-kmem-cache.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'module/os/linux/spl') 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. */ -- cgit v1.2.3