mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
iomap: simplify direct io validity check
The block layer checks all the segments for validity later, so no need for an early check. Just reduce it to a simple position and total length check, and defer the more invasive segment checks to the block layer. Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
1 parent
5ff3f74e14
commit
7eac331869
1 file changed
+1
-2
@@ -337,8 +337,7 @@ static int iomap_dio_bio_iter(struct iomap_iter *iter, struct iomap_dio *dio)
|
||||
u64 copied = 0;
|
||||
size_t orig_count;
|
||||
|
||||
if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1) ||
|
||||
!bdev_iter_is_aligned(iomap->bdev, dio->submit.iter))
|
||||
if ((pos | length) & (bdev_logical_block_size(iomap->bdev) - 1))
|
||||
return -EINVAL;
|
||||
|
||||
if (dio->flags & IOMAP_DIO_WRITE) {
|
||||
|
||||
Reference in new issue
Block a user