bdev/zone: 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 <alexeymar@nvidia.com>
Change-Id: Ie4137f7a6a7628a13d14c7c9a5e9aa1ceb99d322
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15091
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Alexey Marchuk 2022-10-20 18:41:59 +02:00 committed by Tomasz Zawadzki
parent 0fec09fc50
commit 6fa5007edd

View File

@ -1,5 +1,6 @@
/* SPDX-License-Identifier: BSD-3-Clause /* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) Intel Corporation. * Copyright (c) Intel Corporation.
* Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.
* All rights reserved. * All rights reserved.
*/ */
@ -416,18 +417,11 @@ zone_block_write(struct bdev_zone_block *bdev_node, struct zone_block_io_channel
} }
pthread_spin_unlock(&zone->lock); pthread_spin_unlock(&zone->lock);
if (bdev_io->u.bdev.md_buf == NULL) {
rc = spdk_bdev_writev_blocks(bdev_node->base_desc, ch->base_ch, bdev_io->u.bdev.iovs,
bdev_io->u.bdev.iovcnt, lba,
bdev_io->u.bdev.num_blocks, _zone_block_complete_write,
bdev_io);
} else {
rc = spdk_bdev_writev_blocks_with_md(bdev_node->base_desc, ch->base_ch, rc = spdk_bdev_writev_blocks_with_md(bdev_node->base_desc, ch->base_ch,
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
bdev_io->u.bdev.md_buf, bdev_io->u.bdev.md_buf,
lba, bdev_io->u.bdev.num_blocks, lba, bdev_io->u.bdev.num_blocks,
_zone_block_complete_write, bdev_io); _zone_block_complete_write, bdev_io);
}
return rc; return rc;
@ -469,18 +463,11 @@ zone_block_read(struct bdev_zone_block *bdev_node, struct zone_block_io_channel
return -EINVAL; return -EINVAL;
} }
if (bdev_io->u.bdev.md_buf == NULL) {
rc = spdk_bdev_readv_blocks(bdev_node->base_desc, ch->base_ch, bdev_io->u.bdev.iovs,
bdev_io->u.bdev.iovcnt, lba,
len, _zone_block_complete_read,
bdev_io);
} else {
rc = spdk_bdev_readv_blocks_with_md(bdev_node->base_desc, ch->base_ch, rc = spdk_bdev_readv_blocks_with_md(bdev_node->base_desc, ch->base_ch,
bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt,
bdev_io->u.bdev.md_buf, bdev_io->u.bdev.md_buf,
lba, len, lba, len,
_zone_block_complete_read, bdev_io); _zone_block_complete_read, bdev_io);
}
return rc; return rc;
} }