Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ade3aff25fb2dce76e2a9b53e1334bd0a174f739 Commit: ade3aff25fb2dce76e2a9b53e1334bd0a174f739 Parent: 0b44f7a5b5078d737b3f5914978aabb761254840 Author: Andrew Morton <[EMAIL PROTECTED]> AuthorDate: Wed May 16 22:10:54 2007 -0700 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Thu May 17 05:23:03 2007 -0700
slub: fix handling of oversized slabs I'm getting zillions of undefined references to __kmalloc_size_too_large on alpha. For some reason alpha is building out-of-line copies of kmalloc_slab() into lots of compilation units. It turns out that gcc just isn't smart enough to work out that __builtin_contant_p(size)==true implies that __builtin_contant_p(index)==true. So let's give it a bit of help. Cc: Christoph Lameter <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- include/linux/slub_def.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 5e2e729..a9fb928 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -145,7 +145,12 @@ static inline struct kmem_cache *kmalloc_slab(size_t size) if (index == 0) return NULL; - if (index < 0) { + /* + * This function only gets expanded if __builtin_constant_p(size), so + * testing it here shouldn't be needed. But some versions of gcc need + * help. + */ + if (__builtin_constant_p(size) && index < 0) { /* * Generate a link failure. Would be great if we could * do something to stop the compile here. - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html