blk-mq: allow blk_mq_init_commands() to return failure
authorJens Axboe <axboe@fb.com>
Fri, 14 Mar 2014 16:43:15 +0000 (10:43 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:42 +0000 (12:54 -0600)
commitceeb5d0613e08748db4dcb55908191d6b30be830
tree345d3bf0f4933423979edcb234e2dc453621abe7
parent65d6f35fa91ca3d2441a34108c6981ebdfbd5ad3
blk-mq: allow blk_mq_init_commands() to return failure

If drivers do dynamic allocation in the hardware command init
path, then we need to be able to handle and return failures.

And if they do allocations or mappings in the init command path,
then we need a cleanup function to free up that space at exit
time. So add blk_mq_free_commands() as the cleanup function.

This is required for the mtip32xx driver conversion to blk-mq.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c
drivers/block/virtio_blk.c
include/linux/blk-mq.h