[PATCH 06/10] block: remove the LBA alignment check in __blkdev_issue_zeroout

Christoph Hellwig
2024-07-01T16:52:48Z

__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>
---
block/blk-lib.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/block/blk-lib.c b/block/blk-lib.c
index f338709aef0c30..7aa7937c34201d 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -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);
--
2.43.0