Re: [PATCH 10/27] mm: use bdev_is_zoned in claim_swapfile
- To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
- Cc: dm-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-um@lists.infradead.org, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, nbd@other.debian.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org
- Subject: Re: [PATCH 10/27] mm: use bdev_is_zoned in claim_swapfile
- From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
- Date: Fri, 15 Apr 2022 14:09:42 +0900
- Message-id: <[🔎] 62ebc311-e5ef-cea5-5236-0c83d1a3eb64@opensource.wdc.com>
- In-reply-to: <[🔎] 20220415045258.199825-11-hch@lst.de>
- References: <[🔎] 20220415045258.199825-1-hch@lst.de> <[🔎] 20220415045258.199825-11-hch@lst.de>
On 4/15/22 13:52, Christoph Hellwig wrote:
> Use the bdev based helper instead of poking into the queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> mm/swapfile.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 63c61f8b26118..4c7537162af5e 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)) {
Looks good.
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
--
Damien Le Moal
Western Digital Research
Reply to: