Commit e5ded0b1 authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] Fix slab-vs-gfp bitflag clash

Fixes a bug spotted by Alexey Mahotkin <alexm@hsys.msk.ru>: the slab-internal
SLAB_NO_GROW bit clashes with __GFP_NORETRY.

Fix that up so it won't happen again by moving the bit layout into gfp.h.
parent c007c1ed
......@@ -31,6 +31,7 @@
#define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */
#define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */
#define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */
#define __GFP_NO_GROW 0x2000 /* Slab internal usage */
#define GFP_ATOMIC (__GFP_HIGH)
#define GFP_NOIO (__GFP_WAIT)
......
......@@ -22,8 +22,11 @@ typedef struct kmem_cache_s kmem_cache_t;
#define SLAB_KERNEL GFP_KERNEL
#define SLAB_DMA GFP_DMA
#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|__GFP_NORETRY)
#define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */
#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|\
__GFP_NOFAIL|__GFP_NORETRY)
#define SLAB_NO_GROW __GFP_NO_GROW /* don't grow a cache */
/* flags to pass to kmem_cache_create().
* The first 3 are only valid when the allocator as been build
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment