Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_mq_init_allocated_queue

Proto:struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, struct request_queue *q, bool elevator_init)

Type:struct request_queue

Parameter:

TypeParameterName
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  If Not poll_cb Then Go to err_exit
2838  If All allocations will be freed in release handler of q->mq_kobj Then Go to err_poll
2842  sysfs helpers
2844  Initialization list head
2845  Process spin lock initialization( & unused_hctx_lock)
2847  blk_mq_realloc_hw_ctxs(set, q)
2848  If Not nr_hw_queues Then Go to 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  If nr_maps > HCTX_TYPE_POLL && nr_queues Then lk_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  Initialization list head
2865  Process spin lock initialization( & requeue_lock)
2867  define an alternate make_request function for a device
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  If elevator_init Then For 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  Return q
2888  err_hctxs :
2889  kfree( hw dispatch queues )
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  Return ERR_PTR( - ENOMEM)
Caller
NameDescribe
blk_mq_init_queue