函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sbitmap_init_node

函数原型:int sbitmap_init_node(struct sbitmap *sb, unsigned int depth, int shift, gfp_t flags, int node)

返回类型:int

参数:

类型参数名称
struct sbitmap *sb
unsigned intdepth
intshift
gfp_tflags
intnode
50  如果shift小于0则
51  shift等于log2 - log base 2 of 32-bit or a 64-bit unsigned value*@n: parameter* constant-capable log of base 2 calculation* - this can be used to initialise global variables from constant data, hence* the massive ternary operator construction* selects the (BITS_PER_LONG)
58  如果depth大于等于4则
59  当4U左移shift位大于depth循环
60  shift自减
63  bits_per_word等于1U左移shift
64  如果bits_per_word大于BITS_PER_LONG则返回:负EINVAL
67  @shift: log2(number of bits used per word)等于shift
68  @depth: Number of bits used in the whole bitmap.等于depth
69  @map_nr: Number of words (cachelines) being used for the bitmap.等于DIV_ROUND_UP(@depth: Number of bits used in the whole bitmap., bits_per_word)
71  如果depth恒等于0则
72  @map: Allocated bitmap. = NULL
73  返回:0
76  @map: Allocated bitmap.等于kcalloc_node(@map_nr: Number of words (cachelines) being used for the bitmap., @map: Allocated bitmap.的长度, flags, node)
77  如果非@map: Allocated bitmap.则返回:负ENOMEM
80 i小于@map_nr: Number of words (cachelines) being used for the bitmap.循环
81  @depth: Number of bits being used in @word/@cleared等于两数取小(depth, bits_per_word)
82  depth减等于@depth: Number of bits being used in @word/@cleared
83  spin_lock_init( & @swap_lock: Held while swapping word <-> cleared)
85  返回:0
调用者
名称描述
sbitmap_queue_init_node
kyber_init_hctx
blk_mq_alloc_hctx