- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / acpi / numa.c
index a38ff6d..e7f7fb7 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/acpi.h>
+#include <linux/numa.h>
 #include <acpi/acpi_bus.h>
 
 #define PREFIX "ACPI: "
@@ -40,16 +41,16 @@ static nodemask_t nodes_found_map = NODE_MASK_NONE;
 
 /* maps to convert between proximity domain and logical node ID */
 static int pxm_to_node_map[MAX_PXM_DOMAINS]
-                               = { [0 ... MAX_PXM_DOMAINS - 1] = NID_INVAL };
+                       = { [0 ... MAX_PXM_DOMAINS - 1] = NUMA_NO_NODE };
 static int node_to_pxm_map[MAX_NUMNODES]
-                               = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
+                       = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
 
 unsigned char acpi_srat_revision __initdata;
 
 int pxm_to_node(int pxm)
 {
        if (pxm < 0)
-               return NID_INVAL;
+               return NUMA_NO_NODE;
        return pxm_to_node_map[pxm];
 }
 
@@ -70,9 +71,9 @@ int acpi_map_pxm_to_node(int pxm)
 {
        int node = pxm_to_node_map[pxm];
 
-       if (node < 0){
+       if (node < 0) {
                if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
-                       return NID_INVAL;
+                       return NUMA_NO_NODE;
                node = first_unset_node(nodes_found_map);
                __acpi_map_pxm_to_node(pxm, node);
                node_set(node, nodes_found_map);
@@ -81,16 +82,6 @@ int acpi_map_pxm_to_node(int pxm)
        return node;
 }
 
-#if 0
-void __cpuinit acpi_unmap_pxm_to_node(int node)
-{
-       int pxm = node_to_pxm_map[node];
-       pxm_to_node_map[pxm] = NID_INVAL;
-       node_to_pxm_map[node] = PXM_INVAL;
-       node_clear(node, nodes_found_map);
-}
-#endif  /*  0  */
-
 static void __init
 acpi_table_print_srat_entry(struct acpi_subtable_header *header)
 {
@@ -286,22 +277,24 @@ acpi_table_parse_srat(enum acpi_srat_type id,
 
 int __init acpi_numa_init(void)
 {
+       int ret = 0;
+
        /* SRAT: Static Resource Affinity Table */
        if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
                acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
                                      acpi_parse_x2apic_affinity, NR_CPUS);
                acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
                                      acpi_parse_processor_affinity, NR_CPUS);
-               acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
-                                     acpi_parse_memory_affinity,
-                                     NR_NODE_MEMBLKS);
+               ret = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
+                                           acpi_parse_memory_affinity,
+                                           NR_NODE_MEMBLKS);
        }
 
        /* SLIT: System Locality Information Table */
        acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit);
 
        acpi_numa_arch_fixup();
-       return 0;
+       return ret;
 }
 
 int acpi_get_pxm(acpi_handle h)