[dm-devel] [PATCH v2 05/11] dm: cleanup device_area_is_invalid()

Hannes Reinecke hare at suse.de
Thu May 20 05:53:51 UTC 2021


On 5/20/21 6:22 AM, Damien Le Moal wrote:
> 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 at wdc.com>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn at wdc.com>
> ---
>   drivers/md/dm-table.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index ee47a332b462..21fd9cd4da32 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -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)) {
> 
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer





More information about the dm-devel mailing list