Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-core.c Create Date:2022-07-28 16:59:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bio_attempt_discard_merge

Proto:bool bio_attempt_discard_merge(struct request_queue *q, struct request *req, struct bio *bio)

Type:bool

Parameter:

TypeParameterName
struct request_queue *q
struct request *req
struct bio *bio
651  segments = Number of discard segments (or ranges) the driver needs to fill in.* Each discard bio merged into a request is counted as one segment.
653  If segments >= queue_max_discard_segments(q) Then Go to no_merge
655  If blk_rq_sectors(req) + bio_sectors(bio) > blk_rq_get_max_sectors(req, lk_rq_pos() : the current sector* blk_rq_bytes() : bytes left in the entire request* blk_rq_cur_bytes() : bytes left in the current segment* blk_rq_err_bytes() : bytes left till the next error boundary* blk_rq_sectors() : sectors left in the entire ) Then Go to no_merge
659  rq_qos_merge(q, req, bio)
661  request queue link = bio
662  biotail = bio
663  total data len += residual I/O count
664  * Number of scatter-gather DMA addr+len pairs after * physical address coalescing is performed. = segments + 1
666  blk_account_io_start(req, false)
667  Return true
668  no_merge :
669  req_set_nomerge(q, req)
670  Return false
Caller
NameDescribe
blk_attempt_plug_mergelk_attempt_plug_merge - try to merge with %current's plugged list*@q: request_queue new bio is being queued at*@bio: new bio being queued*@nr_segs: number of segments in @bio*@same_queue_rq: pointer to &struct request that gets filled in when* another
blk_mq_sched_try_merge
blk_mq_bio_list_mergeIterate list of requests and see if we can merge this bio with any* of them.