Commit 6bb8f238 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix for register_cpu()

From: jbarnes@sgi.com (Jesse Barnes)

The patch adds a symlink from /sys/devices/system/node/nodeM/cpuN to the
/sys/devices/cpu/cpuN directory so that a userspace program can determine
which CPUs belong to which nodes easily.  Non-NUMA systems can simply pass
NULL in for the root arg and everything will work like it used to.
parent 4136bb64
......@@ -23,10 +23,18 @@ EXPORT_SYMBOL(cpu_sysdev_class);
*/
int __init register_cpu(struct cpu *cpu, int num, struct node *root)
{
int error;
cpu->node_id = cpu_to_node(num);
cpu->sysdev.id = num;
cpu->sysdev.cls = &cpu_sysdev_class;
return sys_device_register(&cpu->sysdev);
error = sys_device_register(&cpu->sysdev);
if (!error && root)
error = sysfs_create_link(&root->sysdev.kobj,
&cpu->sysdev.kobj,
kobject_name(&cpu->sysdev.kobj));
return error;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment