lib/ftl: Remove position from ftl zone structure

There is no need of tracking position of zone inside
band.

Change-Id: I1488f23ccfd1f7eee1bd85fdb7ef8ace08ffca40
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468347
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
This commit is contained in:
Wojciech Malikowski 2019-09-12 10:36:42 -04:00 committed by Tomasz Zawadzki
parent 04f754d419
commit 1735a0acd3
4 changed files with 1 additions and 6 deletions

View File

@ -1122,7 +1122,7 @@ ftl_band_next_operational_zone(struct ftl_band *band, struct ftl_zone *zone)
result = ftl_band_next_zone(band, zone);
} else {
CIRCLEQ_FOREACH_REVERSE(entry, &band->zones, circleq) {
if (entry->pos > zone->pos) {
if (entry->start_addr.pu > zone->start_addr.pu) {
result = entry;
} else {
if (!result) {

View File

@ -62,9 +62,6 @@ struct ftl_zone {
/* First logical block of a zone */
struct ftl_addr start_addr;
/* Position in band's zone_buf */
uint32_t pos;
CIRCLEQ_ENTRY(ftl_zone) circleq;
};

View File

@ -328,7 +328,6 @@ ftl_dev_init_bands(struct spdk_ftl_dev *dev)
for (j = 0; j < ftl_dev_num_bands(dev); ++j) {
band = &dev->bands[j];
zone = &band->zone_buf[i];
zone->pos = i;
zone->state = ftl_get_zone_state(&info[j]);
zone->start_addr.pu = i;
zone->start_addr.zone_id = band->id;

View File

@ -97,7 +97,6 @@ test_init_ftl_band(struct spdk_ftl_dev *dev, size_t id)
for (size_t i = 0; i < ftl_dev_num_punits(dev); ++i) {
zone = &band->zone_buf[i];
zone->pos = i;
zone->state = SPDK_BDEV_ZONE_STATE_CLOSED;
zone->start_addr.pu = i;
zone->start_addr.zone_id = band->id;