Commit 149511c1 authored by Wojciech Malikowski's avatar Wojciech Malikowski Committed by Tomasz Zawadzki
Browse files

lib/ftl: Set zone state to "full" when all writes to it are completed



Zone state should be changed to "full" when zone is
fully written.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 97f3ad2d
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -224,7 +224,6 @@ static void
_ftl_band_set_closed(struct ftl_band *band)
{
	struct spdk_ftl_dev *dev = band->dev;
	struct ftl_zone *zone;

	/* Set the state as free_md() checks for that */
	band->state = FTL_BAND_STATE_CLOSED;
@@ -234,9 +233,6 @@ _ftl_band_set_closed(struct ftl_band *band)

	if (spdk_likely(band->num_zones)) {
		LIST_INSERT_HEAD(&dev->shut_bands, band, list_entry);
		CIRCLEQ_FOREACH(zone, &band->zones, circleq) {
			zone->info.state = SPDK_BDEV_ZONE_STATE_FULL;
		}
	} else {
		LIST_REMOVE(band, list_entry);
	}
+4 −0
Original line number Diff line number Diff line
@@ -1562,6 +1562,10 @@ ftl_io_child_write_cb(struct ftl_io *io, void *ctx, int status)
	zone->busy = false;
	zone->info.write_pointer += io->num_blocks;

	if (zone->info.write_pointer == zone->info.capacity) {
		zone->info.state = SPDK_BDEV_ZONE_STATE_FULL;
	}

	/* If some other write on the same band failed the write pointer would already be freed */
	if (spdk_likely(wptr)) {
		wptr->num_outstanding--;