summaryrefslogtreecommitdiff
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2003-06-14 05:53:41 -0700
committerPaul Mackerras <paulus@samba.org>2003-06-14 05:53:41 -0700
commit7015b1a3aca6f68416832537afaf3d20a894fffc (patch)
tree73cc131ce07a5ea4d78937834b700bd1dde94699 /include/linux/slab.h
parentdb2f4e00e545422b32643deed69c57d188ad2a75 (diff)
[PATCH] fix weird kmalloc bug
Last night, Manfred and I found an interesting bug with kmalloc on ppc32, where the kmalloc in alloc_super() (fs/super.c) was requesting 432 bytes but only getting 256 bytes. The reason was that PAGE_SIZE wasn't defined at the point where the kmalloc() inline function occurs. Thus the CACHE(32) entry got omitted from the list in kmalloc_sizes.h, and kmalloc therefore used the entry in malloc_sizes[] before the correct entry. This patch fixes it by including asm/page.h and asm/cache.h in linux/slab.h. The list in kmalloc_sizes.h depends on L1_CACHE_BYTES as well as PAGE_SIZE, which is why I added asm/cache.h.
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 138bcdf65275..a1c0dbc5b8d8 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -13,6 +13,8 @@ typedef struct kmem_cache_s kmem_cache_t;
#include <linux/gfp.h>
#include <linux/types.h>
+#include <asm/page.h>
+#include <asm/cache.h>
/* flags for kmem_cache_alloc() */
#define SLAB_NOFS GFP_NOFS