lib/ftl: Band relocation should be performed only on closed bands

Remove checks for open bands inside because
we should only support closed bands relocation.

Change-Id: Ice5f13d579a046a9cb46684488801a2fa0c15a9d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/876
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Wojciech Malikowski 2020-02-13 10:28:51 -05:00 committed by Tomasz Zawadzki
parent f93ac08d26
commit 62610945c0

View File

@ -222,12 +222,9 @@ ftl_reloc_prep(struct ftl_band_reloc *breloc)
reloc->num_active++;
if (!band->high_prio) {
if (band->lba_map.ref_cnt == 0) {
if (ftl_band_alloc_lba_map(band)) {
assert(false);
}
} else {
ftl_band_acquire_lba_map(band);
if (ftl_band_alloc_lba_map(band)) {
SPDK_ERRLOG("Failed to allocate lba map\n");
assert(false);
}
} else {
ftl_band_acquire_lba_map(band);
@ -772,7 +769,7 @@ ftl_reloc(struct ftl_reloc *reloc)
break;
}
/* TODO: Add handling relocation on open bands */
/* Wait for band to close before relocating */
if (breloc->band->state != FTL_BAND_STATE_CLOSED) {
continue;
}