函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bio.c Create Date:2022-07-27 18:29:44
Last Modify:2020-03-17 23:13:58 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:bio_find_or_create_slab

函数原型:static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size)

返回类型:struct kmem_cache

参数:

类型参数名称
unsigned intextra_size
64  sz等于sizeof(structbio)加extra_size
65  struct kmem_cache * slab = NULL
68  entry等于负1
70  mutex_lock( & bio_slab_lock)
72  i等于0
73 i小于bio_slab_nr循环
74  bslab等于bio_slabs[i]
76  如果非slabentry恒等于负1则entry等于i
78  否则如果slab_size恒等于sz
79  slab等于slab
80  slab_ref自加
81  退出
83  i自加
86  如果slab则转到:out_unlock
89  如果bio_slab_nr恒等于bio_slab_maxentry恒等于负1则
90  new_bio_slab_max等于bio_slab_max左移1位
91  new_bio_slabs等于krealloc - reallocate memory. The contents will remain unchanged.*@p: object to reallocate memory for.*@new_size: how many bytes of memory are required.*@flags: the type of memory to allocate.* The contents of the object pointed to are preserved up to the
94  如果非new_bio_slabs则转到:out_unlock
96  bio_slab_max等于new_bio_slab_max
97  bio_slabs等于new_bio_slabs
99  如果entry恒等于负1则entry等于bio_slab_nr自加
102  bslab等于bio_slabs[entry]
104  snprintf - 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*@
105  slab等于创建高速缓存区
107  如果非slab则转到:out_unlock
110  slab等于slab
111  slab_ref等于1
112  slab_size等于sz
113  out_unlock :
114  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
115  返回:slab
调用者
名称描述
bioset_initset_init - Initialize a bio_set*@bs: pool to initialize*@pool_size: Number of bio and bio_vecs to cache in the mempool*@front_pad: Number of bytes to allocate in front of the returned bio*@flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS* and