Skip to content

Commit 928a5dd

Browse files
Christoph Hellwigaxboe
authored andcommitted
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>
1 parent d6b9f4e commit 928a5dd

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

block/blk-merge.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,13 @@ static struct bio *bio_split_discard(struct bio *bio,
115115

116116
*nsegs = 1;
117117

118-
/* Zero-sector (unknown) and one-sector granularities are the same. */
119118
granularity = max(lim->discard_granularity >> 9, 1U);
120119

121120
max_discard_sectors =
122121
min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
123122
max_discard_sectors -= max_discard_sectors % granularity;
124-
125-
if (unlikely(!max_discard_sectors)) {
126-
/* XXX: warn */
123+
if (unlikely(!max_discard_sectors))
127124
return NULL;
128-
}
129125

130126
if (bio_sectors(bio) <= max_discard_sectors)
131127
return NULL;

0 commit comments

Comments
 (0)