--- zfs-2.0.0/module/os/linux/zfs/zpl_file.c 2020-11-30 21:24:46.378091605 +0300 +++ save.zfs-2.0.0.vz7.151.14/module/os/linux/zfs/zpl_file.c 2020-12-28 15:43:41.895067126 +0300 @@ -486,7 +486,7 @@ zpl_direct_IO(int rw, struct kiocb *kioc #error "Unknown direct IO interface" #endif -#else +#else /* HAVE_VFS_RW_ITERATE */ #if defined(HAVE_VFS_DIRECT_IO_IOVEC) static ssize_t @@ -496,6 +496,19 @@ zpl_direct_IO(int rw, struct kiocb *kioc if (rw == WRITE) return (zpl_aio_write(kiocb, iovp, nr_segs, pos)); else + return (zpl_aio_read(kiocb, iovp, nr_segs, pos)); +} +#elif defined(HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET) +static ssize_t +zpl_direct_IO(int rw, struct kiocb *kiocb, struct iov_iter *iter, loff_t pos) +{ + const struct iovec *iovp = iov_iter_iovec(iter); + unsigned long nr_segs = iter->nr_segs; + + ASSERT3S(pos, ==, kiocb->ki_pos); + if (rw == WRITE) + return (zpl_aio_write(kiocb, iovp, nr_segs, pos)); + else return (zpl_aio_read(kiocb, iovp, nr_segs, pos)); } #else