Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:req_attempt_discard_merge

Proto:static bool req_attempt_discard_merge(struct request_queue *q, struct request *req, struct request *next)

Type:bool

Parameter:

TypeParameterName
struct request_queue *q
struct request *req
struct request *next
627  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.
629  If segments >= queue_max_discard_segments(q) Then Go to no_merge
631  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
635  * Number of scatter-gather DMA addr+len pairs after * physical address coalescing is performed. = 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.
636  Return true
637  no_merge :
638  req_set_nomerge(q, req)
639  Return false
Caller
NameDescribe
attempt_mergeFor non-mq, this has to be called with the request spinlock acquired.* For mq with scheduling, the appropriate queue wide lock should be held.