There are two remaining gotchas:
- The directories have impossible permissions (writeable).
- The ctl_name for the kernel directory is inconsistent with
everything else. It should be CTL_KERN.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
static struct ctl_table sd_ctl_dir[] = {
{
.procname = "sched_domain",
static struct ctl_table sd_ctl_dir[] = {
{
.procname = "sched_domain",
},
{0,},
};
static struct ctl_table sd_ctl_root[] = {
{
},
{0,},
};
static struct ctl_table sd_ctl_root[] = {
{
.child = sd_ctl_dir,
},
{0,},
.child = sd_ctl_dir,
},
{0,},
for_each_domain(cpu, sd) {
snprintf(buf, 32, "domain%d", i);
entry->procname = kstrdup(buf, GFP_KERNEL);
for_each_domain(cpu, sd) {
snprintf(buf, 32, "domain%d", i);
entry->procname = kstrdup(buf, GFP_KERNEL);
entry->child = sd_alloc_ctl_domain_table(sd);
entry++;
i++;
entry->child = sd_alloc_ctl_domain_table(sd);
entry++;
i++;
for (i = 0; i < cpu_num; i++, entry++) {
snprintf(buf, 32, "cpu%d", i);
entry->procname = kstrdup(buf, GFP_KERNEL);
for (i = 0; i < cpu_num; i++, entry++) {
snprintf(buf, 32, "cpu%d", i);
entry->procname = kstrdup(buf, GFP_KERNEL);
entry->child = sd_alloc_ctl_cpu_table(i);
}
sd_sysctl_header = register_sysctl_table(sd_ctl_root);
entry->child = sd_alloc_ctl_cpu_table(i);
}
sd_sysctl_header = register_sysctl_table(sd_ctl_root);