Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-28 17:08:39
Last Modify:2020-03-17 23:18:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:blk_mq_get_request

Proto:static struct request *blk_mq_get_request(struct request_queue *q, struct bio *bio, struct blk_mq_alloc_data *data)

Type:struct request

Parameter:

TypeParameterName
struct request_queue *q
struct bio *bio
struct blk_mq_alloc_data *data
338  e = elevator
341  bool clear_ctx_on_error = false
342  alloc_time_ns = 0
344  blk_queue_enter_live(q)
347  If blk_queue_rq_alloc_time(q) Then alloc_time_ns = ktime_get_ns()
350  input parameter = q
351  If Value is more likely to compile time(! input & output parameter ) Then
352  input & output parameter = This assumes per-cpu software queueing queues. They could be per-node* as well, for instance. For now this is hardcoded as-is. Note that we don't* care about preemption, since we know the ctx's are persistent. This does
353  clear_ctx_on_error = true
355  If Value is more likely to compile time(!hctx) Then hctx = lk_mq_map_queue() - map (cmd_flags,type) to hardware queue*@q: request queue*@flags: request command flags*@cpu: cpu ctx
358  If cmd_flags & REQ_NOWAIT Then flags |= BLK_MQ_REQ_NOWAIT
361  If e Then
362  flags |= BLK_MQ_REQ_INTERNAL
369  If Not Check if the bio or request is one that needs special treatment in the* flush state machine. && limit_depth && Not (flags & BLK_MQ_REQ_RESERVED) Then limit_depth(cmd_flags, data)
373  Else
374  blk_mq_tag_busy(hctx)
377  tag = blk_mq_get_tag(data)
378  If tag == BLK_MQ_TAG_FAIL Then
379  If clear_ctx_on_error Then input & output parameter = NULL
381  blk_queue_exit(q)
382  Return NULL
385  rq = blk_mq_rq_ctx_init(data, tag, cmd_flags, alloc_time_ns)
386  If Not Check if the bio or request is one that needs special treatment in the* flush state machine. Then
387  icq = NULL
388  If e && prepare_request Then
396  @queued: Number of queued requests. ++
397  Return rq
Caller
NameDescribe
blk_mq_alloc_request
blk_mq_alloc_request_hctx
blk_mq_make_request