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, 10 insertions, 2 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 2da8372519f5..59260e21bdf5 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -70,6 +70,11 @@
70#else 70#else
71# define SLAB_NOTRACK 0x00000000UL 71# define SLAB_NOTRACK 0x00000000UL
72#endif 72#endif
73#ifdef CONFIG_FAILSLAB
74# define SLAB_FAILSLAB 0x02000000UL /* Fault injection mark */
75#else
76# define SLAB_FAILSLAB 0x00000000UL
77#endif
73 78
74/* The following flags affect the page allocator grouping pages by mobility */ 79/* The following flags affect the page allocator grouping pages by mobility */
75#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ 80#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
@@ -101,6 +106,7 @@ int kmem_cache_shrink(struct kmem_cache *);
101void kmem_cache_free(struct kmem_cache *, void *); 106void kmem_cache_free(struct kmem_cache *, void *);
102unsigned int kmem_cache_size(struct kmem_cache *); 107unsigned int kmem_cache_size(struct kmem_cache *);
103const char *kmem_cache_name(struct kmem_cache *); 108const char *kmem_cache_name(struct kmem_cache *);
109int kern_ptr_validate(const void *ptr, unsigned long size);
104int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); 110int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
105 111
106/* 112/*
@@ -262,7 +268,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
262 * allocator where we care about the real place the memory allocation 268 * allocator where we care about the real place the memory allocation
263 * request comes from. 269 * request comes from.
264 */ 270 */
265#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) 271#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \
272 (defined(CONFIG_SLAB) && defined(CONFIG_TRACING))
266extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); 273extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
267#define kmalloc_track_caller(size, flags) \ 274#define kmalloc_track_caller(size, flags) \
268 __kmalloc_track_caller(size, flags, _RET_IP_) 275 __kmalloc_track_caller(size, flags, _RET_IP_)
@@ -280,7 +287,8 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
280 * standard allocator where we care about the real place the memory 287 * standard allocator where we care about the real place the memory
281 * allocation request comes from. 288 * allocation request comes from.
282 */ 289 */
283#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) 290#if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) || \
291 (defined(CONFIG_SLAB) && defined(CONFIG_TRACING))
284extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long); 292extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long);
285#define kmalloc_node_track_caller(size, flags, node) \ 293#define kmalloc_node_track_caller(size, flags, node) \
286 __kmalloc_node_track_caller(size, flags, node, \ 294 __kmalloc_node_track_caller(size, flags, node, \