mirror of https://github.com/schoebel/mars
rename /proc/sys/mars to /proc/sys/mars/trigger
create basis for adding more entries to /proc/sys/mars/
This commit is contained in:
parent
bd55c058e1
commit
2f9d86b994
|
@ -17,7 +17,7 @@
|
||||||
mars_info_fn mars_info = NULL;
|
mars_info_fn mars_info = NULL;
|
||||||
|
|
||||||
static
|
static
|
||||||
int mars_sysctl_handler(ctl_table *table,
|
int trigger_sysctl_handler(ctl_table *table,
|
||||||
int write,
|
int write,
|
||||||
void __user *buffer,
|
void __user *buffer,
|
||||||
size_t *length,
|
size_t *length,
|
||||||
|
@ -81,11 +81,22 @@ done:
|
||||||
|
|
||||||
static
|
static
|
||||||
ctl_table mars_table[] = {
|
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,
|
.ctl_name = CTL_UNNUMBERED,
|
||||||
.procname = "mars",
|
.procname = "mars",
|
||||||
.mode = 0600,
|
.mode = 0500,
|
||||||
.proc_handler = &mars_sysctl_handler,
|
.child = mars_table,
|
||||||
},
|
},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
@ -99,9 +110,7 @@ int __init init_mars_proc(void)
|
||||||
|
|
||||||
MARS_INF("init_proc()\n");
|
MARS_INF("init_proc()\n");
|
||||||
|
|
||||||
#if 1
|
header = register_sysctl_table(mars_root_table);
|
||||||
header = register_sysctl_table(mars_table);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ sub get_size {
|
||||||
# helpers
|
# helpers
|
||||||
|
|
||||||
sub _trigger {
|
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 {
|
sub _switch {
|
||||||
|
|
Loading…
Reference in New Issue