bdev: Add spdk_bdev_io_get_io_channel API

Currently struct bdev_io holds io_channel that the I/O was submitted
on through bdev_io::bdev_channel, but bdev_io::bdev_channel is private
in bdev.c and cannot be referenced in other files.

Hence add an new API spdk_bdev_io_get_io_channel API to get io_channel
coniveniently.

Change-Id: Ic2e2fde845d324f7a1637e3c75080727a62de5ec
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/443843
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-02-08 14:20:52 +09:00 committed by Jim Harris
parent 39995cdadb
commit 1b2f095865
2 changed files with 14 additions and 0 deletions

View File

@ -761,6 +761,14 @@ void spdk_bdev_io_complete_scsi_status(struct spdk_bdev_io *bdev_io, enum spdk_s
*/
struct spdk_thread *spdk_bdev_io_get_thread(struct spdk_bdev_io *bdev_io);
/**
* Get the bdev module's I/O channel that the given bdev_io was submitted on.
*
* \param bdev_io I/O
* \return the bdev module's I/O channel that the given bdev_io was submitted on.
*/
struct spdk_io_channel *spdk_bdev_io_get_io_channel(struct spdk_bdev_io *bdev_io);
/**
* Resize for a bdev.
*

View File

@ -3459,6 +3459,12 @@ spdk_bdev_io_get_thread(struct spdk_bdev_io *bdev_io)
return spdk_io_channel_get_thread(bdev_io->internal.ch->channel);
}
struct spdk_io_channel *
spdk_bdev_io_get_io_channel(struct spdk_bdev_io *bdev_io)
{
return bdev_io->internal.ch->channel;
}
static void
_spdk_bdev_qos_config_limit(struct spdk_bdev *bdev, uint64_t *limits)
{