diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -193,8 +193,10 @@ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s) | |||
193 | #define MAX_OBJS_PER_PAGE 32767 /* since page.objects is u15 */ | 193 | #define MAX_OBJS_PER_PAGE 32767 /* since page.objects is u15 */ |
194 | 194 | ||
195 | /* Internal SLUB flags */ | 195 | /* Internal SLUB flags */ |
196 | #define __OBJECT_POISON 0x80000000UL /* Poison object */ | 196 | /* Poison object */ |
197 | #define __CMPXCHG_DOUBLE 0x40000000UL /* Use cmpxchg_double */ | 197 | #define __OBJECT_POISON ((slab_flags_t __force)0x80000000UL) |
198 | /* Use cmpxchg_double */ | ||
199 | #define __CMPXCHG_DOUBLE ((slab_flags_t __force)0x40000000UL) | ||
198 | 200 | ||
199 | /* | 201 | /* |
200 | * Tracking user of a slab. | 202 | * Tracking user of a slab. |
@@ -485,9 +487,9 @@ static inline void *restore_red_left(struct kmem_cache *s, void *p) | |||
485 | * Debug settings: | 487 | * Debug settings: |
486 | */ | 488 | */ |
487 | #if defined(CONFIG_SLUB_DEBUG_ON) | 489 | #if defined(CONFIG_SLUB_DEBUG_ON) |
488 | static int slub_debug = DEBUG_DEFAULT_FLAGS; | 490 | static slab_flags_t slub_debug = DEBUG_DEFAULT_FLAGS; |
489 | #else | 491 | #else |
490 | static int slub_debug; | 492 | static slab_flags_t slub_debug; |
491 | #endif | 493 | #endif |
492 | 494 | ||
493 | static char *slub_debug_slabs; | 495 | static char *slub_debug_slabs; |
@@ -1289,8 +1291,8 @@ out: | |||
1289 | 1291 | ||
1290 | __setup("slub_debug", setup_slub_debug); | 1292 | __setup("slub_debug", setup_slub_debug); |
1291 | 1293 | ||
1292 | unsigned long kmem_cache_flags(unsigned long object_size, | 1294 | slab_flags_t kmem_cache_flags(unsigned long object_size, |
1293 | unsigned long flags, const char *name, | 1295 | slab_flags_t flags, const char *name, |
1294 | void (*ctor)(void *)) | 1296 | void (*ctor)(void *)) |
1295 | { | 1297 | { |
1296 | /* | 1298 | /* |
@@ -1322,8 +1324,8 @@ static inline void add_full(struct kmem_cache *s, struct kmem_cache_node *n, | |||
1322 | struct page *page) {} | 1324 | struct page *page) {} |
1323 | static inline void remove_full(struct kmem_cache *s, struct kmem_cache_node *n, | 1325 | static inline void remove_full(struct kmem_cache *s, struct kmem_cache_node *n, |
1324 | struct page *page) {} | 1326 | struct page *page) {} |
1325 | unsigned long kmem_cache_flags(unsigned long object_size, | 1327 | slab_flags_t kmem_cache_flags(unsigned long object_size, |
1326 | unsigned long flags, const char *name, | 1328 | slab_flags_t flags, const char *name, |
1327 | void (*ctor)(void *)) | 1329 | void (*ctor)(void *)) |
1328 | { | 1330 | { |
1329 | return flags; | 1331 | return flags; |
@@ -3477,7 +3479,7 @@ static void set_cpu_partial(struct kmem_cache *s) | |||
3477 | */ | 3479 | */ |
3478 | static int calculate_sizes(struct kmem_cache *s, int forced_order) | 3480 | static int calculate_sizes(struct kmem_cache *s, int forced_order) |
3479 | { | 3481 | { |
3480 | unsigned long flags = s->flags; | 3482 | slab_flags_t flags = s->flags; |
3481 | size_t size = s->object_size; | 3483 | size_t size = s->object_size; |
3482 | int order; | 3484 | int order; |
3483 | 3485 | ||
@@ -3593,7 +3595,7 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order) | |||
3593 | return !!oo_objects(s->oo); | 3595 | return !!oo_objects(s->oo); |
3594 | } | 3596 | } |
3595 | 3597 | ||
3596 | static int kmem_cache_open(struct kmem_cache *s, unsigned long flags) | 3598 | static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags) |
3597 | { | 3599 | { |
3598 | s->flags = kmem_cache_flags(s->size, flags, s->name, s->ctor); | 3600 | s->flags = kmem_cache_flags(s->size, flags, s->name, s->ctor); |
3599 | s->reserved = 0; | 3601 | s->reserved = 0; |
@@ -4245,7 +4247,7 @@ void __init kmem_cache_init_late(void) | |||
4245 | 4247 | ||
4246 | struct kmem_cache * | 4248 | struct kmem_cache * |
4247 | __kmem_cache_alias(const char *name, size_t size, size_t align, | 4249 | __kmem_cache_alias(const char *name, size_t size, size_t align, |
4248 | unsigned long flags, void (*ctor)(void *)) | 4250 | slab_flags_t flags, void (*ctor)(void *)) |
4249 | { | 4251 | { |
4250 | struct kmem_cache *s, *c; | 4252 | struct kmem_cache *s, *c; |
4251 | 4253 | ||
@@ -4275,7 +4277,7 @@ __kmem_cache_alias(const char *name, size_t size, size_t align, | |||
4275 | return s; | 4277 | return s; |
4276 | } | 4278 | } |
4277 | 4279 | ||
4278 | int __kmem_cache_create(struct kmem_cache *s, unsigned long flags) | 4280 | int __kmem_cache_create(struct kmem_cache *s, slab_flags_t flags) |
4279 | { | 4281 | { |
4280 | int err; | 4282 | int err; |
4281 | 4283 | ||