bdev: use the same macro for both unmap and write zeroes

Change-Id: Id76d65dd84ac6377ca14b1671142c856c7d83b7e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7874
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Changpeng Liu 2021-05-14 18:24:44 +08:00 committed by Tomasz Zawadzki
parent b71a8624cf
commit 734de26066
2 changed files with 5 additions and 5 deletions

View File

@ -84,10 +84,10 @@ int __itt_init_ittlib(const char *, __itt_group_id);
#define SPDK_BDEV_POOL_ALIGNMENT 512
/* The maximum number of children requests for a UNMAP command when splitting
* into children requests at a time.
/* The maximum number of children requests for a UNMAP or WRITE ZEROES command
* when splitting into children requests at a time.
*/
#define SPDK_BDEV_MAX_CHILDREN_UNMAP_REQS (8)
#define SPDK_BDEV_MAX_CHILDREN_UNMAP_WRITE_ZEROES_REQS (8)
static const char *qos_rpc_type[] = {"rw_ios_per_sec",
"rw_mbytes_per_sec", "r_mbytes_per_sec", "w_mbytes_per_sec"
@ -2279,7 +2279,7 @@ bdev_unmap_split(struct spdk_bdev_io *bdev_io)
remaining = bdev_io->u.bdev.split_remaining_num_blocks;
max_unmap_blocks = bdev_io->bdev->max_unmap * bdev_io->bdev->max_unmap_segments;
while (remaining && (num_children_reqs < SPDK_BDEV_MAX_CHILDREN_UNMAP_REQS)) {
while (remaining && (num_children_reqs < SPDK_BDEV_MAX_CHILDREN_UNMAP_WRITE_ZEROES_REQS)) {
unmap_blocks = spdk_min(remaining, max_unmap_blocks);
rc = bdev_io_split_submit(bdev_io, NULL, 0, NULL, unmap_blocks,

View File

@ -4553,7 +4553,7 @@ bdev_unmap(void)
CU_ASSERT(g_io_done == false);
while (num_children > 0) {
num_outstanding = spdk_min(num_children, SPDK_BDEV_MAX_CHILDREN_UNMAP_REQS);
num_outstanding = spdk_min(num_children, SPDK_BDEV_MAX_CHILDREN_UNMAP_WRITE_ZEROES_REQS);
CU_ASSERT(g_bdev_ut_channel->outstanding_io_count == num_outstanding);
stub_complete_io(num_outstanding);
num_children -= num_outstanding;