diff options
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r-- | include/linux/slab.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h index 67d5d94b783a..0dd2dfa7beca 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -93,6 +93,30 @@ | |||
93 | (unsigned long)ZERO_SIZE_PTR) | 93 | (unsigned long)ZERO_SIZE_PTR) |
94 | 94 | ||
95 | /* | 95 | /* |
96 | * Common fields provided in kmem_cache by all slab allocators | ||
97 | * This struct is either used directly by the allocator (SLOB) | ||
98 | * or the allocator must include definitions for all fields | ||
99 | * provided in kmem_cache_common in their definition of kmem_cache. | ||
100 | * | ||
101 | * Once we can do anonymous structs (C11 standard) we could put a | ||
102 | * anonymous struct definition in these allocators so that the | ||
103 | * separate allocations in the kmem_cache structure of SLAB and | ||
104 | * SLUB is no longer needed. | ||
105 | */ | ||
106 | #ifdef CONFIG_SLOB | ||
107 | struct kmem_cache { | ||
108 | unsigned int object_size;/* The original size of the object */ | ||
109 | unsigned int size; /* The aligned/padded/added on size */ | ||
110 | unsigned int align; /* Alignment as calculated */ | ||
111 | unsigned long flags; /* Active flags on the slab */ | ||
112 | const char *name; /* Slab name for sysfs */ | ||
113 | int refcount; /* Use counter */ | ||
114 | void (*ctor)(void *); /* Called on object slot creation */ | ||
115 | struct list_head list; /* List of all slab caches on the system */ | ||
116 | }; | ||
117 | #endif | ||
118 | |||
119 | /* | ||
96 | * struct kmem_cache related prototypes | 120 | * struct kmem_cache related prototypes |
97 | */ | 121 | */ |
98 | void __init kmem_cache_init(void); | 122 | void __init kmem_cache_init(void); |