Commit db085261 authored by Mateusz Kozlowski's avatar Mateusz Kozlowski Committed by Tomasz Zawadzki
Browse files

lib/ftl: Cleanup mirror md clear flow



Keep the io init path in the ftl_md_clear where the pattern buffer is
readily available.

Change-Id: Icb37ec340fd0e1018a81d132ce3e8c77c7b063a7
Signed-off-by: default avatarMateusz Kozlowski <mateusz.kozlowski@solidigm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21520


Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent f968b954
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -1042,13 +1042,7 @@ clear_mirror_cb(struct spdk_ftl_dev *dev, struct ftl_md *secondary, int status)
		io_done(primary);
	} else {
		/* Now continue the persist procedure on the primary MD object */
		if (0 == io_init(primary, FTL_MD_OP_CLEAR) &&
		    0 == pattern_prepare(primary, *(int *)secondary->io.data,
					 secondary->io.md)) {
		io_submit(primary);
		} else {
			spdk_thread_send_msg(spdk_get_thread(), exception, primary);
		}
	}
}

@@ -1064,8 +1058,14 @@ ftl_md_clear(struct ftl_md *md, int data_pattern, union ftl_md_vss *vss_pattern)
		md_mirror->cb = clear_mirror_cb;
		md_mirror->owner.private = md;

		/* The pattern bufs will not be available outside of this fn context */
		/* Configure the IO for the primary region now */
		if (0 == io_init(md, FTL_MD_OP_CLEAR) && 0 == pattern_prepare(md, data_pattern, vss_pattern)) {
			/* First persist the mirror */
			ftl_md_clear(md_mirror, data_pattern, vss_pattern);
		} else {
			spdk_thread_send_msg(spdk_get_thread(), exception, md);
		}
		return;
	}