Skip to content

Commit

Permalink
block: remove the LBA alignment check in __blkdev_issue_zeroout
Browse files Browse the repository at this point in the history
__blkdev_issue_zeroout is a purely kernel internal API and thus can rely
on the block layer sector alignment checks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240701165219.1571322-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and axboe committed Jul 5, 2024
1 parent 73a768d commit ff760a8
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions block/blk-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@ int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
unsigned flags)
{
int ret;
sector_t bs_mask;

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

ret = __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp_mask,
biop, flags);
Expand Down

0 comments on commit ff760a8

Please sign in to comment.