xref: /netbsd-src/external/cddl/osnet/dist/uts/common/sys/fs/zut.h (revision 3227e6cf668bd374971740bd6660f43cee4417ac)
1*3227e6cfSchs /*
2*3227e6cfSchs  * CDDL HEADER START
3*3227e6cfSchs  *
4*3227e6cfSchs  * The contents of this file are subject to the terms of the
5*3227e6cfSchs  * Common Development and Distribution License (the "License").
6*3227e6cfSchs  * You may not use this file except in compliance with the License.
7*3227e6cfSchs  *
8*3227e6cfSchs  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3227e6cfSchs  * or http://www.opensolaris.org/os/licensing.
10*3227e6cfSchs  * See the License for the specific language governing permissions
11*3227e6cfSchs  * and limitations under the License.
12*3227e6cfSchs  *
13*3227e6cfSchs  * When distributing Covered Code, include this CDDL HEADER in each
14*3227e6cfSchs  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3227e6cfSchs  * If applicable, add the following below this CDDL HEADER, with the
16*3227e6cfSchs  * fields enclosed by brackets "[]" replaced with your own identifying
17*3227e6cfSchs  * information: Portions Copyright [yyyy] [name of copyright owner]
18*3227e6cfSchs  *
19*3227e6cfSchs  * CDDL HEADER END
20*3227e6cfSchs  */
21*3227e6cfSchs /*
22*3227e6cfSchs  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*3227e6cfSchs  * Use is subject to license terms.
24*3227e6cfSchs  */
25*3227e6cfSchs 
26*3227e6cfSchs #ifndef _ZUT_H
27*3227e6cfSchs #define	_ZUT_H
28*3227e6cfSchs 
29*3227e6cfSchs /*
30*3227e6cfSchs  * IOCTLs for the zfs unit test driver
31*3227e6cfSchs  */
32*3227e6cfSchs 
33*3227e6cfSchs #ifdef __cplusplus
34*3227e6cfSchs extern "C" {
35*3227e6cfSchs #endif
36*3227e6cfSchs 
37*3227e6cfSchs #include <sys/param.h>
38*3227e6cfSchs #include <sys/types.h>
39*3227e6cfSchs #include <sys/stat.h>
40*3227e6cfSchs 
41*3227e6cfSchs #define	ZUT_DRIVER	"zut"
42*3227e6cfSchs #define	ZUT_DEV		"/dev/zut"
43*3227e6cfSchs 
44*3227e6cfSchs #define	ZUT_VERSION_STRING		"1"
45*3227e6cfSchs 
46*3227e6cfSchs /*
47*3227e6cfSchs  * /dev/zut ioctl numbers.
48*3227e6cfSchs  */
49*3227e6cfSchs #define	ZUT_IOC		('U' << 8)
50*3227e6cfSchs 
51*3227e6cfSchs /* Request flags */
52*3227e6cfSchs #define	ZUT_IGNORECASE		0x01
53*3227e6cfSchs #define	ZUT_ACCFILTER		0x02
54*3227e6cfSchs #define	ZUT_XATTR		0x04
55*3227e6cfSchs #define	ZUT_EXTRDDIR		0x08
56*3227e6cfSchs #define	ZUT_GETSTAT		0x10
57*3227e6cfSchs 
58*3227e6cfSchs typedef struct zut_lookup {
59*3227e6cfSchs 	int	zl_reqflags;
60*3227e6cfSchs 	int	zl_deflags;		/* output */
61*3227e6cfSchs 	int	zl_retcode;		/* output */
62*3227e6cfSchs 	char	zl_dir[MAXPATHLEN];
63*3227e6cfSchs 	char	zl_file[MAXNAMELEN];
64*3227e6cfSchs 	char	zl_xfile[MAXNAMELEN];
65*3227e6cfSchs 	char	zl_real[MAXPATHLEN];	/* output */
66*3227e6cfSchs 	uint64_t zl_xvattrs;		/* output */
67*3227e6cfSchs 	struct stat64 zl_statbuf;	/* output */
68*3227e6cfSchs } zut_lookup_t;
69*3227e6cfSchs 
70*3227e6cfSchs typedef struct zut_readdir {
71*3227e6cfSchs 	uint64_t zr_buf;		/* pointer to output buffer */
72*3227e6cfSchs 	uint64_t zr_loffset;		/* output */
73*3227e6cfSchs 	char	zr_dir[MAXPATHLEN];
74*3227e6cfSchs 	char	zr_file[MAXNAMELEN];
75*3227e6cfSchs 	int	zr_reqflags;
76*3227e6cfSchs 	int	zr_retcode;		/* output */
77*3227e6cfSchs 	int	zr_eof;			/* output */
78*3227e6cfSchs 	uint_t	zr_bytes;		/* output */
79*3227e6cfSchs 	uint_t	zr_buflen;
80*3227e6cfSchs } zut_readdir_t;
81*3227e6cfSchs 
82*3227e6cfSchs typedef enum zut_ioc {
83*3227e6cfSchs 	ZUT_IOC_MIN_CMD = ZUT_IOC - 1,
84*3227e6cfSchs 	ZUT_IOC_LOOKUP = ZUT_IOC,
85*3227e6cfSchs 	ZUT_IOC_READDIR,
86*3227e6cfSchs 	ZUT_IOC_MAX_CMD
87*3227e6cfSchs } zut_ioc_t;
88*3227e6cfSchs 
89*3227e6cfSchs #ifdef __cplusplus
90*3227e6cfSchs }
91*3227e6cfSchs #endif
92*3227e6cfSchs 
93*3227e6cfSchs #endif /* _ZUT_H */
94