All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Juergen Gross" <jgross@suse.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Jens Axboe" <axboe@kernel.dk>,
	xen-devel@lists.xenproject.org, linux-block@vger.kernel.org
Subject: [PATCH 2/4] xen-blkfront: rely on the default discard granularity
Date: Tue, 20 Feb 2024 09:49:33 +0100	[thread overview]
Message-ID: <20240220084935.3282351-3-hch@lst.de> (raw)
In-Reply-To: <20240220084935.3282351-1-hch@lst.de>

The block layer now sets the discard granularity to the physical
block size default.  Take advantage of that in xen-blkfront and only
set the discard granularity if explicitly specified.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/xen-blkfront.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index f78167cd5a6333..1258f24b285500 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -951,8 +951,8 @@ static void blkif_set_queue_limits(struct blkfront_info *info)
 
 	if (info->feature_discard) {
 		blk_queue_max_discard_sectors(rq, UINT_MAX);
-		rq->limits.discard_granularity = info->discard_granularity ?:
-						 info->physical_sector_size;
+		if (info->discard_granularity)
+			rq->limits.discard_granularity = info->discard_granularity;
 		rq->limits.discard_alignment = info->discard_alignment;
 		if (info->feature_secdiscard)
 			blk_queue_max_secure_erase_sectors(rq, UINT_MAX);
-- 
2.39.2


  parent reply	other threads:[~2024-02-20  8:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20  8:49 convert xen-blkfront to atomic queue limit updates Christoph Hellwig
2024-02-20  8:49 ` [PATCH 1/4] xen-blkfront: set max_discard/secure erase limits to UINT_MAX Christoph Hellwig
2024-02-20 11:39   ` Roger Pau Monné
2024-02-20 15:50     ` Christoph Hellwig
2024-02-20  8:49 ` Christoph Hellwig [this message]
2024-02-20 11:50   ` [PATCH 2/4] xen-blkfront: rely on the default discard granularity Roger Pau Monné
2024-02-20  8:49 ` [PATCH 3/4] xen-blkfront: don't redundantly set max_sements in blkif_recover Christoph Hellwig
2024-02-20 12:16   ` Roger Pau Monné
2024-02-20  8:49 ` [PATCH 4/4] xen-blkfront: atomically update queue limits Christoph Hellwig
2024-02-20 12:35   ` Roger Pau Monné
2024-02-20 15:53     ` Christoph Hellwig
2024-02-21 12:58 convert xen-blkfront to atomic queue limit updates v2 Christoph Hellwig
2024-02-21 12:58 ` [PATCH 2/4] xen-blkfront: rely on the default discard granularity Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240220084935.3282351-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=jgross@suse.com \
    --cc=linux-block@vger.kernel.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.