From 0fec09fc5016d21adab5112ece294d9a95de2454 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Thu, 20 Oct 2022 18:37:09 +0200 Subject: [PATCH] bdev/part: Call bdev*_with_md even if md is NULL The bdev*_with_md APIs now allow to pass NULL md pointer, so calling this function without checking for metadata simplifies code Signed-off-by: Alexey Marchuk Change-Id: I364a646630bd36120231ea87a41fea05df51befb Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15090 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Paul Luse --- lib/bdev/part.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bdev/part.c b/lib/bdev/part.c index c186eb530..af7819fee 100644 --- a/lib/bdev/part.c +++ b/lib/bdev/part.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) Intel Corporation. + * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. * All rights reserved. */ @@ -292,7 +293,7 @@ spdk_bdev_part_submit_request_ext(struct spdk_bdev_part_channel *ch, struct spdk /* Modify the I/O to adjust for the offset within the base bdev. */ switch (bdev_io->type) { case SPDK_BDEV_IO_TYPE_READ: - if (bdev_io->u.bdev.ext_opts || !bdev_io->u.bdev.md_buf) { + if (bdev_io->u.bdev.ext_opts) { rc = spdk_bdev_readv_blocks_ext(base_desc, base_ch, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, remapped_offset, bdev_io->u.bdev.num_blocks, @@ -313,7 +314,7 @@ spdk_bdev_part_submit_request_ext(struct spdk_bdev_part_channel *ch, struct spdk return SPDK_BDEV_IO_STATUS_FAILED; } - if (bdev_io->u.bdev.ext_opts || !bdev_io->u.bdev.md_buf) { + if (bdev_io->u.bdev.ext_opts) { rc = spdk_bdev_writev_blocks_ext(base_desc, base_ch, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, remapped_offset, bdev_io->u.bdev.num_blocks,