xref: /minix3/sys/fs/puffs/puffs_msgif.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: puffs_msgif.h,v 1.84 2015/02/15 20:21:29 manu Exp $	*/
284d9c625SLionel Sambuc 
384d9c625SLionel Sambuc /*
484d9c625SLionel Sambuc  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
584d9c625SLionel Sambuc  *
684d9c625SLionel Sambuc  * Development of this software was supported by the
784d9c625SLionel Sambuc  * Google Summer of Code program and the Ulla Tuominen Foundation.
884d9c625SLionel Sambuc  * The Google SoC project was mentored by Bill Studenmund.
984d9c625SLionel Sambuc  *
1084d9c625SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
1184d9c625SLionel Sambuc  * modification, are permitted provided that the following conditions
1284d9c625SLionel Sambuc  * are met:
1384d9c625SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
1484d9c625SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
1584d9c625SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
1684d9c625SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
1784d9c625SLionel Sambuc  *    documentation and/or other materials provided with the distribution.
1884d9c625SLionel Sambuc  *
1984d9c625SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
2084d9c625SLionel Sambuc  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2184d9c625SLionel Sambuc  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2284d9c625SLionel Sambuc  * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2384d9c625SLionel Sambuc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2484d9c625SLionel Sambuc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2584d9c625SLionel Sambuc  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2684d9c625SLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2784d9c625SLionel Sambuc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2884d9c625SLionel Sambuc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2984d9c625SLionel Sambuc  * SUCH DAMAGE.
3084d9c625SLionel Sambuc  */
3184d9c625SLionel Sambuc 
3284d9c625SLionel Sambuc #ifndef _FS_PUFFS_PUFFS_MSGIF_H_
3384d9c625SLionel Sambuc #define _FS_PUFFS_PUFFS_MSGIF_H_
3484d9c625SLionel Sambuc 
3584d9c625SLionel Sambuc #include <sys/param.h>
3684d9c625SLionel Sambuc #include <sys/time.h>
3784d9c625SLionel Sambuc #include <sys/ioccom.h>
3884d9c625SLionel Sambuc #include <sys/uio.h>
3984d9c625SLionel Sambuc #include <sys/vnode.h>
4084d9c625SLionel Sambuc #include <sys/ucred.h>
4184d9c625SLionel Sambuc #include <sys/statvfs.h>
4284d9c625SLionel Sambuc #include <sys/dirent.h>
4384d9c625SLionel Sambuc #include <sys/fcntl.h>
4484d9c625SLionel Sambuc 
4584d9c625SLionel Sambuc #if !defined(__minix)
4684d9c625SLionel Sambuc #include <dev/putter/putter.h>
4784d9c625SLionel Sambuc #endif /* !defined(__minix) */
4884d9c625SLionel Sambuc 
4984d9c625SLionel Sambuc #include <uvm/uvm_prot.h>
5084d9c625SLionel Sambuc 
5184d9c625SLionel Sambuc #define PUFFSOP_VFS		0x01	/* kernel-> */
5284d9c625SLionel Sambuc #define PUFFSOP_VN		0x02	/* kernel-> */
5384d9c625SLionel Sambuc #define PUFFSOP_CACHE		0x03	/* only kernel-> */
5484d9c625SLionel Sambuc #define PUFFSOP_ERROR		0x04	/* only kernel-> */
5584d9c625SLionel Sambuc #define PUFFSOP_FLUSH		0x05	/* ->kernel */
5684d9c625SLionel Sambuc #define PUFFSOP_SUSPEND		0x06	/* ->kernel */
5784d9c625SLionel Sambuc #define PUFFSOP_UNMOUNT		0x07	/* ->kernel */
5884d9c625SLionel Sambuc 
5984d9c625SLionel Sambuc #define PUFFSOPFLAG_FAF		0x10	/* fire-and-forget */
6084d9c625SLionel Sambuc #define PUFFSOPFLAG_ISRESPONSE	0x20	/* req is actually a resp */
6184d9c625SLionel Sambuc 
6284d9c625SLionel Sambuc #define PUFFSOP_OPCMASK		0x07
6384d9c625SLionel Sambuc #define PUFFSOP_OPCLASS(a)	((a) & PUFFSOP_OPCMASK)
6484d9c625SLionel Sambuc #define PUFFSOP_WANTREPLY(a)	(((a) & PUFFSOPFLAG_FAF) == 0)
6584d9c625SLionel Sambuc 
6684d9c625SLionel Sambuc enum {
6784d9c625SLionel Sambuc 	PUFFS_VFS_MOUNT,	PUFFS_VFS_START,	PUFFS_VFS_UNMOUNT,
6884d9c625SLionel Sambuc 	PUFFS_VFS_ROOT,		PUFFS_VFS_QUOTACTL,	PUFFS_VFS_STATVFS,
6984d9c625SLionel Sambuc 	PUFFS_VFS_SYNC,		PUFFS_VFS_VGET,		PUFFS_VFS_FHTOVP,
7084d9c625SLionel Sambuc 	PUFFS_VFS_VPTOFH,	PUFFS_VFS_INIT,		PUFFS_VFS_DONE,
7184d9c625SLionel Sambuc 	PUFFS_VFS_SNAPSHOT,	PUFFS_VFS_EXTATTRCTL,	PUFFS_VFS_SUSPEND
7284d9c625SLionel Sambuc };
7384d9c625SLionel Sambuc #define PUFFS_VFS_MAX PUFFS_VFS_SUSPEND
7484d9c625SLionel Sambuc 
7584d9c625SLionel Sambuc enum {
7684d9c625SLionel Sambuc 	PUFFS_VN_LOOKUP,	PUFFS_VN_CREATE,	PUFFS_VN_MKNOD,
7784d9c625SLionel Sambuc 	PUFFS_VN_OPEN,		PUFFS_VN_CLOSE,		PUFFS_VN_ACCESS,
7884d9c625SLionel Sambuc 	PUFFS_VN_GETATTR,	PUFFS_VN_SETATTR,	PUFFS_VN_READ,
7984d9c625SLionel Sambuc 	PUFFS_VN_WRITE,		PUFFS_VN_IOCTL,		PUFFS_VN_FCNTL,
8084d9c625SLionel Sambuc 	PUFFS_VN_POLL,		PUFFS_VN_KQFILTER,	PUFFS_VN_REVOKE,
8184d9c625SLionel Sambuc 	PUFFS_VN_MMAP,		PUFFS_VN_FSYNC,		PUFFS_VN_SEEK,
8284d9c625SLionel Sambuc 	PUFFS_VN_REMOVE,	PUFFS_VN_LINK,		PUFFS_VN_RENAME,
8384d9c625SLionel Sambuc 	PUFFS_VN_MKDIR,		PUFFS_VN_RMDIR,		PUFFS_VN_SYMLINK,
8484d9c625SLionel Sambuc 	PUFFS_VN_READDIR,	PUFFS_VN_READLINK,	PUFFS_VN_ABORTOP,
8584d9c625SLionel Sambuc 	PUFFS_VN_INACTIVE,	PUFFS_VN_RECLAIM,	PUFFS_VN_LOCK,
8684d9c625SLionel Sambuc 	PUFFS_VN_UNLOCK,	PUFFS_VN_BMAP,		PUFFS_VN_STRATEGY,
8784d9c625SLionel Sambuc 	PUFFS_VN_PRINT,		PUFFS_VN_ISLOCKED,	PUFFS_VN_PATHCONF,
8884d9c625SLionel Sambuc 	PUFFS_VN_ADVLOCK,	PUFFS_VN_LEASE,		PUFFS_VN_WHITEOUT,
8984d9c625SLionel Sambuc 	PUFFS_VN_GETPAGES,	PUFFS_VN_PUTPAGES,	PUFFS_VN_GETEXTATTR,
9084d9c625SLionel Sambuc 	PUFFS_VN_LISTEXTATTR,	PUFFS_VN_OPENEXTATTR,	PUFFS_VN_DELETEEXTATTR,
91*0a6a1f1dSLionel Sambuc 	PUFFS_VN_SETEXTATTR,	PUFFS_VN_CLOSEEXTATTR,	PUFFS_VN_FALLOCATE,
92*0a6a1f1dSLionel Sambuc 	PUFFS_VN_FDISCARD,
9384d9c625SLionel Sambuc 	/* NOTE: If you add an op, decrement PUFFS_VN_SPARE accordingly */
9484d9c625SLionel Sambuc };
95*0a6a1f1dSLionel Sambuc #define PUFFS_VN_MAX PUFFS_VN_FDISCARD
96*0a6a1f1dSLionel Sambuc #define PUFFS_VN_SPARE 30
9784d9c625SLionel Sambuc 
9884d9c625SLionel Sambuc /*
9984d9c625SLionel Sambuc  * These signal invalid parameters the file system returned.
10084d9c625SLionel Sambuc  */
10184d9c625SLionel Sambuc enum {
10284d9c625SLionel Sambuc 	PUFFS_ERR_ERROR,
10384d9c625SLionel Sambuc 	PUFFS_ERR_MAKENODE,	PUFFS_ERR_LOOKUP,	PUFFS_ERR_READDIR,
10484d9c625SLionel Sambuc 	PUFFS_ERR_READLINK,	PUFFS_ERR_READ,		PUFFS_ERR_WRITE,
10584d9c625SLionel Sambuc 	PUFFS_ERR_VPTOFH,	PUFFS_ERR_GETEXTATTR,	PUFFS_ERR_LISTEXTATTR
10684d9c625SLionel Sambuc };
10784d9c625SLionel Sambuc #define PUFFS_ERR_MAX PUFFS_ERR_LISTEXTATTR
10884d9c625SLionel Sambuc 
10984d9c625SLionel Sambuc #define PUFFSVERSION	30
11084d9c625SLionel Sambuc #define PUFFSNAMESIZE	32
11184d9c625SLionel Sambuc 
11284d9c625SLionel Sambuc #define PUFFS_TYPEPREFIX "puffs|"
11384d9c625SLionel Sambuc 
11484d9c625SLionel Sambuc #define PUFFS_TYPELEN (_VFS_NAMELEN - (sizeof(PUFFS_TYPEPREFIX)+1))
11584d9c625SLionel Sambuc #define PUFFS_NAMELEN (_VFS_MNAMELEN-1)
11684d9c625SLionel Sambuc 
11784d9c625SLionel Sambuc /*
11884d9c625SLionel Sambuc  * Just a weak typedef for code clarity.  Additionally, we have a
11984d9c625SLionel Sambuc  * more appropriate vanity type for puffs:
12084d9c625SLionel Sambuc  * <uep> it should be croissant, not cookie.
12184d9c625SLionel Sambuc  */
12284d9c625SLionel Sambuc typedef void *puffs_cookie_t;
12384d9c625SLionel Sambuc typedef puffs_cookie_t puffs_croissant_t;
12484d9c625SLionel Sambuc 
12584d9c625SLionel Sambuc struct puffs_kargs {
12684d9c625SLionel Sambuc 	unsigned int	pa_vers;
12784d9c625SLionel Sambuc 	int		pa_fd;
12884d9c625SLionel Sambuc 
12984d9c625SLionel Sambuc 	uint32_t	pa_flags;
13084d9c625SLionel Sambuc 
13184d9c625SLionel Sambuc 	size_t		pa_maxmsglen;
13284d9c625SLionel Sambuc 	int		pa_nhashbuckets;
13384d9c625SLionel Sambuc 
13484d9c625SLionel Sambuc 	size_t		pa_fhsize;
13584d9c625SLionel Sambuc 	int		pa_fhflags;
13684d9c625SLionel Sambuc 
13784d9c625SLionel Sambuc 	uint8_t		pa_vnopmask[PUFFS_VN_MAX + PUFFS_VN_SPARE];
13884d9c625SLionel Sambuc 
13984d9c625SLionel Sambuc 	char		pa_typename[_VFS_NAMELEN];
14084d9c625SLionel Sambuc 	char		pa_mntfromname[_VFS_MNAMELEN];
14184d9c625SLionel Sambuc 
14284d9c625SLionel Sambuc 	puffs_cookie_t	pa_root_cookie;
14384d9c625SLionel Sambuc 	enum vtype	pa_root_vtype;
14484d9c625SLionel Sambuc 	voff_t		pa_root_vsize;
14584d9c625SLionel Sambuc 	union {
14684d9c625SLionel Sambuc 		dev_t		dev;
14784d9c625SLionel Sambuc 		uint64_t	container;
14884d9c625SLionel Sambuc 	} devunion;
14984d9c625SLionel Sambuc 
15084d9c625SLionel Sambuc 	struct statvfs	pa_svfsb;
15184d9c625SLionel Sambuc 
15284d9c625SLionel Sambuc 	uint32_t	pa_time32;
15384d9c625SLionel Sambuc 
15484d9c625SLionel Sambuc 	uint32_t	pa_spare[127];
15584d9c625SLionel Sambuc };
15684d9c625SLionel Sambuc #define pa_root_rdev devunion.dev
15784d9c625SLionel Sambuc 
15884d9c625SLionel Sambuc #define PUFFS_KFLAG_NOCACHE_NAME	0x001	/* don't use name cache     */
15984d9c625SLionel Sambuc #define PUFFS_KFLAG_NOCACHE_PAGE	0x002	/* don't use page cache	    */
16084d9c625SLionel Sambuc #define PUFFS_KFLAG_NOCACHE		0x003	/* no cache whatsoever      */
16184d9c625SLionel Sambuc #define PUFFS_KFLAG_ALLOPS		0x004	/* ignore pa_vnopmask       */
16284d9c625SLionel Sambuc #define PUFFS_KFLAG_WTCACHE		0x008	/* write-through page cache */
16384d9c625SLionel Sambuc #define PUFFS_KFLAG_IAONDEMAND		0x010	/* inactive only on demand  */
16484d9c625SLionel Sambuc #define PUFFS_KFLAG_LOOKUP_FULLPNBUF	0x020	/* full pnbuf in lookup     */
16584d9c625SLionel Sambuc #define PUFFS_KFLAG_NOCACHE_ATTR	0x040	/* no attrib cache (unused) */
16684d9c625SLionel Sambuc #define PUFFS_KFLAG_CACHE_FS_TTL	0x080	/* cache use TTL from FS    */
16784d9c625SLionel Sambuc #define PUFFS_KFLAG_CACHE_DOTDOT	0x100	/* don't send lookup for .. */
168*0a6a1f1dSLionel Sambuc #define PUFFS_KFLAG_NOFLUSH_META	0x200	/* don't flush metadata cache*/
169*0a6a1f1dSLionel Sambuc #define PUFFS_KFLAG_MASK		0x3bf
17084d9c625SLionel Sambuc 
17184d9c625SLionel Sambuc #define PUFFS_FHFLAG_DYNAMIC		0x01
17284d9c625SLionel Sambuc #define PUFFS_FHFLAG_NFSV2		0x02
17384d9c625SLionel Sambuc #define PUFFS_FHFLAG_NFSV3		0x04
17484d9c625SLionel Sambuc #define PUFFS_FHFLAG_PROTOMASK		0x06
17584d9c625SLionel Sambuc #define PUFFS_FHFLAG_PASSTHROUGH	0x08
17684d9c625SLionel Sambuc #define PUFFS_FHFLAG_MASK		0x0f
17784d9c625SLionel Sambuc 
17884d9c625SLionel Sambuc #define PUFFS_FHSIZE_MAX	1020	/* FHANDLE_SIZE_MAX - 4 */
17984d9c625SLionel Sambuc 
18084d9c625SLionel Sambuc struct puffs_req {
18184d9c625SLionel Sambuc #if !defined(__minix)
18284d9c625SLionel Sambuc 	struct putter_hdr	preq_pth;
18384d9c625SLionel Sambuc #endif /* ! defined(__minix) */
18484d9c625SLionel Sambuc 
18584d9c625SLionel Sambuc 	uint64_t		preq_id;
18684d9c625SLionel Sambuc 	puffs_cookie_t		preq_cookie;
18784d9c625SLionel Sambuc 
18884d9c625SLionel Sambuc 	uint16_t		preq_opclass;
18984d9c625SLionel Sambuc 	uint16_t		preq_optype;
19084d9c625SLionel Sambuc 	int			preq_rv;
19184d9c625SLionel Sambuc 
19284d9c625SLionel Sambuc 	uint32_t		preq_setbacks;
19384d9c625SLionel Sambuc 
19484d9c625SLionel Sambuc 	/* Who is making the call?  Eventually host id is also needed. */
19584d9c625SLionel Sambuc 	pid_t			preq_pid;
19684d9c625SLionel Sambuc 	lwpid_t			preq_lid;
19784d9c625SLionel Sambuc 
19884d9c625SLionel Sambuc 	/*
19984d9c625SLionel Sambuc 	 * the following helper pads the struct size to md alignment
20084d9c625SLionel Sambuc 	 * multiple (should size_t not cut it).  it makes sure that
20184d9c625SLionel Sambuc 	 * whatever comes after this struct is aligned
20284d9c625SLionel Sambuc 	 */
20384d9c625SLionel Sambuc 	size_t  		preq_buflen;
20484d9c625SLionel Sambuc 	uint8_t	preq_buf[0] __aligned(ALIGNBYTES+1);
20584d9c625SLionel Sambuc };
20684d9c625SLionel Sambuc 
20784d9c625SLionel Sambuc #define PUFFS_SETBACK_INACT_N1	0x01	/* set VOP_INACTIVE for node 1 */
20884d9c625SLionel Sambuc #define PUFFS_SETBACK_INACT_N2	0x02	/* set VOP_INACTIVE for node 2 */
20984d9c625SLionel Sambuc #define PUFFS_SETBACK_NOREF_N1	0x04	/* set pn PN_NOREFS for node 1 */
21084d9c625SLionel Sambuc #define PUFFS_SETBACK_NOREF_N2	0x08	/* set pn PN_NOREFS for node 2 */
21184d9c625SLionel Sambuc #define PUFFS_SETBACK_MASK	0x0f
21284d9c625SLionel Sambuc 
21384d9c625SLionel Sambuc /*
21484d9c625SLionel Sambuc  * Flush operation.  This can be used to invalidate:
21584d9c625SLionel Sambuc  * 1) name cache for one node
21684d9c625SLionel Sambuc  * 2) name cache for all children
21784d9c625SLionel Sambuc  * 3) name cache for the entire mount
21884d9c625SLionel Sambuc  * 4) page cache for a set of ranges in one node
21984d9c625SLionel Sambuc  * 5) page cache for one entire node
22084d9c625SLionel Sambuc  *
22184d9c625SLionel Sambuc  * It can be used to flush:
22284d9c625SLionel Sambuc  * 1) page cache for a set of ranges in one node
22384d9c625SLionel Sambuc  * 2) page cache for one entire node
22484d9c625SLionel Sambuc  */
22584d9c625SLionel Sambuc 
22684d9c625SLionel Sambuc struct puffs_flush {
22784d9c625SLionel Sambuc 	struct puffs_req	pf_req;
22884d9c625SLionel Sambuc 
22984d9c625SLionel Sambuc 	puffs_cookie_t		pf_cookie;
23084d9c625SLionel Sambuc 
23184d9c625SLionel Sambuc 	int			pf_op;
23284d9c625SLionel Sambuc 	off_t			pf_start;
23384d9c625SLionel Sambuc 	off_t			pf_end;
23484d9c625SLionel Sambuc };
23584d9c625SLionel Sambuc #define PUFFS_INVAL_NAMECACHE_NODE		0
23684d9c625SLionel Sambuc #define PUFFS_INVAL_NAMECACHE_DIR		1
23784d9c625SLionel Sambuc #define PUFFS_INVAL_NAMECACHE_ALL		2
23884d9c625SLionel Sambuc #define PUFFS_INVAL_PAGECACHE_NODE_RANGE	3
23984d9c625SLionel Sambuc #define PUFFS_FLUSH_PAGECACHE_NODE_RANGE	4
24084d9c625SLionel Sambuc 
24184d9c625SLionel Sambuc /*
24284d9c625SLionel Sambuc  * Credentials for an operation.  Can be either struct uucred for
24384d9c625SLionel Sambuc  * ops called from a credential context or NOCRED/FSCRED for ops
24484d9c625SLionel Sambuc  * called from within the kernel.  It is up to the implementation
24584d9c625SLionel Sambuc  * if it makes a difference between these two and the super-user.
24684d9c625SLionel Sambuc  */
24784d9c625SLionel Sambuc struct puffs_kcred {
24884d9c625SLionel Sambuc 	struct uucred	pkcr_uuc;
24984d9c625SLionel Sambuc 	uint8_t		pkcr_type;
25084d9c625SLionel Sambuc 	uint8_t		pkcr_internal;
25184d9c625SLionel Sambuc };
25284d9c625SLionel Sambuc #define PUFFCRED_TYPE_UUC	1
25384d9c625SLionel Sambuc #define PUFFCRED_TYPE_INTERNAL	2
25484d9c625SLionel Sambuc #define PUFFCRED_CRED_NOCRED	1
25584d9c625SLionel Sambuc #define PUFFCRED_CRED_FSCRED	2
25684d9c625SLionel Sambuc 
25784d9c625SLionel Sambuc /*
25884d9c625SLionel Sambuc  * 2*MAXPHYS is the max size the system will attempt to copy,
25984d9c625SLionel Sambuc  * else treated as garbage
26084d9c625SLionel Sambuc  */
26184d9c625SLionel Sambuc #define PUFFS_MSG_MAXSIZE	2*MAXPHYS
26284d9c625SLionel Sambuc #define PUFFS_MSGSTRUCT_MAX	4096 /* approximate */
26384d9c625SLionel Sambuc 
26484d9c625SLionel Sambuc #define PUFFS_EXTNAMELEN KERNEL_NAME_MAX /* currently same as EXTATTR_MAXNAMELEN */
26584d9c625SLionel Sambuc 
26684d9c625SLionel Sambuc #define PUFFS_TOMOVE(a,b) (MIN((a), b->pmp_msg_maxsize - PUFFS_MSGSTRUCT_MAX))
26784d9c625SLionel Sambuc 
26884d9c625SLionel Sambuc /* puffs struct componentname built by kernel */
26984d9c625SLionel Sambuc struct puffs_kcn {
27084d9c625SLionel Sambuc 	/* args */
27184d9c625SLionel Sambuc 	uint32_t		pkcn_nameiop;	/* namei operation	*/
27284d9c625SLionel Sambuc 	uint32_t		pkcn_flags;	/* flags		*/
27384d9c625SLionel Sambuc 
27484d9c625SLionel Sambuc 	char pkcn_name[MAXPATHLEN];	/* nulterminated path component */
27584d9c625SLionel Sambuc 	size_t pkcn_namelen;		/* current component length	*/
27684d9c625SLionel Sambuc 	size_t pkcn_consume;		/* IN: extra chars server ate   */
27784d9c625SLionel Sambuc };
27884d9c625SLionel Sambuc 
27984d9c625SLionel Sambuc 
28084d9c625SLionel Sambuc /*
28184d9c625SLionel Sambuc  * Next come the individual requests.  They are all subclassed from
28284d9c625SLionel Sambuc  * puffs_req and contain request-specific fields in addition.  Note
28384d9c625SLionel Sambuc  * that there are some requests which have to handle arbitrary-length
28484d9c625SLionel Sambuc  * buffers.
28584d9c625SLionel Sambuc  *
28684d9c625SLionel Sambuc  * The division is the following: puffs_req is to be touched only
28784d9c625SLionel Sambuc  * by generic routines while the other stuff is supposed to be
28884d9c625SLionel Sambuc  * modified only by specific routines.
28984d9c625SLionel Sambuc  */
29084d9c625SLionel Sambuc 
29184d9c625SLionel Sambuc /*
29284d9c625SLionel Sambuc  * aux structures for vfs operations.
29384d9c625SLionel Sambuc  */
29484d9c625SLionel Sambuc struct puffs_vfsmsg_unmount {
29584d9c625SLionel Sambuc 	struct puffs_req	pvfsr_pr;
29684d9c625SLionel Sambuc 
29784d9c625SLionel Sambuc 	int			pvfsr_flags;
29884d9c625SLionel Sambuc };
29984d9c625SLionel Sambuc 
30084d9c625SLionel Sambuc struct puffs_vfsmsg_statvfs {
30184d9c625SLionel Sambuc 	struct puffs_req	pvfsr_pr;
30284d9c625SLionel Sambuc 
30384d9c625SLionel Sambuc 	struct statvfs		pvfsr_sb;
30484d9c625SLionel Sambuc };
30584d9c625SLionel Sambuc 
30684d9c625SLionel Sambuc struct puffs_vfsmsg_sync {
30784d9c625SLionel Sambuc 	struct puffs_req	pvfsr_pr;
30884d9c625SLionel Sambuc 
30984d9c625SLionel Sambuc 	struct puffs_kcred	pvfsr_cred;
31084d9c625SLionel Sambuc 	int			pvfsr_waitfor;
31184d9c625SLionel Sambuc };
31284d9c625SLionel Sambuc 
31384d9c625SLionel Sambuc struct puffs_vfsmsg_fhtonode {
31484d9c625SLionel Sambuc 	struct puffs_req	pvfsr_pr;
31584d9c625SLionel Sambuc 
31684d9c625SLionel Sambuc 	void			*pvfsr_fhcookie;	/* IN	*/
31784d9c625SLionel Sambuc 	enum vtype		pvfsr_vtype;		/* IN	*/
31884d9c625SLionel Sambuc 	voff_t			pvfsr_size;		/* IN	*/
31984d9c625SLionel Sambuc 	dev_t			pvfsr_rdev;		/* IN	*/
32084d9c625SLionel Sambuc 
32184d9c625SLionel Sambuc 	size_t			pvfsr_dsize;		/* OUT */
32284d9c625SLionel Sambuc 	uint8_t			pvfsr_data[0]		/* OUT, XXX */
32384d9c625SLionel Sambuc 				    __aligned(ALIGNBYTES+1);
32484d9c625SLionel Sambuc };
32584d9c625SLionel Sambuc 
32684d9c625SLionel Sambuc struct puffs_vfsmsg_nodetofh {
32784d9c625SLionel Sambuc 	struct puffs_req	pvfsr_pr;
32884d9c625SLionel Sambuc 
32984d9c625SLionel Sambuc 	void			*pvfsr_fhcookie;	/* OUT	*/
33084d9c625SLionel Sambuc 
33184d9c625SLionel Sambuc 	size_t			pvfsr_dsize;		/* OUT/IN  */
33284d9c625SLionel Sambuc 	uint8_t			pvfsr_data[0]		/* IN, XXX */
33384d9c625SLionel Sambuc 				    __aligned(ALIGNBYTES+1);
33484d9c625SLionel Sambuc };
33584d9c625SLionel Sambuc 
33684d9c625SLionel Sambuc struct puffs_vfsmsg_suspend {
33784d9c625SLionel Sambuc 	struct puffs_req	pvfsr_pr;
33884d9c625SLionel Sambuc 
33984d9c625SLionel Sambuc 	int			pvfsr_status;
34084d9c625SLionel Sambuc };
34184d9c625SLionel Sambuc #define PUFFS_SUSPEND_START	0
34284d9c625SLionel Sambuc #define PUFFS_SUSPEND_SUSPENDED	1
34384d9c625SLionel Sambuc #define PUFFS_SUSPEND_RESUME	2
34484d9c625SLionel Sambuc #define PUFFS_SUSPEND_ERROR	3
34584d9c625SLionel Sambuc 
34684d9c625SLionel Sambuc #define PUFFS_EXTATTRCTL_HASNODE	0x01
34784d9c625SLionel Sambuc #define PUFFS_EXTATTRCTL_HASATTRNAME	0x02
348*0a6a1f1dSLionel Sambuc 
349*0a6a1f1dSLionel Sambuc #define	PUFFS_OPEN_IO_DIRECT	0x01
350*0a6a1f1dSLionel Sambuc 
35184d9c625SLionel Sambuc struct puffs_vfsmsg_extattrctl {
35284d9c625SLionel Sambuc 	struct puffs_req	pvfsr_pr;
35384d9c625SLionel Sambuc 
35484d9c625SLionel Sambuc 	int			pvfsr_cmd;			  /* OUT */
35584d9c625SLionel Sambuc 	int			pvfsr_attrnamespace;		  /* OUT */
35684d9c625SLionel Sambuc 	int			pvfsr_flags;			  /* OUT */
35784d9c625SLionel Sambuc 	char			pvfsr_attrname[PUFFS_EXTNAMELEN]; /* OUT */
35884d9c625SLionel Sambuc };
35984d9c625SLionel Sambuc 
36084d9c625SLionel Sambuc /*
36184d9c625SLionel Sambuc  * aux structures for vnode operations.
36284d9c625SLionel Sambuc  */
36384d9c625SLionel Sambuc 
36484d9c625SLionel Sambuc struct puffs_vnmsg_lookup {
36584d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
36684d9c625SLionel Sambuc 
36784d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
36884d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
36984d9c625SLionel Sambuc 
37084d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_newnode;		/* IN	*/
37184d9c625SLionel Sambuc 	enum vtype		pvnr_vtype;		/* IN	*/
37284d9c625SLionel Sambuc 	voff_t			pvnr_size;		/* IN	*/
37384d9c625SLionel Sambuc 	dev_t			pvnr_rdev;		/* IN	*/
37484d9c625SLionel Sambuc 	/* Used only if PUFFS_KFLAG_CACHE_USE_TTL */
37584d9c625SLionel Sambuc 	struct vattr		pvnr_va;		/* IN	*/
37684d9c625SLionel Sambuc 	struct timespec		pvnr_va_ttl;		/* IN	*/
37784d9c625SLionel Sambuc 	struct timespec		pvnr_cn_ttl;		/* IN	*/
37884d9c625SLionel Sambuc };
37984d9c625SLionel Sambuc 
38084d9c625SLionel Sambuc struct puffs_vnmsg_create {
38184d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
38284d9c625SLionel Sambuc 
38384d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
38484d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
38584d9c625SLionel Sambuc 
38684d9c625SLionel Sambuc 	struct vattr		pvnr_va;		/* OUT	*/
38784d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_newnode;		/* IN	*/
38884d9c625SLionel Sambuc 	/* Used only if PUFFS_KFLAG_CACHE_USE_TTL */
38984d9c625SLionel Sambuc 	struct timespec		pvnr_va_ttl;		/* IN	*/
39084d9c625SLionel Sambuc 	struct timespec		pvnr_cn_ttl;		/* IN	*/
39184d9c625SLionel Sambuc };
39284d9c625SLionel Sambuc 
39384d9c625SLionel Sambuc struct puffs_vnmsg_mknod {
39484d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
39584d9c625SLionel Sambuc 
39684d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
39784d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
39884d9c625SLionel Sambuc 
39984d9c625SLionel Sambuc 	struct vattr		pvnr_va;		/* OUT	*/
40084d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_newnode;		/* IN	*/
40184d9c625SLionel Sambuc 	/* Used only if PUFFS_KFLAG_CACHE_USE_TTL */
40284d9c625SLionel Sambuc 	struct timespec		pvnr_va_ttl;		/* IN	*/
40384d9c625SLionel Sambuc 	struct timespec		pvnr_cn_ttl;		/* IN	*/
40484d9c625SLionel Sambuc };
40584d9c625SLionel Sambuc 
40684d9c625SLionel Sambuc struct puffs_vnmsg_open {
40784d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
40884d9c625SLionel Sambuc 
40984d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	*/
41084d9c625SLionel Sambuc 	int			pvnr_mode;		/* OUT	*/
411*0a6a1f1dSLionel Sambuc 	int			pvnr_oflags;		/* IN	*/
41284d9c625SLionel Sambuc };
41384d9c625SLionel Sambuc 
41484d9c625SLionel Sambuc struct puffs_vnmsg_close {
41584d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
41684d9c625SLionel Sambuc 
41784d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	*/
41884d9c625SLionel Sambuc 	int			pvnr_fflag;		/* OUT	*/
41984d9c625SLionel Sambuc };
42084d9c625SLionel Sambuc 
42184d9c625SLionel Sambuc struct puffs_vnmsg_access {
42284d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
42384d9c625SLionel Sambuc 
42484d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	*/
42584d9c625SLionel Sambuc 	int			pvnr_mode;		/* OUT	*/
42684d9c625SLionel Sambuc };
42784d9c625SLionel Sambuc 
42884d9c625SLionel Sambuc #define puffs_vnmsg_setattr puffs_vnmsg_setgetattr
42984d9c625SLionel Sambuc #define puffs_vnmsg_getattr puffs_vnmsg_setgetattr
43084d9c625SLionel Sambuc struct puffs_vnmsg_setgetattr {
43184d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
43284d9c625SLionel Sambuc 
43384d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	*/
43484d9c625SLionel Sambuc 	struct vattr		pvnr_va;		/* IN/OUT (op depend) */
43584d9c625SLionel Sambuc 	/* Used only if PUFFS_KFLAG_CACHE_USE_TTL */
43684d9c625SLionel Sambuc 	struct timespec		pvnr_va_ttl;		/* IN	*/
43784d9c625SLionel Sambuc };
43884d9c625SLionel Sambuc 
43984d9c625SLionel Sambuc #define puffs_vnmsg_read puffs_vnmsg_rw
44084d9c625SLionel Sambuc #define puffs_vnmsg_write puffs_vnmsg_rw
44184d9c625SLionel Sambuc struct puffs_vnmsg_rw {
44284d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
44384d9c625SLionel Sambuc 
44484d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	  */
44584d9c625SLionel Sambuc 	off_t			pvnr_offset;		/* OUT	  */
44684d9c625SLionel Sambuc 	size_t			pvnr_resid;		/* IN/OUT */
44784d9c625SLionel Sambuc 	int			pvnr_ioflag;		/* OUT	  */
44884d9c625SLionel Sambuc 
44984d9c625SLionel Sambuc 	uint8_t			pvnr_data[0];		/* IN/OUT (wr/rd) */
45084d9c625SLionel Sambuc };
45184d9c625SLionel Sambuc 
45284d9c625SLionel Sambuc #define puffs_vnmsg_ioctl puffs_vnreq_fcnioctl
45384d9c625SLionel Sambuc #define puffs_vnmsg_fcntl puffs_vnreq_fcnioctl
45484d9c625SLionel Sambuc struct puffs_vnmsg_fcnioctl {
45584d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
45684d9c625SLionel Sambuc 
45784d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;
45884d9c625SLionel Sambuc 	u_long			pvnr_command;
45984d9c625SLionel Sambuc 	pid_t			pvnr_pid;
46084d9c625SLionel Sambuc 	int			pvnr_fflag;
46184d9c625SLionel Sambuc 
46284d9c625SLionel Sambuc 	void			*pvnr_data;
46384d9c625SLionel Sambuc 	size_t			pvnr_datalen;
46484d9c625SLionel Sambuc 	int			pvnr_copyback;
46584d9c625SLionel Sambuc };
46684d9c625SLionel Sambuc 
46784d9c625SLionel Sambuc struct puffs_vnmsg_poll {
46884d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
46984d9c625SLionel Sambuc 
47084d9c625SLionel Sambuc 	int			pvnr_events;		/* IN/OUT */
47184d9c625SLionel Sambuc };
47284d9c625SLionel Sambuc 
47384d9c625SLionel Sambuc struct puffs_vnmsg_fsync {
47484d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
47584d9c625SLionel Sambuc 
47684d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	*/
47784d9c625SLionel Sambuc 	off_t			pvnr_offlo;		/* OUT	*/
47884d9c625SLionel Sambuc 	off_t			pvnr_offhi;		/* OUT	*/
47984d9c625SLionel Sambuc 	int			pvnr_flags;		/* OUT	*/
48084d9c625SLionel Sambuc };
48184d9c625SLionel Sambuc 
48284d9c625SLionel Sambuc struct puffs_vnmsg_seek {
48384d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
48484d9c625SLionel Sambuc 
48584d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	*/
48684d9c625SLionel Sambuc 	off_t			pvnr_oldoff;		/* OUT	*/
48784d9c625SLionel Sambuc 	off_t			pvnr_newoff;		/* OUT	*/
48884d9c625SLionel Sambuc };
48984d9c625SLionel Sambuc 
49084d9c625SLionel Sambuc struct puffs_vnmsg_remove {
49184d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
49284d9c625SLionel Sambuc 
49384d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
49484d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
49584d9c625SLionel Sambuc 
49684d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_cookie_targ;	/* OUT	*/
49784d9c625SLionel Sambuc };
49884d9c625SLionel Sambuc 
49984d9c625SLionel Sambuc struct puffs_vnmsg_mkdir {
50084d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
50184d9c625SLionel Sambuc 
50284d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
50384d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
50484d9c625SLionel Sambuc 
50584d9c625SLionel Sambuc 	struct vattr		pvnr_va;		/* OUT	*/
50684d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_newnode;		/* IN	*/
50784d9c625SLionel Sambuc 	/* Used only if PUFFS_KFLAG_CACHE_USE_TTL */
50884d9c625SLionel Sambuc 	struct timespec		pvnr_va_ttl;		/* IN	*/
50984d9c625SLionel Sambuc 	struct timespec		pvnr_cn_ttl;		/* IN	*/
51084d9c625SLionel Sambuc };
51184d9c625SLionel Sambuc 
51284d9c625SLionel Sambuc struct puffs_vnmsg_rmdir {
51384d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
51484d9c625SLionel Sambuc 
51584d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
51684d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
51784d9c625SLionel Sambuc 
51884d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_cookie_targ;	/* OUT	*/
51984d9c625SLionel Sambuc };
52084d9c625SLionel Sambuc 
52184d9c625SLionel Sambuc struct puffs_vnmsg_link {
52284d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
52384d9c625SLionel Sambuc 
52484d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
52584d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
52684d9c625SLionel Sambuc 
52784d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_cookie_targ;	/* OUT	*/
52884d9c625SLionel Sambuc };
52984d9c625SLionel Sambuc 
53084d9c625SLionel Sambuc struct puffs_vnmsg_rename {
53184d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
53284d9c625SLionel Sambuc 
53384d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn_src;		/* OUT	*/
53484d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_src_cred;	/* OUT	*/
53584d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn_targ;		/* OUT	*/
53684d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_targ_cred;	/* OUT	*/
53784d9c625SLionel Sambuc 
53884d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_cookie_src;	/* OUT	*/
53984d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_cookie_targ;	/* OUT	*/
54084d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_cookie_targdir;	/* OUT	*/
54184d9c625SLionel Sambuc };
54284d9c625SLionel Sambuc 
54384d9c625SLionel Sambuc struct puffs_vnmsg_symlink {
54484d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
54584d9c625SLionel Sambuc 
54684d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
54784d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
54884d9c625SLionel Sambuc 
54984d9c625SLionel Sambuc 	struct vattr		pvnr_va;		/* OUT	*/
55084d9c625SLionel Sambuc 	puffs_cookie_t		pvnr_newnode;		/* IN	*/
55184d9c625SLionel Sambuc 	char			pvnr_link[MAXPATHLEN];	/* OUT	*/
55284d9c625SLionel Sambuc 	/* Used only if PUFFS_KFLAG_CACHE_USE_TTL */
55384d9c625SLionel Sambuc 	struct timespec		pvnr_va_ttl;		/* IN	*/
55484d9c625SLionel Sambuc 	struct timespec		pvnr_cn_ttl;		/* IN	*/
55584d9c625SLionel Sambuc };
55684d9c625SLionel Sambuc 
55784d9c625SLionel Sambuc struct puffs_vnmsg_readdir {
55884d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
55984d9c625SLionel Sambuc 
56084d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	  */
56184d9c625SLionel Sambuc 	off_t			pvnr_offset;		/* IN/OUT */
56284d9c625SLionel Sambuc 	size_t			pvnr_resid;		/* IN/OUT */
56384d9c625SLionel Sambuc 	size_t			pvnr_ncookies;		/* IN/OUT */
56484d9c625SLionel Sambuc 	int			pvnr_eofflag;		/* IN     */
56584d9c625SLionel Sambuc 
56684d9c625SLionel Sambuc 	size_t			pvnr_dentoff;		/* OUT    */
56784d9c625SLionel Sambuc 	uint8_t			pvnr_data[0]		/* IN  	  */
56884d9c625SLionel Sambuc 				    __aligned(ALIGNBYTES+1);
56984d9c625SLionel Sambuc };
57084d9c625SLionel Sambuc 
57184d9c625SLionel Sambuc struct puffs_vnmsg_readlink {
57284d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
57384d9c625SLionel Sambuc 
57484d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT */
57584d9c625SLionel Sambuc 	size_t			pvnr_linklen;		/* IN  */
57684d9c625SLionel Sambuc 	char			pvnr_link[MAXPATHLEN];	/* IN  */
57784d9c625SLionel Sambuc };
57884d9c625SLionel Sambuc 
57984d9c625SLionel Sambuc struct puffs_vnmsg_reclaim {
58084d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
58184d9c625SLionel Sambuc 
58284d9c625SLionel Sambuc 	int			pvnr_nlookup;		/* OUT */
58384d9c625SLionel Sambuc };
58484d9c625SLionel Sambuc 
58584d9c625SLionel Sambuc struct puffs_vnmsg_inactive {
58684d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
58784d9c625SLionel Sambuc };
58884d9c625SLionel Sambuc 
58984d9c625SLionel Sambuc struct puffs_vnmsg_print {
59084d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
59184d9c625SLionel Sambuc 
59284d9c625SLionel Sambuc 	/* empty */
59384d9c625SLionel Sambuc };
59484d9c625SLionel Sambuc 
59584d9c625SLionel Sambuc struct puffs_vnmsg_pathconf {
59684d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
59784d9c625SLionel Sambuc 
59884d9c625SLionel Sambuc 	int			pvnr_name;		/* OUT	*/
59984d9c625SLionel Sambuc 	register_t		pvnr_retval;		/* IN	*/
60084d9c625SLionel Sambuc };
60184d9c625SLionel Sambuc 
60284d9c625SLionel Sambuc struct puffs_vnmsg_advlock {
60384d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
60484d9c625SLionel Sambuc 
60584d9c625SLionel Sambuc 	struct flock		pvnr_fl;		/* OUT	*/
60684d9c625SLionel Sambuc 	void			*pvnr_id;		/* OUT	*/
60784d9c625SLionel Sambuc 	int			pvnr_op;		/* OUT	*/
60884d9c625SLionel Sambuc 	int			pvnr_flags;		/* OUT	*/
60984d9c625SLionel Sambuc };
61084d9c625SLionel Sambuc 
61184d9c625SLionel Sambuc struct puffs_vnmsg_mmap {
61284d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
61384d9c625SLionel Sambuc 
61484d9c625SLionel Sambuc 	vm_prot_t		pvnr_prot;		/* OUT	*/
61584d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;		/* OUT	*/
61684d9c625SLionel Sambuc };
61784d9c625SLionel Sambuc 
61884d9c625SLionel Sambuc struct puffs_vnmsg_abortop {
61984d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
62084d9c625SLionel Sambuc 
62184d9c625SLionel Sambuc 	struct puffs_kcn	pvnr_cn;		/* OUT	*/
62284d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cn_cred;		/* OUT	*/
62384d9c625SLionel Sambuc };
62484d9c625SLionel Sambuc 
62584d9c625SLionel Sambuc struct puffs_vnmsg_getextattr {
62684d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
62784d9c625SLionel Sambuc 
62884d9c625SLionel Sambuc 	int			pvnr_attrnamespace;		/* OUT	  */
62984d9c625SLionel Sambuc 	char			pvnr_attrname[PUFFS_EXTNAMELEN];/* OUT	  */
63084d9c625SLionel Sambuc 
63184d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;			/* OUT	  */
63284d9c625SLionel Sambuc 	size_t			pvnr_datasize;			/* IN	  */
63384d9c625SLionel Sambuc 
63484d9c625SLionel Sambuc 	size_t			pvnr_resid;			/* IN/OUT */
63584d9c625SLionel Sambuc 	uint8_t			pvnr_data[0]			/* IN	  */
63684d9c625SLionel Sambuc 				    __aligned(ALIGNBYTES+1);
63784d9c625SLionel Sambuc };
63884d9c625SLionel Sambuc 
63984d9c625SLionel Sambuc struct puffs_vnmsg_setextattr {
64084d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
64184d9c625SLionel Sambuc 
64284d9c625SLionel Sambuc 	int			pvnr_attrnamespace;		/* OUT	  */
64384d9c625SLionel Sambuc 	char			pvnr_attrname[PUFFS_EXTNAMELEN];/* OUT	  */
64484d9c625SLionel Sambuc 
64584d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;			/* OUT	*/
64684d9c625SLionel Sambuc 
64784d9c625SLionel Sambuc 	size_t			pvnr_resid;			/* IN/OUT */
64884d9c625SLionel Sambuc 	uint8_t			pvnr_data[0]			/* OUT	  */
64984d9c625SLionel Sambuc 				    __aligned(ALIGNBYTES+1);
65084d9c625SLionel Sambuc };
65184d9c625SLionel Sambuc 
65284d9c625SLionel Sambuc struct puffs_vnmsg_listextattr {
65384d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
65484d9c625SLionel Sambuc 
65584d9c625SLionel Sambuc 	int			pvnr_attrnamespace;		/* OUT	  */
65684d9c625SLionel Sambuc 
65784d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;			/* OUT	*/
65884d9c625SLionel Sambuc 	size_t			pvnr_datasize;			/* IN	  */
65984d9c625SLionel Sambuc 
66084d9c625SLionel Sambuc 	size_t			pvnr_resid;			/* IN/OUT */
66184d9c625SLionel Sambuc 	int			pvnr_flag;			/* OUT */
66284d9c625SLionel Sambuc 	uint8_t			pvnr_data[0]			/* IN	  */
66384d9c625SLionel Sambuc 				    __aligned(ALIGNBYTES+1);
66484d9c625SLionel Sambuc };
66584d9c625SLionel Sambuc 
66684d9c625SLionel Sambuc struct puffs_vnmsg_deleteextattr {
66784d9c625SLionel Sambuc 	struct puffs_req	pvn_pr;
66884d9c625SLionel Sambuc 
66984d9c625SLionel Sambuc 	int			pvnr_attrnamespace;		/* OUT	  */
67084d9c625SLionel Sambuc 	char			pvnr_attrname[PUFFS_EXTNAMELEN];/* OUT	  */
67184d9c625SLionel Sambuc 
67284d9c625SLionel Sambuc 	struct puffs_kcred	pvnr_cred;			/* OUT	*/
67384d9c625SLionel Sambuc };
67484d9c625SLionel Sambuc 
675*0a6a1f1dSLionel Sambuc #define PUFFS_HAVE_FALLOCATE 1
676*0a6a1f1dSLionel Sambuc struct puffs_vnmsg_fallocate {
677*0a6a1f1dSLionel Sambuc 	struct puffs_req	pvn_pr;
678*0a6a1f1dSLionel Sambuc 	off_t			pvnr_off;			/* OUT    */
679*0a6a1f1dSLionel Sambuc 	off_t			pvnr_len;			/* OUT    */
680*0a6a1f1dSLionel Sambuc };
681*0a6a1f1dSLionel Sambuc 
682*0a6a1f1dSLionel Sambuc struct puffs_vnmsg_fdiscard {
683*0a6a1f1dSLionel Sambuc 	struct puffs_req	pvn_pr;
684*0a6a1f1dSLionel Sambuc 	off_t			pvnr_off;			/* OUT    */
685*0a6a1f1dSLionel Sambuc 	off_t			pvnr_len;			/* OUT    */
686*0a6a1f1dSLionel Sambuc };
687*0a6a1f1dSLionel Sambuc 
68884d9c625SLionel Sambuc /*
68984d9c625SLionel Sambuc  * For cache reports.  Everything is always out-out-out, no replies
69084d9c625SLionel Sambuc  */
69184d9c625SLionel Sambuc 
69284d9c625SLionel Sambuc struct puffs_cacherun {
69384d9c625SLionel Sambuc 	off_t			pcache_runstart;
69484d9c625SLionel Sambuc 	off_t			pcache_runend;
69584d9c625SLionel Sambuc };
69684d9c625SLionel Sambuc 
69784d9c625SLionel Sambuc /* cache info.  old used for write now */
69884d9c625SLionel Sambuc struct puffs_cacheinfo {
69984d9c625SLionel Sambuc 	struct puffs_req	pcache_pr;
70084d9c625SLionel Sambuc 
70184d9c625SLionel Sambuc 	int			pcache_type;
70284d9c625SLionel Sambuc 	size_t			pcache_nruns;
70384d9c625SLionel Sambuc 	struct puffs_cacherun	pcache_runs[0];
70484d9c625SLionel Sambuc };
70584d9c625SLionel Sambuc #define PCACHE_TYPE_READ	0
70684d9c625SLionel Sambuc #define PCACHE_TYPE_WRITE	1
70784d9c625SLionel Sambuc 
70884d9c625SLionel Sambuc /*
70984d9c625SLionel Sambuc  * Error notification.  Always outgoing, no response, no remorse.
71084d9c625SLionel Sambuc  */
71184d9c625SLionel Sambuc struct puffs_error {
71284d9c625SLionel Sambuc 	struct puffs_req	perr_pr;
71384d9c625SLionel Sambuc 
71484d9c625SLionel Sambuc 	int			perr_error;
71584d9c625SLionel Sambuc 	char			perr_str[256];
71684d9c625SLionel Sambuc };
71784d9c625SLionel Sambuc 
71884d9c625SLionel Sambuc #endif /* _FS_PUFFS_PUFFS_MSGIF_H_ */
719