diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-08-31 03:48:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-31 04:09:21 -0400 |
commit | aa137f9d29d30592774c727ec5cfcf9891e576fa (patch) | |
tree | 83a4d47f8aa52589c404f5962741882178b8acdc /include/linux/slub_def.h | |
parent | d66ac4752e891f319fa931ab72efb3352fafa50b (diff) |
SLUB: Force inlining for functions in slub_def.h
Some compilers (especially older gcc releases) may skip inlining
sometimes which will lead to link failures. Force the inlining of
keyfunctions in slub_def.h to avoid these issues.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Jan Dittmer <jdi@l4x.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r-- | include/linux/slub_def.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 124270df8734..74962077f632 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -78,7 +78,7 @@ extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; | |||
78 | * Sorry that the following has to be that ugly but some versions of GCC | 78 | * Sorry that the following has to be that ugly but some versions of GCC |
79 | * have trouble with constant propagation and loops. | 79 | * have trouble with constant propagation and loops. |
80 | */ | 80 | */ |
81 | static inline int kmalloc_index(size_t size) | 81 | static __always_inline int kmalloc_index(size_t size) |
82 | { | 82 | { |
83 | if (!size) | 83 | if (!size) |
84 | return 0; | 84 | return 0; |
@@ -133,7 +133,7 @@ static inline int kmalloc_index(size_t size) | |||
133 | * This ought to end up with a global pointer to the right cache | 133 | * This ought to end up with a global pointer to the right cache |
134 | * in kmalloc_caches. | 134 | * in kmalloc_caches. |
135 | */ | 135 | */ |
136 | static inline struct kmem_cache *kmalloc_slab(size_t size) | 136 | static __always_inline struct kmem_cache *kmalloc_slab(size_t size) |
137 | { | 137 | { |
138 | int index = kmalloc_index(size); | 138 | int index = kmalloc_index(size); |
139 | 139 | ||
@@ -166,7 +166,7 @@ static inline struct kmem_cache *kmalloc_slab(size_t size) | |||
166 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); | 166 | void *kmem_cache_alloc(struct kmem_cache *, gfp_t); |
167 | void *__kmalloc(size_t size, gfp_t flags); | 167 | void *__kmalloc(size_t size, gfp_t flags); |
168 | 168 | ||
169 | static inline void *kmalloc(size_t size, gfp_t flags) | 169 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
170 | { | 170 | { |
171 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | 171 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { |
172 | struct kmem_cache *s = kmalloc_slab(size); | 172 | struct kmem_cache *s = kmalloc_slab(size); |
@@ -183,7 +183,7 @@ static inline void *kmalloc(size_t size, gfp_t flags) | |||
183 | void *__kmalloc_node(size_t size, gfp_t flags, int node); | 183 | void *__kmalloc_node(size_t size, gfp_t flags, int node); |
184 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); | 184 | void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); |
185 | 185 | ||
186 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | 186 | static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
187 | { | 187 | { |
188 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { | 188 | if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { |
189 | struct kmem_cache *s = kmalloc_slab(size); | 189 | struct kmem_cache *s = kmalloc_slab(size); |