| Function report | 
| Source Code: block\blk-mq.c | Create Date:2022-07-28 17:08:45 | 
| Last Modify:2020-03-17 23:18:05 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:blk_mq_alloc_request_hctx
Proto:struct request *blk_mq_alloc_request_hctx(struct request_queue *q, unsigned int op, blk_mq_req_flags_t flags, unsigned int hctx_idx)
Type:struct request
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct request_queue * | q | |
| unsigned int | op | |
| blk_mq_req_flags_t | flags | |
| unsigned int | hctx_idx | 
| 427 | struct blk_mq_alloc_data alloc_data = {flags = flags, cmd_flags = op} | 
| 438 | If WARN_ON_ONCE(!(flags & BLK_MQ_REQ_NOWAIT)) Then Return ERR_PTR( - EINVAL) | 
| 441 | If hctx_idx >= nr_hw_queues Then Return ERR_PTR( - EIO) | 
| 444 | ret = lk_queue_enter() - try to increase q->q_usage_counter*@q: request queue pointer*@flags: BLK_MQ_REQ_NOWAIT and/or BLK_MQ_REQ_PREEMPT | 
| 452 | hctx = hw dispatch queues [hctx_idx] | 
| 453 | If Not blk_mq_hw_queue_mapped(hctx) Then | 
| 454 | blk_queue_exit(q) | 
| 458 | input & output parameter = __blk_mq_get_ctx(q, cpu) | 
| 460 | rq = blk_mq_get_request(q, NULL, & alloc_data) | 
| 461 | blk_queue_exit(q) | 
| 463 | If Not rq Then Return ERR_PTR( - EWOULDBLOCK) | 
| 466 | Return rq | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |