diff --git a/include/spdk/bdev_module.h b/include/spdk/bdev_module.h index d38a66f37..fda468153 100644 --- a/include/spdk/bdev_module.h +++ b/include/spdk/bdev_module.h @@ -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. * diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c index 0c9aaad64..ddc9e0d6a 100644 --- a/lib/bdev/bdev.c +++ b/lib/bdev/bdev.c @@ -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) {