• Jens Axboe's avatar
    [PATCH] Proper block queue reference counting · ace416a3
    Jens Axboe authored
    To be able to properly be able to keep references to block queues,
    we make blk_init_queue() return the queue that it initialized, and
    let it be independently allocated and then cleaned up on the last
    reference.
    
    I have grepped high and low, and there really shouldn't be any broken
    uses of blk_init_queue() in the kernel drivers left.  The added bonus
    being blk_init_queue() error checking is explicit now, most of the
    drivers were broken in this regard (even IDE/SCSI).
    
    No drivers have embedded request queue structures. Drivers that don't
    use blk_init_queue() but blk_queue_make_request(), should allocate the
    queue with blk_alloc_queue(gfp_mask). I've converted all of them to do
    that, too. They can call blk_cleanup_queue() now too, using the define
    blk_put_queue() is probably cleaner though.
    ace416a3
optcd.c 50.5 KB