diff options
author | Hannes Reinecke <hare@suse.de> | 2020-06-02 13:09:51 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2020-06-05 14:59:50 -0400 |
commit | bd82fdabf162fec1404c4e22988b178c4f3dd23b (patch) | |
tree | 3879a3ba59c1c4e83e4c1a5427c5c42f9d225790 /drivers/md/dm-zoned-target.c | |
parent | f97809aec58995a87a9a30cb45c9a6148377df64 (diff) | |
download | linux-bd82fdabf162fec1404c4e22988b178c4f3dd23b.tar.bz2 |
dm zoned: move random and sequential zones into struct dmz_dev
Random and sequential zones should be part of the respective
device structure to make arbitration between devices possible.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-zoned-target.c')
-rw-r--r-- | drivers/md/dm-zoned-target.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index 97d63d8e6c19..aa3d26d16441 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -1075,17 +1075,30 @@ static void dmz_status(struct dm_target *ti, status_type_t type, ssize_t sz = 0; char buf[BDEVNAME_SIZE]; struct dmz_dev *dev; + int i; switch (type) { case STATUSTYPE_INFO: - DMEMIT("%u zones %u/%u cache %u/%u random %u/%u sequential", + DMEMIT("%u zones %u/%u cache", dmz_nr_zones(dmz->metadata), dmz_nr_unmap_cache_zones(dmz->metadata), - dmz_nr_cache_zones(dmz->metadata), - dmz_nr_unmap_rnd_zones(dmz->metadata), - dmz_nr_rnd_zones(dmz->metadata), - dmz_nr_unmap_seq_zones(dmz->metadata), - dmz_nr_seq_zones(dmz->metadata)); + dmz_nr_cache_zones(dmz->metadata)); + for (i = 0; i < DMZ_MAX_DEVS; i++) { + if (!dmz->ddev[i]) + continue; + /* + * For a multi-device setup the first device + * contains only cache zones. + */ + if ((i == 0) && + (dmz_nr_cache_zones(dmz->metadata) > 0)) + continue; + DMEMIT(" %u/%u random %u/%u sequential", + dmz_nr_unmap_rnd_zones(dmz->metadata, i), + dmz_nr_rnd_zones(dmz->metadata, i), + dmz_nr_unmap_seq_zones(dmz->metadata, i), + dmz_nr_seq_zones(dmz->metadata, i)); + } break; case STATUSTYPE_TABLE: dev = &dmz->dev[0]; |