[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dm-devel] [PATCH 11/11] xen-blkback: use bdev_discard_alignment
- To: Christoph Hellwig <hch@xxxxxx>, Jens Axboe <axboe@xxxxxxxxx>
- From: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Apr 2022 17:03:38 +0900
- Authentication-results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com
- Cc: Jan Hoeppner <hoeppner@xxxxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, linux-nvme@xxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, Song Liu <song@xxxxxxxxxx>, dm-devel@xxxxxxxxxx, "Md. Haris Iqbal" <haris.iqbal@xxxxxxxxx>, Jack Wang <jinpu.wang@xxxxxxxxx>, linux-s390@xxxxxxxxxxxxxxx, Richard Weinberger <richard@xxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, Mike Snitzer <snitzer@xxxxxxxxxx>, Josef Bacik <josef@xxxxxxxxxxxxxx>, nbd@xxxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, Stefan Haberland <sth@xxxxxxxxxxxxx>, linux-raid@xxxxxxxxxxxxxxx, "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>, Johannes Berg <johannes@xxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Mon, 18 Apr 2022 08:03:50 +0000
- Ironport-sdr: EZv3uLcC1dQHJThopLQlejGyQWVPvjXLdxnQ0C0w01HLMA5o0ZJRaogTV1wlHb4/Q/w+zPZ9+9 OExgT3jfo+3CY1cf8MX53I/BHrLEDIVqwmZURG1jHV/Z0AUkdV/KsXlz2Q/RFUZ/L3UcJECC8l c3ZTJnxarvJj/i9PGps9tkWBZ0rHDGtgI82SOWSn5fzGv1sj9YkQAAzkDqSmIuTbsqCpxyD3Ag R4VrbcrR9aj+AWBnkiYAyXozG1hE7P2P4ZlYq27sCCmlwAAnzE2KL8KVdz0mPijUhR4G738pkw nSUUmuWbG0y0J237G2SRYwv5
- Ironport-sdr: FzI1DlYTfmOdUDHCnSQhuP5LJ92ZlCsmTBwLm4MWvTpCgx0kq8WRmc45c51e5Q/2qCCDa+kaHb JkYJslACdFipRMLvDG2/IaELV8LT75MwLLDSZsFxt27g/nCIhKhu9hoSsW/65tDZlc21QAe4Ev u6jz1dAoIP9q3iMl8K7EuiqnJACe4WEMUyYWxqxT/H6khAflJ2I4IGsLnPPLuCtkyP5/0Jv+Y2 KvlECgNMWmnCJ5JCQ3cP9UnqaVNIUcc8WXwh3H9wQ+BVXVGKw7mXbXHR328Ub/eNaUMjnUGqns aZM=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Wdcironportexception: Internal
On 4/18/22 13:53, Christoph Hellwig wrote:
> Use bdev_discard_alignment to calculate the correct discard alignment
> offset even for partitions instead of just looking at the queue limit.
>
> Also switch to use bdev_discard_granularity to get rid of the last direct
> queue reference in xen_blkbk_discard.
>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
> drivers/block/xen-blkback/xenbus.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/xen-blkback/xenbus.c
> b/drivers/block/xen-blkback/xenbus.c
> index b21bffc9c50bc..04c90cb8955f6 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -583,14 +583,14 @@ static void xen_blkbk_discard(struct xenbus_transaction
> xbt, struct backend_info
> if (bdev_max_discard_sectors(bdev)) {
> err = xenbus_printf(xbt, dev->nodename,
> "discard-granularity", "%u",
> - q->limits.discard_granularity);
> + bdev_discard_granularity(bdev));
> if (err) {
> dev_warn(&dev->dev, "writing discard-granularity (%d)",
> err);
> return;
> }
> err = xenbus_printf(xbt, dev->nodename,
> "discard-alignment", "%u",
> - q->limits.discard_alignment);
> + bdev_discard_alignment(bdev));
> if (err) {
> dev_warn(&dev->dev, "writing discard-alignment (%d)",
> err);
> return;
Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
--
Damien Le Moal
Western Digital Research
|