aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/kcore.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2013-04-29 18:08:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:36 -0400
commit3c743a7f7b682dedef188664514c0ea82e232742 (patch)
tree4a59fedfc7afd91cddac218fe1898224d32d0cd4 /fs/proc/kcore.c
parent6e259e7dc482d4d5e2701259ddc85ffebd957502 (diff)
fs/proc/kcore.c: use register_hotmemory_notifier()
Saves an ifdef, no code size changes Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/kcore.c')
-rw-r--r--fs/proc/kcore.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index eda6f017f272..f6a13f489e30 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -15,6 +15,7 @@
15#include <linux/capability.h> 15#include <linux/capability.h>
16#include <linux/elf.h> 16#include <linux/elf.h>
17#include <linux/elfcore.h> 17#include <linux/elfcore.h>
18#include <linux/notifier.h>
18#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
19#include <linux/highmem.h> 20#include <linux/highmem.h>
20#include <linux/printk.h> 21#include <linux/printk.h>
@@ -564,7 +565,6 @@ static const struct file_operations proc_kcore_operations = {
564 .llseek = default_llseek, 565 .llseek = default_llseek,
565}; 566};
566 567
567#ifdef CONFIG_MEMORY_HOTPLUG
568/* just remember that we have to update kcore */ 568/* just remember that we have to update kcore */
569static int __meminit kcore_callback(struct notifier_block *self, 569static int __meminit kcore_callback(struct notifier_block *self,
570 unsigned long action, void *arg) 570 unsigned long action, void *arg)
@@ -578,8 +578,11 @@ static int __meminit kcore_callback(struct notifier_block *self,
578 } 578 }
579 return NOTIFY_OK; 579 return NOTIFY_OK;
580} 580}
581#endif
582 581
582static struct notifier_block kcore_callback_nb __meminitdata = {
583 .notifier_call = kcore_callback,
584 .priority = 0,
585};
583 586
584static struct kcore_list kcore_vmalloc; 587static struct kcore_list kcore_vmalloc;
585 588
@@ -631,7 +634,7 @@ static int __init proc_kcore_init(void)
631 add_modules_range(); 634 add_modules_range();
632 /* Store direct-map area from physical memory map */ 635 /* Store direct-map area from physical memory map */
633 kcore_update_ram(); 636 kcore_update_ram();
634 hotplug_memory_notifier(kcore_callback, 0); 637 register_hotmemory_notifier(&kcore_callback_nb);
635 638
636 return 0; 639 return 0;
637} 640}