]> www.infradead.org Git - users/hch/block.git/commitdiff
mm: use bdev_is_zoned in claim_swapfile
authorChristoph Hellwig <hch@lst.de>
Sun, 27 Mar 2022 07:27:35 +0000 (09:27 +0200)
committerChristoph Hellwig <hch@lst.de>
Sun, 10 Apr 2022 06:26:09 +0000 (08:26 +0200)
Use the bdev based helper instead of poking into the queue.

Signed-off-by: Christoph Hellwig <hch@lst.de>
mm/swapfile.c

index 63c61f8b261188c34d26b276e5e81cd1a07eb878..4c7537162af5ed72b5f50ddd2e59078d2b7f4a8d 100644 (file)
@@ -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)) {