函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blk_mq_init_allocated_queue

函数原型:struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, struct request_queue *q, bool elevator_init)

返回类型:struct request_queue

参数:

类型参数名称
struct blk_mq_tag_set *set
struct request_queue *q
boolelevator_init
2830  mq_ops等于ops
2832  poll_cb等于lk_stat_alloc_callback() - Allocate a block statistics callback.*@timer_fn: Timer callback function.*@bucket_fn: Bucket callback function.*@buckets: Number of statistics buckets.*@data: Value for the @data field of the &struct blk_stat_callback.
2835  如果非poll_cb则转到:err_exit
2838  如果All allocations will be freed in release handler of q->mq_kobj 则转到:err_poll
2842  sysfs helpers
2844  初始化链表头
2845  spin_lock_init( & unused_hctx_lock)
2847  blk_mq_realloc_hw_ctxs(set, q)
2848  如果非nr_hw_queues则转到:err_hctxs
2851  INIT_WORK( & timeout_work, blk_mq_timeout_work)
2852  blk_queue_rq_timeout(q, timeout ? timeout : 30 * HZ)
2854  tag_set等于set
2856  * various queue flags, see QUEUE_* below或等于QUEUE_FLAG_MQ_DEFAULT
2857  如果nr_maps大于HCTX_TYPE_POLLnr_queueslk_queue_flag_set - atomically set a queue flag*@flag: flag to be set*@q: request queue
2861  sg_reserved_size等于INT_MAX
2863  INIT_DELAYED_WORK( & requeue_work, blk_mq_requeue_work)
2864  初始化链表头
2865  spin_lock_init( & requeue_lock)
2867  为设备定义一个备用make_request功能
2872  Max # of requests 等于queue_depth
2877  poll_nsec等于Doing classic polling
2879  blk_mq_init_cpu_queues(q, nr_hw_queues)
2880  blk_mq_add_queue_tag_set(set, q)
2881  blk_mq_map_swqueue(q)
2883  如果elevator_initFor a device queue that has no required features, use the default elevator* settings. Otherwise, use the first elevator available matching the required* features. If no suitable elevator is find or if the chosen elevator
2886  返回:q
2888  err_hctxs :
2889  释放内存
2890  nr_hw_queues等于0
2891  blk_mq_sysfs_deinit(q)
2892  err_poll :
2893  lk_stat_free_callback() - Free a block statistics callback
2894  poll_cb = NULL
2895  err_exit :
2896  mq_ops = NULL
2897  返回:错误号
调用者
名称描述
blk_mq_init_queue