struct btrfs_dio_data data = { 0 };
return iomap_dio_rw(iocb, iter, &btrfs_dio_iomap_ops, &btrfs_dio_ops,
- IOMAP_DIO_PARTIAL, &data, done_before);
+ IOMAP_DIO_PARTIAL | IOMAP_DIO_FSBLOCK_ALIGNED, &data, done_before);
}
static struct iomap_dio *btrfs_dio_write(struct kiocb *iocb, struct iov_iter *iter,
struct btrfs_dio_data data = { 0 };
return __iomap_dio_rw(iocb, iter, &btrfs_dio_iomap_ops, &btrfs_dio_ops,
- IOMAP_DIO_PARTIAL, &data, done_before);
+ IOMAP_DIO_PARTIAL | IOMAP_DIO_FSBLOCK_ALIGNED, &data, done_before);
}
static ssize_t check_direct_IO(struct btrfs_fs_info *fs_info,
if (iov_iter_alignment(iter) & blocksize_mask)
return -EINVAL;
-
- /*
- * For bs > ps support, we heavily rely on large folios to make sure no
- * block will cross large folio boundaries.
- *
- * But memory provided by direct IO is only virtually contiguous, not
- * physically contiguous, and will break the btrfs' large folio requirement.
- *
- * So for bs > ps support, all direct IOs should fallback to buffered ones.
- */
- if (fs_info->sectorsize > PAGE_SIZE)
- return -EINVAL;
-
return 0;
}