Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-mq-tag.c Create Date:2022-07-28 17:12:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:blk_mq_get_tag

Proto:unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)

Type:unsigned int

Parameter:

TypeParameterName
struct blk_mq_alloc_data *data
104  tags = blk_mq_tags_from_data(data)
111  If flags & BLK_MQ_REQ_RESERVED Then
113  WARN_ON_ONCE(1)
114  Return BLK_MQ_TAG_FAIL
116  bt = breserved_tags
117  tag_offset = 0
118  Else
119  bt = bitmap_tags
120  tag_offset = nr_reserved_tags
123  tag = __blk_mq_get_tag(data, bt)
124  If tag != -1 Then Go to found_tag
127  If flags & BLK_MQ_REQ_NOWAIT Then Return BLK_MQ_TAG_FAIL
130  ws = bt_wait_ptr(bt, hctx)
131  Do
139  blk_mq_run_hw_queue(hctx, false)
145  tag = __blk_mq_get_tag(data, bt)
146  If tag != -1 Then Break
149  sbitmap_prepare_to_wait(bt, ws, & wait, TASK_UNINTERRUPTIBLE)
151  tag = __blk_mq_get_tag(data, bt)
152  If tag != -1 Then Break
155  bt_prev = bt
156  io_schedule()
158  sbitmap_finish_wait(bt, ws, & wait)
160  input & output parameter = This assumes per-cpu software queueing queues. They could be per-node* as well, for instance. For now this is hardcoded as-is. Note that we don't* care about preemption, since we know the ctx's are persistent. This does
161  hctx = lk_mq_map_queue() - map (cmd_flags,type) to hardware queue*@q: request queue*@flags: request command flags*@cpu: cpu ctx
163  tags = blk_mq_tags_from_data(data)
164  If flags & BLK_MQ_REQ_RESERVED Then bt = breserved_tags
166  Else bt = bitmap_tags
174  If bt != bt_prev Then sbitmap_queue_wake_up(bt_prev)
177  ws = bt_wait_ptr(bt, hctx)
178  When 1 cycle
180  sbitmap_finish_wait(bt, ws, & wait)
182  found_tag :
183  Return tag + tag_offset
Caller
NameDescribe
blk_mq_get_driver_tag