diff options
author | Jens Axboe <axboe@fb.com> | 2014-03-14 10:43:15 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-03-14 10:43:15 -0600 |
commit | 95363efde193079541cb379eb47140e9c4d355d5 (patch) | |
tree | da7417035ca5f25d6818430feaa54cb09a2ba86d /include/linux/blk-mq.h | |
parent | 89f8b33ca1ea881d1d84542282cb85d07d02e78d (diff) | |
download | linux-95363efde193079541cb379eb47140e9c4d355d5.tar.gz linux-95363efde193079541cb379eb47140e9c4d355d5.tar.bz2 linux-95363efde193079541cb379eb47140e9c4d355d5.zip |
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>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r-- | include/linux/blk-mq.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 18ba8a627f46..33ff10ebcabb 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -117,7 +117,8 @@ enum { struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); int blk_mq_register_disk(struct gendisk *); void blk_mq_unregister_disk(struct gendisk *); -void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); +int blk_mq_init_commands(struct request_queue *, int (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); +void blk_mq_free_commands(struct request_queue *, void (*free)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); |