OSDN Git Service

dm: cleanup device_area_is_invalid()
authorDamien Le Moal <damien.lemoal@wdc.com>
Tue, 25 May 2021 21:24:55 +0000 (06:24 +0900)
committerMike Snitzer <snitzer@redhat.com>
Fri, 4 Jun 2021 16:07:30 +0000 (12:07 -0400)
In device_area_is_invalid(), use bdev_is_zoned() instead of open
coding the test on the zoned model returned by bdev_zoned_model().

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-table.c

index 7e88e5e..123d1a3 100644 (file)
@@ -249,7 +249,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
         * If the target is mapped to zoned block device(s), check
         * that the zones are not partially mapped.
         */
-       if (bdev_zoned_model(bdev) != BLK_ZONED_NONE) {
+       if (bdev_is_zoned(bdev)) {
                unsigned int zone_sectors = bdev_zone_sectors(bdev);
 
                if (start & (zone_sectors - 1)) {