From: Christoph Hellwig Date: Fri, 15 Apr 2022 04:52:41 +0000 (+0200) Subject: mm: use bdev_is_zoned in claim_swapfile X-Git-Tag: v6.1-rc5~1167^2~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9964e674559b02619fee2012a56839624143d02e;p=platform%2Fkernel%2Flinux-starfive.git mm: use bdev_is_zoned in claim_swapfile Use the bdev based helper instead of poking into the queue. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-11-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/mm/swapfile.c b/mm/swapfile.c index 63c61f8..4c75371 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode) * write only restriction. Hence zoned block devices are not * suitable for swapping. Disallow them here. */ - if (blk_queue_is_zoned(p->bdev->bd_disk->queue)) + if (bdev_is_zoned(p->bdev)) return -EINVAL; p->flags |= SWP_BLKDEV; } else if (S_ISREG(inode->i_mode)) {