rename /proc/sys/mars to /proc/sys/mars/trigger

create basis for adding more entries to /proc/sys/mars/
This commit is contained in:
Thomas Schoebel-Theuer 2012-01-23 17:27:44 +01:00 committed by Thomas Schoebel-Theuer
parent bd55c058e1
commit 2f9d86b994
2 changed files with 16 additions and 7 deletions

View File

@ -17,7 +17,7 @@
mars_info_fn mars_info = NULL;
static
int mars_sysctl_handler(ctl_table *table,
int trigger_sysctl_handler(ctl_table *table,
int write,
void __user *buffer,
size_t *length,
@ -81,11 +81,22 @@ done:
static
ctl_table mars_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "trigger",
.mode = 0200,
.proc_handler = &trigger_sysctl_handler,
},
{}
};
static
ctl_table mars_root_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "mars",
.mode = 0600,
.proc_handler = &mars_sysctl_handler,
.mode = 0500,
.child = mars_table,
},
{}
};
@ -99,9 +110,7 @@ int __init init_mars_proc(void)
MARS_INF("init_proc()\n");
#if 1
header = register_sysctl_table(mars_table);
#endif
header = register_sysctl_table(mars_root_table);
return 0;
}

View File

@ -183,7 +183,7 @@ sub get_size {
# helpers
sub _trigger {
system("(echo 1 > /proc/sys/mars) >/dev/null 2>&1");
system("(echo 1 > /proc/sys/mars/trigger) >/dev/null 2>&1");
}
sub _switch {