return blk_init_queue_node(rfn, lock, NUMA_NO_NODE); } EXPORT_SYMBOL(blk_init_queue); struct request_queue * blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) { struct request_queue *uninit_q, *q; uninit_q = blk_alloc_queue_node(GFP_KERNEL, node_id); ...
staticintramblock_init(void){/* 1. 分配一个gendisk结构体 */ramblock_disk = alloc_disk(16);/* 次设备号个数: 分区个数+1 *//* 2. 设置 *//* 2.1 分配/设置队列: 提供读写能力 */ramblock_queue =blk_init_queue(do_ramblock_request, &ramblock_lock); ramblock_disk->queue= ramblock_...
Memory is allocated for q->fq in the blk_init_allocated_queue(). If the elevator init function called with error return, it will run into the fail case to free the q->fq. Then the __blk_drain_queue() uses the same memory after the free of the q->fq, it will lead to the ...