函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:proc_do_static_key

函数原型:int proc_do_static_key(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)

返回类型:int

参数:

类型参数名称
struct ctl_table *table
intwrite
void __user *buffer
size_t *lenp
loff_t *ppos
3390  key等于data
3391  DEFINE_MUTEX(static_key_mutex)
3393  struct ctl_table tmp = {data = & val, maxlen = val的长度, mode = mode, extra1 = Keep the same order as in fs/proc/proc_sysctl.c , extra2 = SYSCTL_ONE, }
3401  如果write且非操作权限检查则返回:负EPERM
3404  mutex_lock( & static_key_mutex)
3405  val等于static_key_enabled(key)
3406  ret等于指定大小读sysctl整数向量
3407  如果write且非ret
3408  如果valstatic_key_enable(key)
3410  否则static_key_disable(key)
3413  mutex_unlock( & static_key_mutex)
3414  返回:ret