]> git.proxmox.com Git - mirror_spl-debian.git/blob - include/sys/uio.h
Public Release Prep
[mirror_spl-debian.git] / include / sys / uio.h
1 /*****************************************************************************\
2 * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
3 * Copyright (C) 2007 The Regents of the University of California.
4 * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
5 * Written by Brian Behlendorf <behlendorf1@llnl.gov>.
6 * UCRL-CODE-235197
7 *
8 * This file is part of the SPL, Solaris Porting Layer.
9 * For details, see <http://github.com/behlendorf/spl/>.
10 *
11 * The SPL is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 * The SPL is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 * for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with the SPL. If not, see <http://www.gnu.org/licenses/>.
23 \*****************************************************************************/
24
25 #ifndef _SPL_UIO_H
26 #define _SPL_UIO_H
27
28 #include <linux/uio.h>
29 #include <asm/uaccess.h>
30 #include <sys/types.h>
31
32 typedef enum uio_rw {
33 UIO_READ = 0,
34 UIO_WRITE = 1,
35 } uio_rw_t;
36
37 typedef enum uio_seg {
38 UIO_USERSPACE = 0,
39 UIO_SYSSPACE = 1,
40 UIO_USERISPACE =2,
41 } uio_seg_t;
42
43 typedef struct uio {
44 struct iovec *uio_iov; /* pointer to array of iovecs */
45 int uio_iovcnt; /* number of iovecs */
46 offset_t uio_loffset; /* file offset */
47 uio_seg_t uio_segflg; /* address space (kernel or user) */
48 uint16_t uio_fmode; /* file mode flags */
49 uint16_t uio_extflg; /* extended flags */
50 offset_t uio_limit; /* u-limit (maximum byte offset) */
51 ssize_t uio_resid; /* residual count */
52 } uio_t;
53
54 typedef struct aio_req {
55 uio_t *aio_uio; /* UIO for this request */
56 void *aio_private;
57 } aio_req_t;
58
59 #endif /* SPL_UIO_H */