Commit 8f424ed8 authored by Krzysztof Smolinski's avatar Krzysztof Smolinski Committed by Tomasz Zawadzki
Browse files

raid1: io metadata support



Signed-off-by: default avatarKrzysztof Smolinski <krzysztof.smolinski@intel.com>
Change-Id: I53a57f85d94110365492d457715f8a8bc1194628
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15127


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
parent 357c038c
Loading
Loading
Loading
Loading
+24 −8
Original line number Diff line number Diff line
@@ -51,10 +51,18 @@ raid1_submit_read_request(struct raid_bdev_io *raid_io)

	raid_io->base_bdev_io_remaining = 1;

	ret = spdk_bdev_readv_blocks(base_info->desc, base_ch,
	if (bdev_io->u.bdev.ext_opts != NULL) {
		ret = spdk_bdev_readv_blocks_ext(base_info->desc, base_ch,
						 bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
						 pd_lba, pd_blocks, raid1_bdev_io_completion,
						 raid_io, bdev_io->u.bdev.ext_opts);
	} else {
		ret = spdk_bdev_readv_blocks_with_md(base_info->desc, base_ch,
						     bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
						     bdev_io->u.bdev.md_buf,
						     pd_lba, pd_blocks,
						     raid1_bdev_io_completion, raid_io);
	}

	if (spdk_likely(ret == 0)) {
		raid_io->base_bdev_io_submitted++;
@@ -90,10 +98,18 @@ raid1_submit_write_request(struct raid_bdev_io *raid_io)
		base_info = &raid_bdev->base_bdev_info[idx];
		base_ch = raid_io->raid_ch->base_channel[idx];

		ret = spdk_bdev_writev_blocks(base_info->desc, base_ch,
		if (bdev_io->u.bdev.ext_opts != NULL) {
			ret = spdk_bdev_writev_blocks_ext(base_info->desc, base_ch,
							  bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
							  pd_lba, pd_blocks, raid1_bdev_io_completion,
							  raid_io, bdev_io->u.bdev.ext_opts);
		} else {
			ret = spdk_bdev_writev_blocks_with_md(base_info->desc, base_ch,
							      bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
							      bdev_io->u.bdev.md_buf,
							      pd_lba, pd_blocks,
							      raid1_bdev_io_completion, raid_io);
		}

		if (spdk_unlikely(ret != 0)) {
			if (spdk_unlikely(ret == -ENOMEM)) {
+8 −8
Original line number Diff line number Diff line
@@ -19,24 +19,24 @@ DEFINE_STUB(raid_bdev_io_complete_part, bool, (struct raid_bdev_io *raid_io, uin
DEFINE_STUB_V(spdk_bdev_free_io, (struct spdk_bdev_io *bdev_io));
DEFINE_STUB_V(raid_bdev_queue_io_wait, (struct raid_bdev_io *raid_io, struct spdk_bdev *bdev,
					struct spdk_io_channel *ch, spdk_bdev_io_wait_cb cb_fn));
DEFINE_STUB(spdk_bdev_readv_blocks, int, (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
		struct iovec *iov, int iovcnt,
		uint64_t offset_blocks, uint64_t num_blocks,
		spdk_bdev_io_completion_cb cb, void *cb_arg), 0);
DEFINE_STUB(spdk_bdev_readv_blocks_with_md, int, (struct spdk_bdev_desc *desc,
		struct spdk_io_channel *ch,
		struct iovec *iov, int iovcnt, void *md,
		uint64_t offset_blocks, uint64_t num_blocks,
		spdk_bdev_io_completion_cb cb, void *cb_arg), 0);
DEFINE_STUB(spdk_bdev_writev_blocks, int, (struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
		struct iovec *iov, int iovcnt,
		uint64_t offset_blocks, uint64_t num_blocks,
		spdk_bdev_io_completion_cb cb, void *cb_arg), 0);
DEFINE_STUB(spdk_bdev_writev_blocks_with_md, int, (struct spdk_bdev_desc *desc,
		struct spdk_io_channel *ch,
		struct iovec *iov, int iovcnt, void *md,
		uint64_t offset_blocks, uint64_t num_blocks,
		spdk_bdev_io_completion_cb cb, void *cb_arg), 0);
DEFINE_STUB(spdk_bdev_readv_blocks_ext, int, (struct spdk_bdev_desc *desc,
		struct spdk_io_channel *ch,
		struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks,
		spdk_bdev_io_completion_cb cb, void *cb_arg, struct spdk_bdev_ext_io_opts *opts), 0);
DEFINE_STUB(spdk_bdev_writev_blocks_ext, int, (struct spdk_bdev_desc *desc,
		struct spdk_io_channel *ch,
		struct iovec *iov, int iovcnt, uint64_t offset_blocks, uint64_t num_blocks,
		spdk_bdev_io_completion_cb cb, void *cb_arg, struct spdk_bdev_ext_io_opts *opts), 0);

static int
test_setup(void)