Commit bfd67f94 authored by Wojciech Malikowski's avatar Wojciech Malikowski Committed by Darek Stojaczyk
Browse files

lib/ftl: Initialize band tail metadata physical address



Band tail PPA should be initialized when
new FTL instance is created.

Change-Id: Ie2fb72aa3f29eece0b6f8912998b33af3ba6b355
Signed-off-by: default avatarWojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457777


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 4be37a57
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -138,7 +138,6 @@ ftl_band_write_failed(struct ftl_band *band)
	struct spdk_ftl_dev *dev = band->dev;

	band->high_prio = 1;
	band->tail_md_ppa = ftl_to_ppa(FTL_PPA_INVALID);

	if (!dev->df_band) {
		dev->df_band = band;
@@ -1085,14 +1084,16 @@ static void
ftl_erase_fail(struct ftl_io *io, int status)
{
	struct ftl_chunk *chunk;
	struct ftl_band *band = io->band;
	char buf[128];

	SPDK_ERRLOG("Erase failed @ppa: %s, status: %d\n",
		    ftl_ppa2str(io->ppa, buf, sizeof(buf)), status);

	chunk = ftl_band_chunk_from_ppa(io->band, io->ppa);
	chunk = ftl_band_chunk_from_ppa(band, io->ppa);
	chunk->state = FTL_CHUNK_STATE_BAD;
	ftl_band_remove_chunk(io->band, chunk);
	ftl_band_remove_chunk(band, chunk);
	band->tail_md_ppa = ftl_band_tail_md_ppa(band);
}

static void
+0 −1
Original line number Diff line number Diff line
@@ -266,7 +266,6 @@ ftl_wptr_close_band(struct ftl_wptr *wptr)
	struct ftl_band *band = wptr->band;

	ftl_band_set_state(band, FTL_BAND_STATE_CLOSING);
	band->tail_md_ppa = wptr->ppa;

	return ftl_band_write_tail_md(band, ftl_md_write_cb);
}
+5 −0
Original line number Diff line number Diff line
@@ -377,6 +377,11 @@ ftl_dev_init_bands(struct spdk_ftl_dev *dev)
		}
	}

	for (i = 0; i < ftl_dev_num_bands(dev); ++i) {
		band = &dev->bands[i];
		band->tail_md_ppa = ftl_band_tail_md_ppa(band);
	}

	ftl_remove_empty_bands(dev);
out:
	free(info);
+0 −1
Original line number Diff line number Diff line
@@ -623,7 +623,6 @@ ftl_restore_tail_md(struct ftl_restore_band *rband)
	struct ftl_restore *restore = rband->parent;
	struct ftl_band *band = rband->band;

	band->tail_md_ppa = ftl_band_tail_md_ppa(band);
	band->lba_map.map = restore->lba_map;
	band->lba_map.dma_buf = restore->md_buf;