It is a nicer API to allow users to use an md-related API such as spdk_bdev_read_blocks_with_md passing md_buf as NULL to mean "don't read metadata". This avoids the need for an if-statement in the users code to check if the md buffer is NULL before deciding which API needs to be called. This basically requires two changes: 1) only check if the metadata is separate for the bdev if the md_buf != NULL 2) do not fail if the buffer is specified but the md buffer is not (we only need to fail the case where the md buffer is specified but the data buffer is not) Note that spdk_bdev_readv/writev_blocks_ext was already allowing the metadata buffer to be NULL, but change those functions too to match the others on how we check if the data buffer isn't allocated. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I764cf49b9f573fccb19e73876a376fd231cc3580 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13612 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> |
||
---|---|---|
.. | ||
bdev_internal.h | ||
bdev_rpc.c | ||
bdev_zone.c | ||
bdev.c | ||
Makefile | ||
part.c | ||
scsi_nvme.c | ||
spdk_bdev.map | ||
vtune.c |