aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/os/linux/spl/sys/uio.h6
-rw-r--r--module/os/linux/zfs/zpl_file.c7
2 files changed, 8 insertions, 5 deletions
diff --git a/include/os/linux/spl/sys/uio.h b/include/os/linux/spl/sys/uio.h
index 082e930e4..cce097e16 100644
--- a/include/os/linux/spl/sys/uio.h
+++ b/include/os/linux/spl/sys/uio.h
@@ -179,4 +179,10 @@ zfs_uio_iov_iter_init(zfs_uio_t *uio, struct iov_iter *iter, offset_t offset,
#define zfs_uio_iter_iov(iter) (iter)->iov
#endif
+#if defined(HAVE_IOV_ITER_TYPE)
+#define zfs_uio_iov_iter_type(iter) iov_iter_type((iter))
+#else
+#define zfs_uio_iov_iter_type(iter) (iter)->type
+#endif
+
#endif /* SPL_UIO_H */
diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c
index aedafd600..f6af2ebd1 100644
--- a/module/os/linux/zfs/zpl_file.c
+++ b/module/os/linux/zfs/zpl_file.c
@@ -300,13 +300,10 @@ zpl_uio_init(zfs_uio_t *uio, struct kiocb *kiocb, struct iov_iter *to,
{
#if defined(HAVE_VFS_IOV_ITER)
zfs_uio_iov_iter_init(uio, to, pos, count, skip);
-#elif defined(HAVE_IOV_ITER_TYPE)
- zfs_uio_iovec_init(uio, zfs_uio_iter_iov(to), to->nr_segs, pos,
- iov_iter_type(to) & ITER_KVEC ? UIO_SYSSPACE : UIO_USERSPACE,
- count, skip);
#else
zfs_uio_iovec_init(uio, zfs_uio_iter_iov(to), to->nr_segs, pos,
- to->type & ITER_KVEC ? UIO_SYSSPACE : UIO_USERSPACE,
+ zfs_uio_iov_iter_type(to) & ITER_KVEC ?
+ UIO_SYSSPACE : UIO_USERSPACE,
count, skip);
#endif
}