函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq.c Create Date:2022-07-27 18:44:05
Last Modify:2020-03-17 23:18:05 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:blk_mq_alloc_request_hctx

函数原型:struct request *blk_mq_alloc_request_hctx(struct request_queue *q, unsigned int op, blk_mq_req_flags_t flags, unsigned int hctx_idx)

返回类型:struct request

参数:

类型参数名称
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  如果WARN_ON_ONCE(!(flags & BLK_MQ_REQ_NOWAIT))则返回:错误号
441  如果hctx_idx大于等于nr_hw_queues则返回:错误号
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  如果ret则返回:错误号
452  hctx等于 hw dispatch queues [hctx_idx]
453  如果非blk_mq_hw_queue_mapped(hctx)则
454  blk_queue_exit(q)
455  返回:错误号
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  如果非rq则返回:错误号
466  返回:rq