summaryrefslogtreecommitdiff
path: root/drivers/md/dm-zoned.h
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2020-05-11 10:24:18 +0200
committerMike Snitzer <snitzer@redhat.com>2020-05-15 10:29:36 -0400
commitb71228739851a9b384a59ba0467259eba508b408 (patch)
treecdcde6df6c797078a5e90ec211814f78c8c0b9c3 /drivers/md/dm-zoned.h
parent90b39d58f39e1f3f3147caee6fb2a71528db74a2 (diff)
dm zoned: store zone id within the zone structure and kill dmz_id()
Instead of calculating the zone index by the offset within the zone array store the index within the structure itself. With that the helper dmz_id() is pointless and can be replaced with accessing the ->id value directly. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Bob Liu <bob.liu@oracle.com> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-zoned.h')
-rw-r--r--drivers/md/dm-zoned.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm-zoned.h b/drivers/md/dm-zoned.h
index 884c0e586082..30781646741a 100644
--- a/drivers/md/dm-zoned.h
+++ b/drivers/md/dm-zoned.h
@@ -87,6 +87,9 @@ struct dm_zone {
/* Zone activation reference count */
atomic_t refcount;
+ /* Zone id */
+ unsigned int id;
+
/* Zone write pointer block (relative to the zone start block) */
unsigned int wp_block;
@@ -176,7 +179,6 @@ void dmz_lock_flush(struct dmz_metadata *zmd);
void dmz_unlock_flush(struct dmz_metadata *zmd);
int dmz_flush_metadata(struct dmz_metadata *zmd);
-unsigned int dmz_id(struct dmz_metadata *zmd, struct dm_zone *zone);
sector_t dmz_start_sect(struct dmz_metadata *zmd, struct dm_zone *zone);
sector_t dmz_start_block(struct dmz_metadata *zmd, struct dm_zone *zone);
unsigned int dmz_nr_chunks(struct dmz_metadata *zmd);