Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\sbitmap.h Create Date:2022-07-28 07:22:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__sbitmap_for_each_set() - Iterate over each set bit in a &struct sbitmap

Proto:static inline void __sbitmap_for_each_set(struct sbitmap *sb, unsigned int start, sb_for_each_fn fn, void *data)

Type:void

Parameter:

TypeParameterName
struct sbitmap *sb
unsigned intstart
sb_for_each_fnfn
void *data
240  scanned = 0
242  If start >= @depth: Number of bits used in the whole bitmap. Then start = 0
244  index = SB_NR_TO_INDEX(sb, start)
245  nr = SB_NR_TO_BIT(sb, start)
247  When scanned < @depth: Number of bits used in the whole bitmap. cycle
249  depth = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedint, @depth: Number of bits being used in @word/@cleared - nr, @depth: Number of bits used in the whole bitmap. - scanned)
253  scanned += depth
254  word = @word: word holding free bits & ~@cleared: word holding cleared bits
255  If Not word Then Go to next
263  depth += nr
264  When 1 cycle
266  If nr >= depth Then Break
268  If Not fn(sb, (index << @shift: log2(number of bits used per word)) + nr, data) Then Return
271  nr++
273  :
274  nr = 0
275  If ++index >= @map_nr: Number of words (cachelines) being used for the bitmap. Then index = 0
Caller
NameDescribe
blk_mq_dequeue_from_ctx