--- include/linux/slab.h | 1 + mm/slub.c | 10 ++++++++++ 2 files changed, 11 insertions(+) Index: slub/include/linux/slab.h =================================================================== --- slub.orig/include/linux/slab.h 2007-05-18 18:23:47.000000000 -0700 +++ slub/include/linux/slab.h 2007-05-18 18:26:53.000000000 -0700 @@ -82,6 +82,7 @@ void *kmem_cache_zalloc(struct kmem_cach void kmem_cache_free(struct kmem_cache *, void *); unsigned int kmem_cache_size(struct kmem_cache *); const char *kmem_cache_name(struct kmem_cache *); +struct kmem_cache *kmem_cache_slab(const void *); int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); int kmem_cache_vacate(struct page *); Index: slub/mm/slub.c =================================================================== --- slub.orig/mm/slub.c 2007-05-18 18:24:08.000000000 -0700 +++ slub/mm/slub.c 2007-05-18 18:26:29.000000000 -0700 @@ -2086,6 +2086,16 @@ const char *kmem_cache_name(struct kmem_ } EXPORT_SYMBOL(kmem_cache_name); +struct kmem_cache *kmem_cache_slab(const void *object) +{ + struct page *page = get_object_page(object); + + if (page) + return page->slab; + + return NULL; +} + /* * Attempt to free all slabs on a node. Return the number of slabs we * were unable to free.