Commit c1e3a87b authored by Jim Harris's avatar Jim Harris
Browse files

util: add 'unique' parameter to spdk_get_io_channel



Some subsystems may wish to create unique I/O channels
which are not shared across all users of the same I/O
device on the same thread.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I3ade3675d57338cf85b6a301285e6f392bd6cd2e
parent ff38547d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -96,8 +96,11 @@ void spdk_io_device_unregister(void *io_device);
 * The priority parameter allows callers to create different I/O channels to the same
 *  I/O device with varying priorities.  Currently this value must be set to
 *  SPDK_IO_PRIORITY_DEFAULT.
 *
 * The unique parameter allows callers to specify that an existing channel should not
 *  be used to satisfy this request, even if the io_device and priority fields match.
 */
struct spdk_io_channel *spdk_get_io_channel(void *io_device, uint32_t priority);
struct spdk_io_channel *spdk_get_io_channel(void *io_device, uint32_t priority, bool unique);

/**
 * \brief Releases a reference to an I/O channel.
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ blockdev_aio_destroy_cb(void *io_device, void *ctx_buf)
static struct spdk_io_channel *
blockdev_aio_get_io_channel(struct spdk_bdev *bdev, uint32_t priority)
{
	return spdk_get_io_channel(bdev, priority);
	return spdk_get_io_channel(bdev, priority, false);
}

static const struct spdk_bdev_fn_table aio_fn_table = {
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ blockdev_nvme_get_io_channel(struct spdk_bdev *bdev, uint32_t priority)
{
	struct nvme_blockdev *nvme_bdev = (struct nvme_blockdev *)bdev;

	return spdk_get_io_channel(nvme_bdev->ctrlr, priority);
	return spdk_get_io_channel(nvme_bdev->ctrlr, priority, false);
}

static const struct spdk_bdev_fn_table nvmelib_fn_table = {
+2 −2
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ memcpy_destroy_cb(void *io_device, void *ctx_buf)

static struct spdk_io_channel *mem_get_io_channel(uint32_t priority)
{
	return spdk_get_io_channel(&memcpy_copy_engine, priority);
	return spdk_get_io_channel(&memcpy_copy_engine, priority, false);
}

static int
@@ -208,7 +208,7 @@ copy_destroy_cb(void *io_device, void *ctx_buf)
struct spdk_io_channel *
spdk_copy_engine_get_io_channel(uint32_t priority)
{
	return spdk_get_io_channel(&spdk_copy_module_list, priority);
	return spdk_get_io_channel(&spdk_copy_module_list, priority, false);
}

static int
+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ ioat_destroy_cb(void *io_device, void *ctx_buf)
static struct spdk_io_channel *
ioat_get_io_channel(uint32_t priority)
{
	return spdk_get_io_channel(&ioat_copy_engine, priority);
	return spdk_get_io_channel(&ioat_copy_engine, priority, false);
}

struct ioat_probe_ctx {
Loading