aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index a9befa50d3e3..e14b4c338b89 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -57,6 +57,18 @@ unsigned int kmem_cache_size(struct kmem_cache *);
57const char *kmem_cache_name(struct kmem_cache *); 57const char *kmem_cache_name(struct kmem_cache *);
58int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); 58int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
59 59
60/*
61 * Please use this macro to create slab caches. Simply specify the
62 * name of the structure and maybe some flags that are listed above.
63 *
64 * The alignment of the struct determines object alignment. If you
65 * f.e. add ____cacheline_aligned_in_smp to the struct declaration
66 * then the objects will be properly aligned in SMP configurations.
67 */
68#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
69 sizeof(struct __struct), __alignof__(struct __struct),\
70 (__flags), NULL, NULL)
71
60#ifdef CONFIG_NUMA 72#ifdef CONFIG_NUMA
61extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 73extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
62#else 74#else