Skip to content

Commit

Permalink
block: remove the discard_granularity check in __blkdev_issue_discard
Browse files Browse the repository at this point in the history
We now set a default granularity in the queue limits API, so don't
bother with this extra check.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240506042027.2289826-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed May 7, 2024
1 parent ccb326b commit 0942592
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions block/blk-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
if (!bdev_max_discard_sectors(bdev))
return -EOPNOTSUPP;

/* In case the discard granularity isn't set by buggy device driver */
if (WARN_ON_ONCE(!bdev_discard_granularity(bdev))) {
pr_err_ratelimited("%pg: Error: discard_granularity is 0.\n",
bdev);
return -EOPNOTSUPP;
}

bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1;
if ((sector | nr_sects) & bs_mask)
return -EINVAL;
Expand Down

0 comments on commit 0942592

Please sign in to comment.