aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/mm/numa.c2
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--mm/page_alloc.c23
3 files changed, 22 insertions, 5 deletions
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
index 5061c3fb6796..3efea7d0a351 100644
--- a/arch/ia64/mm/numa.c
+++ b/arch/ia64/mm/numa.c
@@ -70,7 +70,7 @@ int __meminit __early_pfn_to_nid(unsigned long pfn)
70 return node_memblk[i].nid; 70 return node_memblk[i].nid;
71 } 71 }
72 72
73 return 0; 73 return -1;
74} 74}
75 75
76#ifdef CONFIG_MEMORY_HOTPLUG 76#ifdef CONFIG_MEMORY_HOTPLUG
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 09c14e213b63..1aca6cebbb78 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1071,7 +1071,7 @@ void sparse_init(void);
1071#endif /* CONFIG_SPARSEMEM */ 1071#endif /* CONFIG_SPARSEMEM */
1072 1072
1073#ifdef CONFIG_NODES_SPAN_OTHER_NODES 1073#ifdef CONFIG_NODES_SPAN_OTHER_NODES
1074#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid)) 1074bool early_pfn_in_nid(unsigned long pfn, int nid);
1075#else 1075#else
1076#define early_pfn_in_nid(pfn, nid) (1) 1076#define early_pfn_in_nid(pfn, nid) (1)
1077#endif 1077#endif
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c5dd74602efc..5c44ed49ca93 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3000,16 +3000,33 @@ int __meminit __early_pfn_to_nid(unsigned long pfn)
3000 if (start_pfn <= pfn && pfn < end_pfn) 3000 if (start_pfn <= pfn && pfn < end_pfn)
3001 return early_node_map[i].nid; 3001 return early_node_map[i].nid;
3002 } 3002 }
3003 3003 /* This is a memory hole */
3004 return 0; 3004 return -1;
3005} 3005}
3006#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ 3006#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
3007 3007
3008int __meminit early_pfn_to_nid(unsigned long pfn) 3008int __meminit early_pfn_to_nid(unsigned long pfn)
3009{ 3009{
3010 return __early_pfn_to_nid(pfn); 3010 int nid;
3011
3012 nid = __early_pfn_to_nid(pfn);
3013 if (nid >= 0)
3014 return nid;
3015 /* just returns 0 */
3016 return 0;
3011} 3017}
3012 3018
3019#ifdef CONFIG_NODES_SPAN_OTHER_NODES
3020bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
3021{
3022 int nid;
3023
3024 nid = __early_pfn_to_nid(pfn);
3025 if (nid >= 0 && nid != node)
3026 return false;
3027 return true;
3028}
3029#endif
3013 3030
3014/* Basic iterator support to walk early_node_map[] */ 3031/* Basic iterator support to walk early_node_map[] */
3015#define for_each_active_range_index_in_nid(i, nid) \ 3032#define for_each_active_range_index_in_nid(i, nid) \