Commit f7671383 authored by Maciej Szwed's avatar Maciej Szwed Committed by Tomasz Zawadzki
Browse files

nvme: Add spdk_nvme_ns_supports_compare function



This function returns information if compare
operation is supported by device.

Signed-off-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Change-Id: I321e9bf6d146ac8d14ea4549cb4380735b30be6f

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477925


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b95de9a3
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1889,6 +1889,18 @@ uint32_t spdk_nvme_ns_get_md_size(struct spdk_nvme_ns *ns);
 */
bool spdk_nvme_ns_supports_extended_lba(struct spdk_nvme_ns *ns);

/**
 * Check whether if the namespace supports compare operation
 *
 * This function is thread safe and can be called at any point while the controller
 * is attached to the SPDK NVMe driver.
 *
 * \param ns Namespace to query.
 *
 * \return true if the namespace supports compare operation, or false otherwise.
 */
bool spdk_nvme_ns_supports_compare(struct spdk_nvme_ns *ns);

/**
 * Determine the value returned when reading deallocated blocks.
 *
+6 −0
Original line number Diff line number Diff line
@@ -250,6 +250,12 @@ spdk_nvme_ns_supports_extended_lba(struct spdk_nvme_ns *ns)
	return (ns->flags & SPDK_NVME_NS_EXTENDED_LBA_SUPPORTED) ? true : false;
}

bool
spdk_nvme_ns_supports_compare(struct spdk_nvme_ns *ns)
{
	return (ns->flags & SPDK_NVME_NS_COMPARE_SUPPORTED) ? true : false;
}

uint32_t
spdk_nvme_ns_get_md_size(struct spdk_nvme_ns *ns)
{