Commit 1565929b authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Mike Snitzer

dm zoned: avoid unnecessary device recalulation for secondary superblock

The secondary superblock must reside on the same device as the primary
superblock, so there is no need to re-calculate the device.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 35d0c96e
...@@ -1135,7 +1135,7 @@ static int dmz_lookup_secondary_sb(struct dmz_metadata *zmd) ...@@ -1135,7 +1135,7 @@ static int dmz_lookup_secondary_sb(struct dmz_metadata *zmd)
/* Bad first super block: search for the second one */ /* Bad first super block: search for the second one */
zmd->sb[1].block = zmd->sb[0].block + zone_nr_blocks; zmd->sb[1].block = zmd->sb[0].block + zone_nr_blocks;
zmd->sb[1].zone = zmd->sb[0].zone + 1; zmd->sb[1].zone = zmd->sb[0].zone + 1;
zmd->sb[1].dev = dmz_zone_to_dev(zmd, zmd->sb[1].zone); zmd->sb[1].dev = zmd->sb[0].dev;
for (i = 0; i < zmd->nr_rnd_zones - 1; i++) { for (i = 0; i < zmd->nr_rnd_zones - 1; i++) {
if (dmz_read_sb(zmd, 1) != 0) if (dmz_read_sb(zmd, 1) != 0)
break; break;
...@@ -1144,7 +1144,6 @@ static int dmz_lookup_secondary_sb(struct dmz_metadata *zmd) ...@@ -1144,7 +1144,6 @@ static int dmz_lookup_secondary_sb(struct dmz_metadata *zmd)
return 0; return 0;
} }
zmd->sb[1].block += zone_nr_blocks; zmd->sb[1].block += zone_nr_blocks;
zmd->sb[1].dev = dmz_zone_to_dev(zmd, zmd->sb[1].zone + i);
} }
dmz_free_mblock(zmd, mblk); dmz_free_mblock(zmd, mblk);
...@@ -1263,7 +1262,7 @@ static int dmz_load_sb(struct dmz_metadata *zmd) ...@@ -1263,7 +1262,7 @@ static int dmz_load_sb(struct dmz_metadata *zmd)
if (!zmd->sb[1].zone) if (!zmd->sb[1].zone)
zmd->sb[1].zone = zmd->sb[0].zone + zmd->nr_meta_zones; zmd->sb[1].zone = zmd->sb[0].zone + zmd->nr_meta_zones;
zmd->sb[1].block = dmz_start_block(zmd, zmd->sb[1].zone); zmd->sb[1].block = dmz_start_block(zmd, zmd->sb[1].zone);
zmd->sb[1].dev = dmz_zone_to_dev(zmd, zmd->sb[1].zone); zmd->sb[1].dev = zmd->sb[0].dev;
ret = dmz_get_sb(zmd, 1); ret = dmz_get_sb(zmd, 1);
} else } else
ret = dmz_lookup_secondary_sb(zmd); ret = dmz_lookup_secondary_sb(zmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment