aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorYasunori Goto <y-goto@jp.fujitsu.com>2006-06-27 05:53:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-27 20:32:36 -0400
commit0fc44159bfcb5b0afa178f9c3f50db23aebc76ff (patch)
treed87e47c0f5e6b2eff1d9113d3495d185924734d9 /arch/ia64
parent1f04bbd2d396a701c5af2e5b92bad896c2550c16 (diff)
[PATCH] Register sysfs file for hotplugged new node
When new node becomes enable by hot-add, new sysfs file must be created for new node. So, if new node is enabled by add_memory(), register_one_node() is called to create it. In addition, I386's arch_register_node() and a part of register_nodes() of powerpc are consolidated to register_one_node() as a generic_code(). This is tested by Tiger4(IPF) with node hot-plug emulation. Signed-off-by: Keiichiro Tokunaga <tokuanga.keiich@jp.fujitsu.com> Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/topology.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 879edb51d1e0..42cb05bdc680 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -26,9 +26,6 @@
26#include <asm/numa.h> 26#include <asm/numa.h>
27#include <asm/cpu.h> 27#include <asm/cpu.h>
28 28
29#ifdef CONFIG_NUMA
30static struct node *sysfs_nodes;
31#endif
32static struct ia64_cpu *sysfs_cpus; 29static struct ia64_cpu *sysfs_cpus;
33 30
34int arch_register_cpu(int num) 31int arch_register_cpu(int num)
@@ -36,7 +33,7 @@ int arch_register_cpu(int num)
36 struct node *parent = NULL; 33 struct node *parent = NULL;
37 34
38#ifdef CONFIG_NUMA 35#ifdef CONFIG_NUMA
39 parent = &sysfs_nodes[cpu_to_node(num)]; 36 parent = &node_devices[cpu_to_node(num)];
40#endif /* CONFIG_NUMA */ 37#endif /* CONFIG_NUMA */
41 38
42#if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU) 39#if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU)
@@ -59,7 +56,7 @@ void arch_unregister_cpu(int num)
59 56
60#ifdef CONFIG_NUMA 57#ifdef CONFIG_NUMA
61 int node = cpu_to_node(num); 58 int node = cpu_to_node(num);
62 parent = &sysfs_nodes[node]; 59 parent = &node_devices[node];
63#endif /* CONFIG_NUMA */ 60#endif /* CONFIG_NUMA */
64 61
65 return unregister_cpu(&sysfs_cpus[num].cpu, parent); 62 return unregister_cpu(&sysfs_cpus[num].cpu, parent);
@@ -74,17 +71,11 @@ static int __init topology_init(void)
74 int i, err = 0; 71 int i, err = 0;
75 72
76#ifdef CONFIG_NUMA 73#ifdef CONFIG_NUMA
77 sysfs_nodes = kzalloc(sizeof(struct node) * MAX_NUMNODES, GFP_KERNEL);
78 if (!sysfs_nodes) {
79 err = -ENOMEM;
80 goto out;
81 }
82
83 /* 74 /*
84 * MCD - Do we want to register all ONLINE nodes, or all POSSIBLE nodes? 75 * MCD - Do we want to register all ONLINE nodes, or all POSSIBLE nodes?
85 */ 76 */
86 for_each_online_node(i) { 77 for_each_online_node(i) {
87 if ((err = register_node(&sysfs_nodes[i], i, 0))) 78 if ((err = register_one_node(i)))
88 goto out; 79 goto out;
89 } 80 }
90#endif 81#endif