Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_mq_alloc_request_hctx

Proto:struct request *blk_mq_alloc_request_hctx(struct request_queue *q, unsigned int op, blk_mq_req_flags_t flags, unsigned int hctx_idx)

Type:struct request

Parameter:

TypeParameterName
struct request_queue *q
unsigned intop
blk_mq_req_flags_tflags
unsigned inthctx_idx
427  struct blk_mq_alloc_data alloc_data = {flags = flags, cmd_flags = op}
438  If WARN_ON_ONCE(!(flags & BLK_MQ_REQ_NOWAIT)) Then Return ERR_PTR( - EINVAL)
441  If hctx_idx >= nr_hw_queues Then Return ERR_PTR( - EIO)
444  ret = lk_queue_enter() - try to increase q->q_usage_counter*@q: request queue pointer*@flags: BLK_MQ_REQ_NOWAIT and/or BLK_MQ_REQ_PREEMPT
445  If ret Then Return ERR_PTR(ret)
452  hctx = hw dispatch queues [hctx_idx]
453  If Not blk_mq_hw_queue_mapped(hctx) Then
454  blk_queue_exit(q)
455  Return ERR_PTR( - EXDEV)
457  cpu = cpumask_first_and - return the first cpu from *srcp1 & *srcp2*@src1p: the first input*@src2p: the second input* Returns >= nr_cpu_ids if no cpus set in both. See also cpumask_next_and().(@cpumask: Map of available CPUs where this hctx can run. , cpu_online_mask)
458  input & output parameter = __blk_mq_get_ctx(q, cpu)
460  rq = blk_mq_get_request(q, NULL, & alloc_data)
461  blk_queue_exit(q)
463  If Not rq Then Return ERR_PTR( - EWOULDBLOCK)
466  Return rq