函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Alloc a tag set to be associated with one or more request queues.* May fail with EINVAL for various error conditions. May adjust the* requested depth down, if it's too large. In that case, the set* value will be stored in set->queue_depth.

函数原型:int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)

返回类型:int

参数:

类型参数名称
struct blk_mq_tag_set *set
3024  BUILD_BUG_ON - break compile if a condition is true(BLK_MQ_MAX_DEPTH > 1 << BLK_MQ_UNIQUE_TAG_BITS)
3026  如果非nr_hw_queues则返回:负EINVAL
3028  如果非queue_depth则返回:负EINVAL
3030  如果queue_depth小于reserved_tagsBLK_MQ_TAG_MIN则返回:负EINVAL
3033  如果非queue_rq则返回:负EINVAL
3036  如果非get_budget按位异或非put_budget则返回:负EINVAL
3039  如果queue_depth大于BLK_MQ_MAX_DEPTH
3040  打印信息("blk-mq: reduced tag depth to %u\n", BLK_MQ_MAX_DEPTH)
3042  queue_depth等于BLK_MQ_MAX_DEPTH
3045  如果非nr_mapsnr_maps等于1
3047  否则如果nr_maps大于HCTX_MAX_TYPES则返回:负EINVAL
3055  如果is_kdump_kernel()则
3056  nr_hw_queues等于1
3057  nr_maps等于1
3058  queue_depth等于两数取小(64U, queue_depth)
3064  如果nr_maps恒等于1且nr_hw_queues大于CPU数量nr_hw_queues等于CPU数量
3067  如果blk_mq_realloc_tag_set_tags(set, 0, nr_hw_queues)小于0则返回:负ENOMEM
3070  ret等于负ENOMEM
3071 i小于nr_maps循环
3072  mq_map等于kcalloc_node(CPU数量, mq_map[0]的长度, GFP_KERNEL, numa_node)
3075  如果非mq_map则转到:out_free_mq_map
3077  nr_queues等于如果is_kdump_kernel()则1否则nr_hw_queues
3080  ret等于blk_mq_update_queue_map(set)
3081  如果ret则转到:out_free_mq_map
3084  ret等于Allocate the request maps associated with this tag_set. Note that this* may reduce the depth asked for, if memory is tight. set->queue_depth* will be updated to reflect the allocated depth.
3085  如果ret则转到:out_free_mq_map
3088  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & tag_list_lock)
3089  初始化链表头
3091  返回:0
3093  out_free_mq_map :
3094 i小于nr_maps循环
3095  释放内存
3096  mq_map = NULL
3098  释放内存
3099  tags = NULL
3100  返回:ret
调用者
名称描述
blk_mq_init_sq_queueHelper for setting up a queue with mq ops, given queue depth, and* the passed in mq ops flags.
bsg_setup_queuesg_setup_queue - Create and add the bsg hooks so we can receive requests*@dev: device to attach bsg device to*@name: device to give bsg device*@job_fn: bsg job handler*@timeout: timeout handler function pointer*@dd_job_size: size of LLD data needed for