summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-06-11 15:02:24 -0700
committerBrian Behlendorf <[email protected]>2010-06-11 15:57:25 -0700
commitbb1bb2c4c49659b47d65beb8ac24dc2c86989553 (patch)
tree13fdc45e63b85653597cd479a7b1d3a16b2c31c9 /include
parent750a7101f8deecc4e8187f16c880cded2667cef8 (diff)
Add xuio_* structures and typedefs.
Add the basic xuio structure and typedefs for Solaris style zero copy. There's a decent chance this will not be the way I handle this on Linux but providing the basic types simplifies things for now.
Diffstat (limited to 'include')
-rw-r--r--include/sys/uio.h60
1 files changed, 50 insertions, 10 deletions
diff --git a/include/sys/uio.h b/include/sys/uio.h
index 83e9cc62a..87da72701 100644
--- a/include/sys/uio.h
+++ b/include/sys/uio.h
@@ -29,6 +29,8 @@
#include <asm/uaccess.h>
#include <sys/types.h>
+typedef struct iovec iovec_t;
+
typedef enum uio_rw {
UIO_READ = 0,
UIO_WRITE = 1,
@@ -37,23 +39,61 @@ typedef enum uio_rw {
typedef enum uio_seg {
UIO_USERSPACE = 0,
UIO_SYSSPACE = 1,
- UIO_USERISPACE =2,
+ UIO_USERISPACE= 2,
} uio_seg_t;
typedef struct uio {
- struct iovec *uio_iov; /* pointer to array of iovecs */
- int uio_iovcnt; /* number of iovecs */
- offset_t uio_loffset; /* file offset */
- uio_seg_t uio_segflg; /* address space (kernel or user) */
- uint16_t uio_fmode; /* file mode flags */
- uint16_t uio_extflg; /* extended flags */
- offset_t uio_limit; /* u-limit (maximum byte offset) */
- ssize_t uio_resid; /* residual count */
+ struct iovec *uio_iov;
+ int uio_iovcnt;
+ offset_t uio_loffset;
+ uio_seg_t uio_segflg;
+ uint16_t uio_fmode;
+ uint16_t uio_extflg;
+ offset_t uio_limit;
+ ssize_t uio_resid;
} uio_t;
typedef struct aio_req {
- uio_t *aio_uio; /* UIO for this request */
+ uio_t *aio_uio;
void *aio_private;
} aio_req_t;
+typedef enum xuio_type {
+ UIOTYPE_ASYNCIO,
+ UIOTYPE_ZEROCOPY,
+} xuio_type_t;
+
+
+#define UIOA_IOV_MAX 16
+
+typedef struct uioa_page_s {
+ int uioa_pfncnt;
+ void **uioa_ppp;
+ caddr_t uioa_base;
+ size_t uioa_len;
+} uioa_page_t;
+
+typedef struct xuio {
+ uio_t xu_uio;
+ enum xuio_type xu_type;
+ union {
+ struct {
+ uint32_t xu_a_state;
+ ssize_t xu_a_mbytes;
+ uioa_page_t *xu_a_lcur;
+ void **xu_a_lppp;
+ void *xu_a_hwst[4];
+ uioa_page_t xu_a_locked[UIOA_IOV_MAX];
+ } xu_aio;
+
+ struct {
+ int xu_zc_rw;
+ void *xu_zc_priv;
+ } xu_zc;
+ } xu_ext;
+} xuio_t;
+
+#define XUIO_XUZC_PRIV(xuio) xuio->xu_ext.xu_zc.xu_zc_priv
+#define XUIO_XUZC_RW(xuio) xuio->xu_ext.xu_zc.xu_zc_rw
+
#endif /* SPL_UIO_H */