Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:For non-mq, this has to be called with the request spinlock acquired.* For mq with scheduling, the appropriate queue wide lock should be held.

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

Type:struct request

Parameter:

TypeParameterName
struct request_queue *q
struct request *req
struct request *next
747  If Not rq_mergeable(req) || Not rq_mergeable(next) Then Return NULL
750  If req_op(req) != req_op(next) Then Return NULL
753  If rq_data_dir(req) != rq_data_dir(next) || rq_disk != rq_disk Then Return NULL
757  If req_op(req) == REQ_OP_WRITE_SAME && Not blk_write_same_mergeable(bio, bio) Then Return NULL
765  If write_hint != write_hint Then Return NULL
768  If ioprio != ioprio Then Return NULL
780  Case blk_try_req_merge(req, next) == ELEVATOR_DISCARD_MERGE
781  If Not req_attempt_discard_merge(q, req, next) Then Return NULL
783  Break
784  Case blk_try_req_merge(req, next) == ELEVATOR_BACK_MERGE
785  If Not ll_merge_requests_fn(q, req, next) Then Return NULL
787  Break
788  Default
789  Return NULL
798  If (rq_flags | rq_flags) & merge of different types, fail separately || ( op and common flags & REQ_FAILFAST_MASK) != ( op and common flags & REQ_FAILFAST_MASK) Then
801  lk_rq_set_mixed_merge - mark a request as mixed merge*@rq: request to mark as mixed merge* Description:*@rq is about to be mixed merged. Make sure the attributes* which can be mixed are set in each bio and mark @rq as mixed* merged.
802  lk_rq_set_mixed_merge - mark a request as mixed merge*@rq: request to mark as mixed merge* Description:*@rq is about to be mixed merged. Make sure the attributes* which can be mixed are set in each bio and mark @rq as mixed* merged.
810  If Time that this request was allocated for this IO. < Time that this request was allocated for this IO. Then Time that this request was allocated for this IO. = Time that this request was allocated for this IO.
813  request queue link = bio
814  biotail = biotail
816  total data len += blk_rq_bytes(next)
818  If Not Two cases of handling DISCARD merge:* If max_discard_segments > 1, the driver takes every bio* as a range and send them to controller together. The ranges* needn't to be contiguous.* Otherwise, the bios/requests will be handled as same as Then elv_merge_requests(q, req, next)
824  blk_account_io_merge(next)
830  bio = NULL
831  Return next
Caller
NameDescribe
attempt_back_merge
attempt_front_merge
blk_attempt_req_merge