]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/memory_hotplug.c
Merge tag 'gfs2-for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
[linux.git] / mm / memory_hotplug.c
index c3dc6b27fd6dbf330037840b28445d0597c6cd43..36d80915ddc282e4fa25b79d0b768ee708e61c48 100644 (file)
@@ -783,27 +783,18 @@ struct zone * zone_for_pfn_range(int online_type, int nid, unsigned start_pfn,
        return default_zone_for_pfn(nid, start_pfn, nr_pages);
 }
 
-int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_type)
+int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
+                      int online_type, int nid)
 {
        unsigned long flags;
        unsigned long onlined_pages = 0;
        struct zone *zone;
        int need_zonelists_rebuild = 0;
-       int nid;
        int ret;
        struct memory_notify arg;
-       struct memory_block *mem;
 
        mem_hotplug_begin();
 
-       /*
-        * We can't use pfn_to_nid() because nid might be stored in struct page
-        * which is not yet initialized. Instead, we find nid from memory block.
-        */
-       mem = find_memory_block(__pfn_to_section(pfn));
-       nid = mem->nid;
-       put_device(&mem->dev);
-
        /* associate pfn range with the zone */
        zone = zone_for_pfn_range(online_type, nid, pfn, nr_pages);
        move_pfn_range_to_zone(zone, pfn, nr_pages, NULL);