diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2012-04-27 16:30:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-30 14:05:27 -0400 |
commit | 9fb48c744ba6a4bf58b666f4e6fdac3008ea1bd4 (patch) | |
tree | f145e07824a3a9bae9f8da3e5c39ea5073bd872e /include/linux/moduleparam.h | |
parent | 3faa286055c02291dc9b6d838601dcb105a64a14 (diff) |
params: add 3rd arg to option handler callback signature
Add a 3rd arg, named "doing", to unknown-options callbacks invoked
from parse_args(). The arg is passed as:
"Booting kernel" from start_kernel(),
initcall_level_names[i] from do_initcall_level(),
mod->name from load_module(), via parse_args(), parse_one()
parse_args() already has the "name" parameter, which is renamed to
"doing" to better reflect current uses 1,2 above. parse_args() passes
it to an altered parse_one(), which now passes it down into the
unknown option handler callbacks.
The mod->name will be needed to handle dyndbg for loadable modules,
since params passed by modprobe are not qualified (they do not have a
"$modname." prefix), and by the time the unknown-param callback is
called, the module name is not otherwise available.
Minor tweaks:
Add param-name to parse_one's pr_debug(), current message doesnt
identify the param being handled, add it.
Add a pr_info to print current level and level_name of the initcall,
and number of registered initcalls at that level. This adds 7 lines
to dmesg output, like:
initlevel:6=device, 172 registered initcalls
Drop "parameters" from initcall_level_names[], its unhelpful in the
pr_info() added above. This array is passed into parse_args() by
do_initcall_level().
CC: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/moduleparam.h')
-rw-r--r-- | include/linux/moduleparam.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index ea36486378d8..1b14d25162cb 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -320,7 +320,8 @@ extern int parse_args(const char *name, | |||
320 | unsigned num, | 320 | unsigned num, |
321 | s16 level_min, | 321 | s16 level_min, |
322 | s16 level_max, | 322 | s16 level_max, |
323 | int (*unknown)(char *param, char *val)); | 323 | int (*unknown)(char *param, char *val, |
324 | const char *doing)); | ||
324 | 325 | ||
325 | /* Called by module remove. */ | 326 | /* Called by module remove. */ |
326 | #ifdef CONFIG_SYSFS | 327 | #ifdef CONFIG_SYSFS |