Commit c97ea5ad authored by Ben Walker's avatar Ben Walker Committed by Daniel Verkamp
Browse files

bdev: Modules no longer register bdevs as io_devices



Instead, they register some internal structure of
their choosing.

Change-Id: Id1f8c563d0a2c6f1066d741f86b8aa6fe09b6319
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 10f9391a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ blockdev_aio_get_io_channel(void *ctx, uint32_t priority)
{
	struct file_disk *fdisk = ctx;

	return spdk_get_io_channel(&fdisk->disk, priority, false, NULL);
	return spdk_get_io_channel(&fdisk->fd, priority, false, NULL);
}

static const struct spdk_bdev_fn_table aio_fn_table = {
@@ -372,7 +372,7 @@ create_aio_disk(const char *name, const char *fname)

	fdisk->disk.fn_table = &aio_fn_table;

	spdk_io_device_register(&fdisk->disk, blockdev_aio_create_cb, blockdev_aio_destroy_cb,
	spdk_io_device_register(&fdisk->fd, blockdev_aio_create_cb, blockdev_aio_destroy_cb,
				sizeof(struct blockdev_aio_io_channel));
	spdk_bdev_register(&fdisk->disk);
	return &fdisk->disk;
+3 −3
Original line number Diff line number Diff line
@@ -412,7 +412,7 @@ blockdev_rbd_create_cb(void *io_device, uint32_t priority,
	struct blockdev_rbd_io_channel *ch = ctx_buf;
	int ret;

	ch->disk = (struct blockdev_rbd *)io_device;
	ch->disk = (struct blockdev_rbd *)((uintptr_t)io_device - offsetof(struct blockdev_rbd, info));
	ch->image = NULL;
	ch->io_ctx = NULL;
	ch->pfd.fd = -1;
@@ -473,7 +473,7 @@ blockdev_rbd_get_io_channel(void *ctx, uint32_t priority)
{
	struct blockdev_rbd *rbd_bdev = ctx;

	return spdk_get_io_channel(rbd_bdev, priority, false, NULL);
	return spdk_get_io_channel(&rbd_bdev->info, priority, false, NULL);
}

static const struct spdk_bdev_fn_table rbd_fn_table = {
@@ -544,7 +544,7 @@ spdk_bdev_rbd_create(const char *pool_name, const char *rbd_name, uint32_t block
	SPDK_NOTICELOG("Add %s rbd disk to lun\n", rbd->disk.name);
	TAILQ_INSERT_TAIL(&g_rbds, rbd, tailq);

	spdk_io_device_register(&rbd->disk, blockdev_rbd_create_cb,
	spdk_io_device_register(&rbd->info, blockdev_rbd_create_cb,
				blockdev_rbd_destroy_cb,
				sizeof(struct blockdev_rbd_io_channel));
	spdk_bdev_register(&rbd->disk);