函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__blk_bios_map_sg

函数原型:static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, struct scatterlist *sglist, struct scatterlist **sg)

返回类型:int

参数:

类型参数名称
struct request_queue *q
struct bio *bio
struct scatterlist *sglist
struct scatterlist **sg
486  struct bio_vec bvec = bvec, bvprv = {NULL}
488  nsegs等于0
489  bool new_bio = false
492  rate over multi-page bvec (bvec, bio, iter)
498  如果new_bioly try to merge bvecs into one sg if they are from two bios 则转到:next_bvec
502  如果bv_offsetbv_len小于等于PAGE_SIZEnsegs加等于__blk_bvec_map_sg(bvec, sglist, sg)
504  否则nsegs加等于blk_bvec_map_sg(q, & bvec, sglist, sg)
506  next_bvec :
507  new_bio = false
509  如果此条件成立可能性大(为编译器优化)( residual I/O count )则
510  bvprv等于bvec
511  new_bio = true
515  返回:nsegs
调用者
名称描述
blk_rq_map_sgmap a request to scatterlist, return number of sg entries setup. Caller* must make sure sg can hold rq->nr_phys_segments entries