diff --git a/lib/ftl/Makefile b/lib/ftl/Makefile index 446629aa9..2bd8cc0ef 100644 --- a/lib/ftl/Makefile +++ b/lib/ftl/Makefile @@ -13,6 +13,10 @@ ifdef SPDK_FTL_VSS_EMU CFLAGS += -DSPDK_FTL_VSS_EMU endif +ifdef SPDK_FTL_L2P_FLAT +CFLAGS += -DSPDK_FTL_L2P_FLAT +endif + ifneq ($(strip $(SPDK_FTL_ZONE_EMU_BLOCKS)),) CFLAGS += -DSPDK_FTL_ZONE_EMU_BLOCKS=$(SPDK_FTL_ZONE_EMU_BLOCKS) endif diff --git a/lib/ftl/ftl_l2p.c b/lib/ftl/ftl_l2p.c index 81f358514..776b1ed71 100644 --- a/lib/ftl/ftl_l2p.c +++ b/lib/ftl/ftl_l2p.c @@ -6,11 +6,16 @@ #include "ftl_l2p.h" #include "ftl_band.h" #include "ftl_nv_cache.h" +#include "ftl_l2p_cache.h" #include "ftl_l2p_flat.h" /* TODO: Verify why function pointers had worse performance than compile time constants */ +#ifdef SPDK_FTL_L2P_FLAT #define FTL_L2P_OP(name) ftl_l2p_flat_ ## name +#else +#define FTL_L2P_OP(name) ftl_l2p_cache_ ## name +#endif int diff --git a/lib/ftl/mngt/ftl_mngt_md.c b/lib/ftl/mngt/ftl_mngt_md.c index e525fad65..b7c15455a 100644 --- a/lib/ftl/mngt/ftl_mngt_md.c +++ b/lib/ftl/mngt/ftl_mngt_md.c @@ -37,6 +37,9 @@ is_buffer_needed(enum ftl_layout_region_type type) case FTL_LAYOUT_REGION_TYPE_DATA_BASE: case FTL_LAYOUT_REGION_TYPE_NVC_MD_MIRROR: case FTL_LAYOUT_REGION_TYPE_BAND_MD_MIRROR: +#ifndef SPDK_FTL_L2P_FLAT + case FTL_LAYOUT_REGION_TYPE_L2P: +#endif return false; default: