函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:_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

函数原型:struct bio *bio_alloc_bioset(gfp_t gfp_mask, unsigned int nr_iovecs, struct bio_set *bs)

返回类型:struct bio

参数:

类型参数名称
gfp_tgfp_mask
unsigned intnr_iovecs
struct bio_set *bs
432  saved_gfp等于gfp_mask
435  struct bio_vec * bvl = NULL
439  如果非bs
440  如果nr_iovecs大于UIO_MAXIOV则返回:NULL
443  p等于开辟内存
446  front_pad等于0
447  inline_vecs等于nr_iovecs
448  否则
450  如果WARN_ON_ONCE(!mempool_initialized( & bvec_pool) && nr_iovecs > 0)则返回:NULL
474  如果bio_list且非bio_list_empty( & bio_list[0])或非bio_list_empty( & bio_list[1])的值且rescue_workqueuegfp_mask与等于Caller can reclaim 的反
480  p等于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
481  如果非pgfp_mask不等于saved_gfp
483  gfp_mask等于saved_gfp
487  front_pad等于front_pad
488  inline_vecs等于Test patch to inline a certain number of bi_io_vec's inside the bio* itself, to shrink a bio data allocation from two mempool calls to one
491  如果此条件成立可能性小(为编译器优化)(!p)则返回:NULL
494  bio等于pfront_pad
495  Users of this function have their own bio allocation. Subsequently,* they must remember to pair any call to bio_init() with bio_uninit()* when IO has completed, or when the bio is released.
497  如果nr_iovecs大于inline_vecs
498  idx等于0
500  bvl等于bvec_alloc(gfp_mask, nr_iovecs, & idx, & bvec_pool)
501  如果非bvlgfp_mask不等于saved_gfp
503  gfp_mask等于saved_gfp
507  如果此条件成立可能性小(为编译器优化)(!bvl)则转到:err_free
510  status, etc and bvec pool number 或等于idx左移BVEC_POOL_OFFSET
511  否则如果nr_iovecs
512  bvl等于* We can inline a number of vecs at the end of the bio, to avoid * double allocations for a small number of bio_vecs. This member * MUST obviously be kept at the very end of the bio.
515  bi_pool等于bs
516  max bvl_vecs we can hold 等于nr_iovecs
517  the actual vec list 等于bvl
518  返回:bio
520  err_free :
521  mempool_free - return an element to the pool.*@element: pool element pointer.*@pool: pointer to the memory pool which was allocated via* mempool_create().* this function only sleeps if the free_fn() function sleeps.
522  返回:NULL
调用者
名称描述
bio_clone_fast_clone_fast - clone a bio that shares the original bio's biovec*@bio: bio to clone*@gfp_mask: allocation priority*@bs: bio_set to allocate from* Like __bio_clone_fast, only also allocates the returned bio
bounce_clone_bio
iomap_alloc_ioend
bio_alloc
bio_kmalloc