[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>
This commit is contained in:
committed by
Linus Torvalds
parent
1f04bbd2d3
commit
0fc44159bf
@@ -190,6 +190,31 @@ void unregister_node(struct node *node)
|
||||
sysdev_unregister(&node->sysdev);
|
||||
}
|
||||
|
||||
struct node node_devices[MAX_NUMNODES];
|
||||
|
||||
int register_one_node(int nid)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
if (node_online(nid)) {
|
||||
int p_node = parent_node(nid);
|
||||
struct node *parent = NULL;
|
||||
|
||||
if (p_node != nid)
|
||||
parent = &node_devices[p_node];
|
||||
|
||||
error = register_node(&node_devices[nid], nid, parent);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
}
|
||||
|
||||
void unregister_one_node(int nid)
|
||||
{
|
||||
unregister_node(&node_devices[nid]);
|
||||
}
|
||||
|
||||
static int __init register_node_type(void)
|
||||
{
|
||||
return sysdev_class_register(&node_class);
|
||||
|
Reference in New Issue
Block a user