public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slob: fix linking for user mode linux
@ 2008-02-11 22:32 Pekka J Enberg
  2008-02-11 22:39 ` Matt Mackall
  0 siblings, 1 reply; 5+ messages in thread
From: Pekka J Enberg @ 2008-02-11 22:32 UTC (permalink / raw)
  To: mpm; +Cc: jdike, blaisorblade, clameter, linux-kernel

From: Pekka Enberg <penberg@cs.helsinki.fi>

UML has some header magic that expects a non-inline __kmalloc() function to be
available. Fixes the following link time errors:

arch/um/drivers/built-in.o: In function `kmalloc':
/home/penberg/linux-2.6/arch/um/include/um_malloc.h:14: undefined reference to `__kmalloc'
/home/penberg/linux-2.6/arch/um/include/um_malloc.h:14: undefined reference to `__kmalloc'
/home/penberg/linux-2.6/arch/um/include/um_malloc.h:14: undefined reference to `__kmalloc'
/home/penberg/linux-2.6/arch/um/include/um_malloc.h:14: undefined reference to `__kmalloc'
/home/penberg/linux-2.6/arch/um/include/um_malloc.h:14: undefined reference to `__kmalloc'
arch/um/drivers/built-in.o:/home/penberg/linux-2.6/arch/um/include/um_malloc.h:14: more undefined references to `__kmalloc' follow

Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
Matt, does this look ok to you? Can we merge it via Christoph's tree?

 include/linux/slob_def.h |    5 +----
 mm/slob.c                |    6 ++++++
 2 files changed, 7 insertions(+), 4 deletions(-)

Index: linux-2.6/include/linux/slob_def.h
===================================================================
--- linux-2.6.orig/include/linux/slob_def.h	2008-01-12 01:00:37.000000000 +0200
+++ linux-2.6/include/linux/slob_def.h	2008-02-12 00:27:38.000000000 +0200
@@ -28,9 +28,6 @@
 	return __kmalloc_node(size, flags, -1);
 }
 
-static inline void *__kmalloc(size_t size, gfp_t flags)
-{
-	return kmalloc(size, flags);
-}
+extern void *__kmalloc(size_t size, gfp_t flags);
 
 #endif /* __LINUX_SLOB_DEF_H */
Index: linux-2.6/mm/slob.c
===================================================================
--- linux-2.6.orig/mm/slob.c	2008-02-11 23:47:19.000000000 +0200
+++ linux-2.6/mm/slob.c	2008-02-12 00:27:38.000000000 +0200
@@ -486,6 +486,12 @@
 }
 EXPORT_SYMBOL(__kmalloc_node);
 
+void *__kmalloc(size_t size, gfp_t gfp)
+{
+	return __kmalloc_node(size, gfp, -1);
+}
+EXPORT_SYMBOL(__kmalloc);
+
 void kfree(const void *block)
 {
 	struct slob_page *sp;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-02-12  6:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-11 22:32 [PATCH] slob: fix linking for user mode linux Pekka J Enberg
2008-02-11 22:39 ` Matt Mackall
2008-02-11 22:44   ` Christoph Lameter
2008-02-11 23:32     ` Jeff Dike
2008-02-12  6:23       ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox