diff options
author | Christoph Hellwig <hch@lst.de> | 2014-04-15 13:59:10 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-04-15 14:03:03 -0600 |
commit | e9b267d91f6ddbc694cb40aa962b0b2cec03971d (patch) | |
tree | 6b9fac74ad40dfc7b57f701a8ae0454c42a71554 /firmware | |
parent | 8727af4b9d45c7503042e3fbd926c1a173876e9c (diff) |
blk-mq: add ->init_request and ->exit_request methods
The current blk_mq_init_commands/blk_mq_free_commands interface has a
two problems:
1) Because only the constructor is passed to blk_mq_init_commands there
is no easy way to clean up when a comman initialization failed. The
current code simply leaks the allocations done in the constructor.
2) There is no good place to call blk_mq_free_commands: before
blk_cleanup_queue there is no guarantee that all outstanding
commands have completed, so we can't free them yet. After
blk_cleanup_queue the queue has usually been freed. This can be
worked around by grabbing an unconditional reference before calling
blk_cleanup_queue and dropping it after blk_mq_free_commands is
done, although that's not exatly pretty and driver writers are
guaranteed to get it wrong sooner or later.
Both issues are easily fixed by making the request constructor and
destructor normal blk_mq_ops methods.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions