Commit d2a78977 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

bdev/malloc: Delegate DIF config check to spdk_dif_ctx_init()



spdk_dif_ctx_init() now has all necessary checks for DIF configuration.
The following patches will make the PI format configurable. Then, we
will be able to delegate the PI format check to spdk_dif_ctx_init() too.

Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I6d3328d51dd4fc478edc3b041a2b24b82969e7e2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24205


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent f7d49034
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -741,16 +741,6 @@ create_malloc_disk(struct spdk_bdev **bdev, const struct malloc_bdev_opts *opts)
		block_size = opts->block_size;
	}

	if (opts->dif_type < SPDK_DIF_DISABLE || opts->dif_type > SPDK_DIF_TYPE3) {
		SPDK_ERRLOG("DIF type is invalid\n");
		return -EINVAL;
	}

	if (opts->dif_type != SPDK_DIF_DISABLE && opts->md_size == 0) {
		SPDK_ERRLOG("Metadata size should not be zero if DIF is enabled\n");
		return -EINVAL;
	}

	mdisk = calloc(1, sizeof(*mdisk));
	if (!mdisk) {
		SPDK_ERRLOG("mdisk calloc() failed\n");