Commit 734de260 authored by Changpeng Liu's avatar Changpeng Liu Committed by Tomasz Zawadzki
Browse files

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



Change-Id: Id76d65dd84ac6377ca14b1671142c856c7d83b7e
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7874


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent b71a8624
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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;