mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-12-19 00:48:57 +01:00
block: remove two comments in bio_split_discard
A zero discard_granularity is not treated the same as a single-block one, and not having any segments after taking alignment is perfectly fine and does not need a warning. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20231228075545.362768-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d6b9f4e6f7
commit
928a5dd3a8
|
|
@ -115,17 +115,13 @@ static struct bio *bio_split_discard(struct bio *bio,
|
||||||
|
|
||||||
*nsegs = 1;
|
*nsegs = 1;
|
||||||
|
|
||||||
/* Zero-sector (unknown) and one-sector granularities are the same. */
|
|
||||||
granularity = max(lim->discard_granularity >> 9, 1U);
|
granularity = max(lim->discard_granularity >> 9, 1U);
|
||||||
|
|
||||||
max_discard_sectors =
|
max_discard_sectors =
|
||||||
min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
|
min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
|
||||||
max_discard_sectors -= max_discard_sectors % granularity;
|
max_discard_sectors -= max_discard_sectors % granularity;
|
||||||
|
if (unlikely(!max_discard_sectors))
|
||||||
if (unlikely(!max_discard_sectors)) {
|
|
||||||
/* XXX: warn */
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (bio_sectors(bio) <= max_discard_sectors)
|
if (bio_sectors(bio) <= max_discard_sectors)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user