Make autoremove_wake_function -> default_wake_function call inlined. default_wake_function cannot be put as static inline into headers, because reference to it is taken at some places. Signed-off-by: Mikulas Patocka --- include/linux/wait.h | 2 +- kernel/sched.c | 14 ++++++++++++-- kernel/wait.c | 10 ---------- 3 files changed, 13 insertions(+), 13 deletions(-) Index: linux-2.6.26-rc8/kernel/sched.c =================================================================== --- linux-2.6.26-rc8.orig/kernel/sched.c 2008-06-25 03:58:20.000000000 +0200 +++ linux-2.6.26-rc8/kernel/sched.c 2008-07-01 17:44:07.000000000 +0200 @@ -4276,13 +4276,23 @@ asmlinkage void __sched preempt_schedule #endif /* CONFIG_PREEMPT */ -int default_wake_function(wait_queue_t *curr, unsigned mode, int sync, - void *key) +__always_inline int default_wake_function(wait_queue_t *curr, unsigned mode, + int sync, void *key) { return try_to_wake_up(curr->private, mode, sync); } EXPORT_SYMBOL(default_wake_function); +int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key) +{ + int ret = default_wake_function(wait, mode, sync, key); + + if (ret) + list_del_init(&wait->task_list); + return ret; +} +EXPORT_SYMBOL(autoremove_wake_function); + /* * The core wakeup function. Non-exclusive wakeups (nr_exclusive == 0) just * wake everything up. If it's an exclusive wakeup (nr_exclusive == small +ve Index: linux-2.6.26-rc8/kernel/wait.c =================================================================== --- linux-2.6.26-rc8.orig/kernel/wait.c 2008-07-01 17:43:00.000000000 +0200 +++ linux-2.6.26-rc8/kernel/wait.c 2008-07-01 17:44:07.000000000 +0200 @@ -127,16 +127,6 @@ void finish_wait(wait_queue_head_t *q, w } EXPORT_SYMBOL(finish_wait); -int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key) -{ - int ret = default_wake_function(wait, mode, sync, key); - - if (ret) - list_del_init(&wait->task_list); - return ret; -} -EXPORT_SYMBOL(autoremove_wake_function); - int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *arg) { struct wait_bit_key *key = arg; Index: linux-2.6.26-rc8/include/linux/wait.h =================================================================== --- linux-2.6.26-rc8.orig/include/linux/wait.h 2008-07-01 17:43:00.000000000 +0200 +++ linux-2.6.26-rc8/include/linux/wait.h 2008-07-01 17:44:07.000000000 +0200 @@ -27,7 +27,7 @@ typedef struct __wait_queue wait_queue_t; typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int sync, void *key); -int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); +__always_inline int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); struct __wait_queue { unsigned int flags;