Commit da744fc9 authored by Jonas Pfefferle's avatar Jonas Pfefferle Committed by Tomasz Zawadzki
Browse files

bdev/part: add compare and cmp&write io types



The partition bdev checks if the underlying device supports
the io type and sends the bdev_io directly down to the bdev.
This patch adds missing compare and compare&write io types
to the partition bdev.

Signed-off-by: default avatarJonas Pfefferle <pepperjo@japf.ch>
Change-Id: Ice7e5c0332ce7e564bad2bb8d7f4bb1d535388c1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12390


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 00647138
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -380,6 +380,33 @@ spdk_bdev_part_submit_request(struct spdk_bdev_part_channel *ch, struct spdk_bde
					   bdev_io->u.bdev.num_blocks, bdev_io->u.bdev.zcopy.populate,
					   bdev_part_complete_zcopy_io, bdev_io);
		break;
	case SPDK_BDEV_IO_TYPE_COMPARE:
		if (!bdev_io->u.bdev.md_buf) {
			rc = spdk_bdev_comparev_blocks(base_desc, base_ch,
						       bdev_io->u.bdev.iovs,
						       bdev_io->u.bdev.iovcnt,
						       remapped_offset,
						       bdev_io->u.bdev.num_blocks,
						       bdev_part_complete_io, bdev_io);
		} else {
			rc = spdk_bdev_comparev_blocks_with_md(base_desc, base_ch,
							       bdev_io->u.bdev.iovs,
							       bdev_io->u.bdev.iovcnt,
							       bdev_io->u.bdev.md_buf,
							       remapped_offset,
							       bdev_io->u.bdev.num_blocks,
							       bdev_part_complete_io, bdev_io);
		}
		break;
	case SPDK_BDEV_IO_TYPE_COMPARE_AND_WRITE:
		rc = spdk_bdev_comparev_and_writev_blocks(base_desc, base_ch, bdev_io->u.bdev.iovs,
				bdev_io->u.bdev.iovcnt,
				bdev_io->u.bdev.fused_iovs,
				bdev_io->u.bdev.fused_iovcnt,
				remapped_offset,
				bdev_io->u.bdev.num_blocks,
				bdev_part_complete_io, bdev_io);
		break;
	default:
		SPDK_ERRLOG("unknown I/O type %d\n", bdev_io->type);
		return SPDK_BDEV_IO_STATUS_FAILED;