X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fslub_def.h;h=5e2e7297dfaaa5108a287cdf71371202bbf4a639;hb=c59def9f222d44bb7e2f0a559f2906191a0862d7;hp=ea27065e80e636d6a9b41e7a49144186cf79020d;hpb=5c34202b8bf942da411b6599668a76b07449bbfd;p=linux-2.6 diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index ea27065e80..5e2e7297df 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -40,7 +40,6 @@ struct kmem_cache { int objects; /* Number of objects in slab */ int refcount; /* Refcount for slab cache destroy */ void (*ctor)(void *, struct kmem_cache *, unsigned long); - void (*dtor)(void *, struct kmem_cache *, unsigned long); int inuse; /* Offset to metadata */ int align; /* Alignment */ const char *name; /* Name (only for display!) */ @@ -60,7 +59,8 @@ struct kmem_cache { #define KMALLOC_SHIFT_LOW 3 #ifdef CONFIG_LARGE_ALLOCS -#define KMALLOC_SHIFT_HIGH 25 +#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) =< 25 ? \ + (MAX_ORDER + PAGE_SHIFT - 1) : 25) #else #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256 #define KMALLOC_SHIFT_HIGH 20 @@ -87,6 +87,9 @@ static inline int kmalloc_index(int size) */ WARN_ON_ONCE(size == 0); + if (size > (1 << KMALLOC_SHIFT_HIGH)) + return -1; + if (size > 64 && size <= 96) return 1; if (size > 128 && size <= 192)