Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)

Type:int

Parameter:

TypeParameterName
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  If Not nr_hw_queues Then Return -EINVAL
3028  If Not queue_depth Then Return -EINVAL
3030  If queue_depth < reserved_tags + BLK_MQ_TAG_MIN Then Return -EINVAL
3033  If Not queue_rq Then Return -EINVAL
3036  If Not get_budget ^ Not put_budget Then Return -EINVAL
3039  If queue_depth > BLK_MQ_MAX_DEPTH Then
3040  pr_info("blk-mq: reduced tag depth to %u\n", BLK_MQ_MAX_DEPTH)
3042  queue_depth = BLK_MQ_MAX_DEPTH
3045  If Not nr_maps Then nr_maps = 1
3047  Else if nr_maps > HCTX_MAX_TYPES Then Return -EINVAL
3055  If is_kdump_kernel() Then
3056  nr_hw_queues = 1
3057  nr_maps = 1
3058  queue_depth = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(64U, queue_depth)
3064  If nr_maps == 1 && nr_hw_queues > Setup number of possible processor ids Then nr_hw_queues = Setup number of possible processor ids
3067  If blk_mq_realloc_tag_set_tags(set, 0, nr_hw_queues) < 0 Then Return -ENOMEM
3070  ret = -ENOMEM
3071  When i < nr_maps cycle
3072  mq_map = kcalloc_node(Setup number of possible processor ids , size of mq_map[0] , GFP_KERNEL, numa_node)
3075  If Not mq_map Then Go to out_free_mq_map
3077  nr_queues = If is_kdump_kernel() Then 1 Else nr_hw_queues
3080  ret = blk_mq_update_queue_map(set)
3081  If ret Then Go to 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  If ret Then Go to 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  Initialization list head
3091  Return 0
3093  out_free_mq_map :
3094  When i < nr_maps cycle
3095  kfree(mq_map)
3096  mq_map = NULL
3098  kfree(tags)
3099  tags = NULL
3100  Return ret
Caller
NameDescribe
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