lib/ftl: Allow for relocating open band
In case ANM event occurs on open band reloc need to be able to process such event. If band is not in closed sate do not alloc lba map for it and do not set it to free state after relocation. Change-Id: I2f4a5770fef08271d222936ca19f3cc98e5e5be1 Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457612 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
f8a9112292
commit
bf4973087f
@ -204,8 +204,12 @@ ftl_reloc_prep(struct ftl_band_reloc *breloc)
|
|||||||
reloc->num_active++;
|
reloc->num_active++;
|
||||||
|
|
||||||
if (!band->high_prio) {
|
if (!band->high_prio) {
|
||||||
if (ftl_band_alloc_lba_map(band)) {
|
if (band->lba_map.ref_cnt == 0) {
|
||||||
assert(false);
|
if (ftl_band_alloc_lba_map(band)) {
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ftl_band_acquire_lba_map(band);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -551,7 +555,7 @@ ftl_reloc_release(struct ftl_band_reloc *breloc)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ftl_band_empty(band)) {
|
if (ftl_band_empty(band) && band->state == FTL_BAND_STATE_CLOSED) {
|
||||||
ftl_band_set_state(breloc->band, FTL_BAND_STATE_FREE);
|
ftl_band_set_state(breloc->band, FTL_BAND_STATE_FREE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -749,6 +753,7 @@ ftl_reloc(struct ftl_reloc *reloc)
|
|||||||
if (reloc->num_active == reloc->max_active) {
|
if (reloc->num_active == reloc->max_active) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ftl_reloc_add_active_queue(breloc);
|
ftl_reloc_add_active_queue(breloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,6 +415,9 @@ test_reloc_chunk(void)
|
|||||||
|
|
||||||
breloc = &reloc->brelocs[0];
|
breloc = &reloc->brelocs[0];
|
||||||
band = breloc->band;
|
band = breloc->band;
|
||||||
|
/* High priority band have allocated lba map */
|
||||||
|
band->high_prio = 1;
|
||||||
|
ftl_band_alloc_lba_map(band);
|
||||||
num_io = MAX_RELOC_QDEPTH * reloc->xfer_size;
|
num_io = MAX_RELOC_QDEPTH * reloc->xfer_size;
|
||||||
num_iters = ftl_dev_lbks_in_chunk(dev) / num_io;
|
num_iters = ftl_dev_lbks_in_chunk(dev) / num_io;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user