mm/memory_hotplug: make remove_memory() take the device_hotplug_lock
[sfrench/cifs-2.6.git] / mm / memory_hotplug.c
index 7e6509a53d79facc47bcf0b5f0d5e37de32f3ad6..8f38e689da25730c0c38d35b3c6dc123d5989d51 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/stop_machine.h>
 #include <linux/hugetlb.h>
 #include <linux/memblock.h>
-#include <linux/bootmem.h>
 #include <linux/compaction.h>
 
 #include <asm/tlbflush.h>
@@ -1807,7 +1806,7 @@ EXPORT_SYMBOL(try_offline_node);
  * and online/offline operations before this call, as required by
  * try_offline_node().
  */
-void __ref remove_memory(int nid, u64 start, u64 size)
+void __ref __remove_memory(int nid, u64 start, u64 size)
 {
        int ret;
 
@@ -1836,5 +1835,12 @@ void __ref remove_memory(int nid, u64 start, u64 size)
 
        mem_hotplug_done();
 }
+
+void remove_memory(int nid, u64 start, u64 size)
+{
+       lock_device_hotplug();
+       __remove_memory(nid, start, size);
+       unlock_device_hotplug();
+}
 EXPORT_SYMBOL_GPL(remove_memory);
 #endif /* CONFIG_MEMORY_HOTREMOVE */