summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2002-07-29 01:19:18 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-07-29 01:19:18 -0700
commite0126e6435c7d0f36e44bee5808397d7cca74627 (patch)
tree2ebfd763d19e80a00145e3a956979d644ff6ac7d /kernel
parent5ff53a14bff6e28e5ab6858d574e786296355e37 (diff)
[PATCH] implement kmem_cache_size()
Currently there is no way to find out the effective object size of a slab cache. XFS has lots of IRIX-derived code that want to do zalloc() style allocations on zones (which are implemented as slab caches in XFS/Linux) and thus needs to know about it. There are three ways do implement it: a) implement kmem_cache_zalloc b) make the xfs zone a struct of kmem_cache_t and a size variable c) implement kmem_cache_size The current XFS tree does a) but I absolutely don't like it as encourages people to use kmem_cache_zalloc for new code instead of thinking about how to utilize slab object reuse. b) would be easy, but I guess kmem_cache_size is usefull enough to get into the kernel. Here's the patch:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/ksyms.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index d427fdf94ca7..2cfdac0db08e 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -105,6 +105,7 @@ EXPORT_SYMBOL(kmem_cache_destroy);
EXPORT_SYMBOL(kmem_cache_shrink);
EXPORT_SYMBOL(kmem_cache_alloc);
EXPORT_SYMBOL(kmem_cache_free);
+EXPORT_SYMBOL(kmem_cache_size);
EXPORT_SYMBOL(kmalloc);
EXPORT_SYMBOL(kfree);
EXPORT_SYMBOL(vfree);