From: Christoph Hellwig <hch@infradead.org>
To: ziniu.wang_1@nxp.com
Cc: axboe@kernel.dk, ulf.hansson@linaro.org,
linux-block@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v2 1/2] block: decouple secure erase size limit from discard size limit
Date: Mon, 15 Dec 2025 07:43:12 -0800 [thread overview]
Message-ID: <aUAskIkCHiVmKs87@infradead.org> (raw)
In-Reply-To: <20251215102010.608421-2-ziniu.wang_1@nxp.com>
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -169,8 +169,13 @@ struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *lim,
>
> granularity = max(lim->discard_granularity >> 9, 1U);
>
> - max_discard_sectors =
> - min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
> + if (bio_op(bio) == REQ_OP_SECURE_ERASE)
> + max_discard_sectors = min(lim->max_secure_erase_sectors,
> + bio_allowed_max_sectors(lim));
> + else
> + max_discard_sectors = min(lim->max_discard_sectors,
> + bio_allowed_max_sectors(lim));
Please factor our a low-level helper and pass the max_sectors
as argument.
next prev parent reply other threads:[~2025-12-15 15:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 10:20 [PATCH v2 0/2] Optimize secure erase performance for certain Kingston eMMC devices ziniu.wang_1
2025-12-15 10:20 ` [PATCH v2 1/2] block: decouple secure erase size limit from discard size limit ziniu.wang_1
2025-12-15 15:43 ` Christoph Hellwig [this message]
2025-12-17 3:30 ` [EXT] " Luke Wang
2025-12-15 10:20 ` [PATCH v2 2/2] mmc: add quirk to optimize certain Kingston eMMC secure erase/trim performance ziniu.wang_1
2026-01-29 15:07 ` Ulf Hansson
2025-12-15 15:37 ` [PATCH v2 0/2] Optimize secure erase performance for certain Kingston eMMC devices Ulf Hansson
2025-12-16 10:02 ` [EXT] " Luke Wang
2025-12-16 10:47 ` Christoph Hellwig
2025-12-16 12:15 ` Ulf Hansson
2025-12-17 3:42 ` Luke Wang
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=aUAskIkCHiVmKs87@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=imx@lists.linux.dev \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=ziniu.wang_1@nxp.com \
/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.