函数逻辑报告 | 
Source Code:block\blk-mq.c | 
Create Date:2022-07-27 18:46:24 | 
| Last Modify:2020-03-17 23:18:05 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:blk_mq_alloc_hctx
函数原型:static struct blk_mq_hw_ctx *blk_mq_alloc_hctx(struct request_queue *q, struct blk_mq_tag_set *set, int node)
返回类型:struct blk_mq_hw_ctx
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| struct request_queue * | q | |
| struct blk_mq_tag_set * | set | |
| int | node | 
| 2312 | hctx等于根据内存节点分配内存 | 
| 2313 | 如果非hctx则转到:fail_alloc_hctx | 
| 2316 | 如果非zalloc_cpumask_var_node( & @cpumask: Map of available CPUs where this hctx can run. , gfp, node)则转到:free_hctx | 
| 2319 | atomic_set( & @nr_active: Number of active requests. Only used when a tag set is* shared across request queues., 0) | 
| 2320 | 如果node恒等于NUMA_NO_NODE则node等于numa_node | 
| 2324 | INIT_DELAYED_WORK( & @run_work: Used for scheduling a hardware queue run at a later time., blk_mq_run_work_fn) | 
| 2326 | 初始化链表头 | 
| 2330 | 初始化链表头 | 
| 2336 | @ctxs: Array of software queues. 等于kmalloc_array_node(CPU数量, *的长度, gfp, node) | 
| 2338 | 如果非@ctxs: Array of software queues. 则转到:free_cpumask | 
| 2344 | @nr_ctx: Number of software queues. 等于0 | 
| 2347 | init_waitqueue_func_entry( & @dispatch_wait: Waitqueue to put requests when there is no tag* available at the moment, to wait for another try in the future., blk_mq_dispatch_wake) | 
| 2348 | 初始化链表头 | 
| 2350 | @fq: Queue of requests that need to perform a flush operation. 等于blk_alloc_flush_queue(q, @numa_node: NUMA node the storage adapter has been connected to. , cmd_size, gfp) | 
| 2357 | blk_mq_hctx_kobj_init(hctx) | 
| 2359 | 返回:hctx | 
| 2361 | free_bitmap : | 
| 2363 | free_ctxs : | 
| 2364 | 释放内存 | 
| 2365 | free_cpumask : | 
| 2366 | 释放CPU掩码 | 
| 2367 | free_hctx : | 
| 2368 | 释放内存 | 
| 2369 | fail_alloc_hctx : | 
| 2370 | 返回:NULL | 
| 名称 | 描述 | 
|---|---|
| blk_mq_alloc_and_init_hctx | 
| 源代码转换工具 开放的插件接口  | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码  |