函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:proc_do_large_bitmap - read/write from/to a large bitmap*@table: the sysctl table*@write: %TRUE if this is a write to the sysctl file*@buffer: the user buffer*@lenp: the size of the user buffer*@ppos: file position* The bitmap is stored at table->data and

函数原型:int proc_do_large_bitmap(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
3169  err等于0
3170  first等于1
3171  left等于lenp
3172  bitmap_len等于maxlen
3173  bitmap等于data
3174  unsigned long * tmp_bitmap = NULL
3175  char tr_a[] = {'-', ',', '\n'}, tr_b[] = {',', '\n', 0}, c
3177  如果非bitmap或非bitmap_len或非leftppos且非write
3178  lenp等于0
3179  返回:0
3182  如果write
3184  skipped等于0
3186  如果left大于PAGE_SIZE减1则
3187  left等于PAGE_SIZE减1
3189  skipped等于lenpleft
3192  p等于kbuf等于memdup_user_nul(buffer, left)
3193  如果是错误则返回:错误
3196  tmp_bitmap等于bitmap_zalloc(bitmap_len, GFP_KERNEL)
3197  如果非tmp_bitmap
3198  释放内存
3199  返回:负ENOMEM
3201  proc_skip_char( & p, & left, '\n')
3202  当非errleft循环
3208  saved_left等于left
3216  如果left小于等于1且skipped
3217  left等于saved_left
3218  退出
3221  如果err退出
3223  如果val_a大于等于bitmap_lenneg
3224  err等于负EINVAL
3225  退出
3228  val_b等于val_a
3229  如果left
3230  p自加
3231  left自减
3234  如果c恒等于'-'则
3261  first等于0
3262  proc_skip_char( & p, & left, '\n')
3264  释放内存
3265  left加等于skipped
3266  否则
3267  bit_b等于0
3269 left循环
3271  如果bit_a大于等于bitmap_len退出
3276  如果非first
3277  err等于proc_put_char( & buffer, & left, ',')
3278  如果err退出
3282  如果err退出
3284  如果bit_a不等于bit_b
3293  first等于0
3293  bit_b自加
3295  如果非errerr等于proc_put_char( & buffer, & left, '\n')
3299  如果非err
3300  如果write
3306  lenp减等于left
3307  ppos加等于lenp
3310  bitmap_free(tmp_bitmap)
3311  返回:err
调用者
名称描述
proc_watchdog_cpumaskThe cpumask is the mask of possible cpus that the watchdog can run* on, not the mask of cpus it is actually running on. This allows the* user to specify a mask that will include cpus that have not yet* been brought online, if desired.