• Bart Van Assche's avatar
    null_blk: Fix changing the number of hardware queues · 78b10be2
    Bart Van Assche authored
    Instead of initializing null_blk hardware queues explicitly after the
    request queue has been created, provide .init_hctx() and .exit_hctx()
    callback functions. The latter functions are not only called during
    request queue allocation but also when the number of hardware queues
    changes. Allocate nr_cpu_ids queues during initialization to support
    increasing the number of hardware queues above the initial hardware
    queue count.
    
    This change fixes increasing the number of hardware queues above the
    initial number of hardware queues and also keeps nullb->nr_queues in
    sync with the number of hardware queues.
    
    Fixes: 45919fbf ("null_blk: Enable modifying 'submit_queues' after an instance has been configured")
    Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
    Cc: Johannes Thumshirn <jth@kernel.org>
    Cc: Hannes Reinecke <hare@suse.com>
    Cc: Ming Lei <ming.lei@redhat.com>
    Cc: Christoph Hellwig <hch@infradead.org>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    78b10be2
null_blk_main.c 45.7 KB