Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bio.c Create Date:2022-07-28 16:54:39
Last Modify:2020-03-17 23:13:58 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bvec_alloc

Proto:struct bio_vec *bvec_alloc(gfp_t gfp_mask, int nr, unsigned long *idx, mempool_t *pool)

Type:struct bio_vec

Parameter:

TypeParameterName
gfp_tgfp_mask
intnr
unsigned long *idx
mempool_t *pool
178  Case nr == 1
179  idx = 0
180  Break
181  Case nr == 2...4
182  idx = 1
183  Break
184  Case nr == 5...16
185  idx = 2
186  Break
187  Case nr == 17...64
188  idx = 3
189  Break
190  Case nr == 65...128
191  idx = 4
192  Break
193  Case nr == 129...BIO_MAX_PAGES
194  idx = 5
195  Break
196  Default
197  Return NULL
204  If idx == BVEC_POOL_MAX Then
205  fallback :
206  bvl = mempool_alloc - allocate an element from a specific memory pool*@pool: pointer to the memory pool which was allocated via* mempool_create().*@gfp_mask: the usual allocation bitmask.* this function only sleeps if the alloc_fn() function sleeps or
207  Else
208  bvs = bvec_slabs + idx
209  __gfp_mask = gfp_mask & ~(Caller can reclaim | DOC: Reclaim modifiers* Reclaim modifiers* ~~~~~~~~~~~~~~~~~* %__GFP_IO can start physical IO.* %__GFP_FS can call down to the low-level FS. Clearing the flag avoids the* allocator recursing into the filesystem which might already be holding* locks.)
216  __gfp_mask |= __GFP_NOMEMALLOC | __GFP_NORETRY | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
222  bvl = kmem_cache_alloc(slab, __gfp_mask)
224  idx = BVEC_POOL_MAX
225  Go to fallback
229  idx++
230  Return bvl
Caller
NameDescribe
bio_alloc_bioset_alloc_bioset - allocate a bio for I/O*@gfp_mask: the GFP_* mask given to the slab allocator*@nr_iovecs: number of iovecs to pre-allocate*@bs: the bio_set to allocate from
bio_integrity_alloc_integrity_alloc - Allocate integrity payload and attach it to bio*@bio: bio to attach integrity metadata to*@gfp_mask: Memory allocation mask*@nr_vecs: Number of integrity metadata scatter-gather elements* Description: This function prepares a bio for