[PATCH] slob: fix linking for user mode linux

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <mpm@...>
Cc: <jdike@...>, <blaisorblade@...>, <clameter@...>, <linux-kernel@...>
Date: Monday, February 11, 2008 - 6:32 pm

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;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] slob: fix linking for user mode linux, Pekka J Enberg, (Mon Feb 11, 6:32 pm)
Re: [PATCH] slob: fix linking for user mode linux, Matt Mackall, (Mon Feb 11, 6:39 pm)
Re: [PATCH] slob: fix linking for user mode linux, Christoph Lameter, (Mon Feb 11, 6:44 pm)
Re: [PATCH] slob: fix linking for user mode linux, Jeff Dike, (Mon Feb 11, 7:32 pm)
Re: [PATCH] slob: fix linking for user mode linux, Pekka Enberg, (Tue Feb 12, 2:23 am)