diff options
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r-- | drivers/base/node.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index 36b43052001d..b3b72d64e805 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -375,8 +375,10 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid) | |||
375 | return -EFAULT; | 375 | return -EFAULT; |
376 | if (!node_online(nid)) | 376 | if (!node_online(nid)) |
377 | return 0; | 377 | return 0; |
378 | sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index); | 378 | |
379 | sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; | 379 | sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr); |
380 | sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr); | ||
381 | sect_end_pfn += PAGES_PER_SECTION - 1; | ||
380 | for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { | 382 | for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { |
381 | int page_nid; | 383 | int page_nid; |
382 | 384 | ||
@@ -400,7 +402,8 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid) | |||
400 | } | 402 | } |
401 | 403 | ||
402 | /* unregister memory section under all nodes that it spans */ | 404 | /* unregister memory section under all nodes that it spans */ |
403 | int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) | 405 | int unregister_mem_sect_under_nodes(struct memory_block *mem_blk, |
406 | unsigned long phys_index) | ||
404 | { | 407 | { |
405 | NODEMASK_ALLOC(nodemask_t, unlinked_nodes, GFP_KERNEL); | 408 | NODEMASK_ALLOC(nodemask_t, unlinked_nodes, GFP_KERNEL); |
406 | unsigned long pfn, sect_start_pfn, sect_end_pfn; | 409 | unsigned long pfn, sect_start_pfn, sect_end_pfn; |
@@ -412,7 +415,8 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) | |||
412 | if (!unlinked_nodes) | 415 | if (!unlinked_nodes) |
413 | return -ENOMEM; | 416 | return -ENOMEM; |
414 | nodes_clear(*unlinked_nodes); | 417 | nodes_clear(*unlinked_nodes); |
415 | sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index); | 418 | |
419 | sect_start_pfn = section_nr_to_pfn(phys_index); | ||
416 | sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; | 420 | sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1; |
417 | for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { | 421 | for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) { |
418 | int nid; | 422 | int nid; |