diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2013-04-29 15:08:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 15:54:36 -0700 |
commit | f02c696800886382198df897b30bb796b46a8dae (patch) | |
tree | 72155687f3f89bf1f300114cd22f90540396a69c /include/linux/notifier.h | |
parent | f9d531b8dcd1b62a7bf96f29212ca80b58f96e82 (diff) | |
download | linux-stable-f02c696800886382198df897b30bb796b46a8dae.tar.gz linux-stable-f02c696800886382198df897b30bb796b46a8dae.tar.bz2 linux-stable-f02c696800886382198df897b30bb796b46a8dae.zip |
include/linux/memory.h: implement register_hotmemory_notifier()
When CONFIG_MEMORY_HOTPLUG=n, we don't want the memory-hotplug notifier
handlers to be included in the .o files, for space reasons.
The existing hotplug_memory_notifier() tries to handle this but testing
with gcc-4.4.4 shows that it doesn't work - the hotplug functions are
still present in the .o files.
So implement a new register_hotmemory_notifier() which is a copy of
register_hotcpu_notifier(), and which actually works as desired.
hotplug_memory_notifier() and register_memory_notifier() callsites
should be converted to use this new register_hotmemory_notifier().
While we're there, let's repair the existing hotplug_memory_notifier():
it simply stomps on the register_memory_notifier() return value, so
well-behaved code cannot check for errors. Apparently non of the
existing callers were well-behaved :(
Cc: Andrew Shewmaker <agshew@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/notifier.h')
-rw-r--r-- | include/linux/notifier.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index d65746efc954..d14a4c362465 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -47,8 +47,11 @@ * runtime initialization. */ +typedef int (*notifier_fn_t)(struct notifier_block *nb, + unsigned long action, void *data); + struct notifier_block { - int (*notifier_call)(struct notifier_block *, unsigned long, void *); + notifier_fn_t notifier_call; struct notifier_block __rcu *next; int priority; }; |