@@ -8471,7 +8471,7 @@ static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip)
return 0;
}
-static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
+static blk_qc_t btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
loff_t file_offset)
{
struct btrfs_dio_private *dip = NULL;
@@ -8524,7 +8524,7 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
ret = btrfs_submit_direct_hook(dip);
if (!ret)
- return;
+ return BLK_QC_T_NONE;
btrfs_io_bio_free_csum(io_bio);
@@ -8567,6 +8567,7 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode,
if (bio)
bio_put(bio);
kfree(dip);
+ return BLK_QC_T_NONE;
}
static ssize_t check_direct_IO(struct btrfs_fs_info *fs_info,
@@ -8606,6 +8607,10 @@ static const struct iomap_ops dio_iomap_ops = {
.iomap_begin = direct_iomap_begin,
};
+static struct iomap_dio_ops btrfs_dops = {
+ .submit_io = btrfs_submit_direct,
+};
+
ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
{
struct file *file = iocb->ki_filp;
@@ -8665,7 +8670,8 @@ ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
flags = DIO_LOCKING | DIO_SKIP_HOLES;
}
- ret = iomap_dio_rw(iocb, iter, &dio_iomap_ops, NULL, is_sync_kiocb(iocb));
+ ret = iomap_dio_rw(iocb, iter, &dio_iomap_ops, &btrfs_dops,
+ is_sync_kiocb(iocb));
if (iov_iter_rw(iter) == WRITE) {
up_read(&BTRFS_I(inode)->dio_sem);