函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kmod.c Create Date:2022-07-27 10:35:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__request_module - try to load a kernel module*@wait: wait (or not) for the operation to complete*@fmt: printf style format string for the name of the module*@...: arguments as specified in the format string

函数原型:int __request_module(bool wait, const char *fmt, ...)

返回类型:int

参数:

类型参数名称
boolwait
const char *fmt
137  WARN_ON_ONCE(wait && rrent_is_async - is %current an async worker task?* Returns %true if %current is an async worker task.)
139  如果非modprobe_path is set via /proc/sys.[0]则返回:0
142  va_start(args, fmt)
143  ret等于vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally
144  va_end(args)
145  如果ret大于等于MODULE_NAME_LEN则返回:负ENAMETOOLONG
148  ret等于security_kernel_module_request(module_name)
149  如果ret则返回:ret
152  如果atomic_dec_if_positive( & kmod_concurrent_max)小于0则
153  pr_warn_ratelimited("request_module: kmod_concurrent_max (%u) close to 0 (max_modprobes: %u), for module %s, throttling...", atomic_read( & kmod_concurrent_max), Assuming:* threads = div64_u64((u64) totalram_pages * (u64) PAGE_SIZE,* (u64) THREAD_SIZE * 8UL);* If you need less than 50 threads would mean we're dealing with systems* smaller than 3200 pages, module_name)
156  ret等于wait_event_killable_timeout - sleep until a condition gets true or a timeout elapses*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for*@timeout: timeout, in jiffies* The process is put to sleep (TASK_KILLABLE) until (kmod_wq, atomic_dec_if_positive( & kmod_concurrent_max) >= 0, This is a restriction on having *all* MAX_KMOD_CONCURRENT threads* running at the same time without returning. When this happens we* believe you've somehow ended up with a recursive module dependency* creating a loop.* We have no option but to fail. * HZ)
159  如果非ret
162  返回:负ETIME
164  pr_warn_ratelimited("request_module: sigkill sent for modprobe %s, giving up", module_name)
165  返回:ret
169  trace_module_request(module_name, wait, _RET_IP_)
171  ret等于call_modprobe(module_name, wait ? wait for the process to complete : wait for the exec, but not the process )
173  atomic_inc( & kmod_concurrent_max)
174  wake_up( & kmod_wq)
176  返回:ret