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