xref: /illumos-gate/usr/src/uts/common/sys/mntio.h (revision 835ee2195df075073d2670eb95a6eab413d6c789)
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 _SYS_MNTIO_H
27 #define	_SYS_MNTIO_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 /*
34  * Mntfs io control commands
35  */
36 #define	MNTIOC			('m' << 8)
37 #define	MNTIOC_NMNTS		(MNTIOC|1)	/* Get # of mounted resources */
38 #define	MNTIOC_GETDEVLIST	(MNTIOC|2)	/* Get mounted dev no.'s */
39 #define	MNTIOC_SETTAG		(MNTIOC|3)	/* Set a tag on a mounted fs */
40 #define	MNTIOC_CLRTAG		(MNTIOC|4)	/* Clear a tag from a fs */
41 #define	MNTIOC_SHOWHIDDEN	(MNTIOC|6)	/* private */
42 #define	MNTIOC_GETMNTENT	(MNTIOC|7)	/* private */
43 #define	MNTIOC_GETEXTMNTENT	(MNTIOC|8)	/* private */
44 #define	MNTIOC_GETMNTANY	(MNTIOC|9)	/* private */
45 
46 /*
47  * Private mntfs return codes
48  */
49 #define	MNTFS_EOF	1
50 #define	MNTFS_TOOLONG	2
51 
52 
53 #define	MAX_MNTOPT_TAG	64	/* Maximum size for a mounted file system tag */
54 
55 struct mnttagdesc {
56 	uint_t	mtd_major;		/* major number of mounted resource */
57 	uint_t	mtd_minor;		/* minor number of mounted resource */
58 	char	*mtd_mntpt;		/* mount point for mounted resource */
59 	char	*mtd_tag;		/* tag to set/clear */
60 };
61 
62 #ifdef _SYSCALL32
63 struct mnttagdesc32 {
64 	uint32_t	mtd_major;	/* major number of mounted resource */
65 	uint32_t	mtd_minor;	/* minor number of mounted resource */
66 	caddr32_t	mtd_mntpt;	/* mount point for mounted resource */
67 	caddr32_t	mtd_tag;	/* tag to set/clear */
68 };
69 #endif /* _SYSCALL32 */
70 
71 
72 struct mntlookup {
73 	size_t	mtl_mntpt_off;
74 	char	*mtl_mntpt;
75 	major_t	mtl_major;
76 	minor_t	mtl_minor;
77 	ino64_t	mtl_ino;
78 	char	mtl_fstype[_ST_FSTYPSZ];
79 };
80 
81 #ifdef _SYSCALL32
82 struct mntlookup32 {
83 	size32_t	mtl_mntpt_off;
84 	caddr32_t	mtl_mntpt;
85 	major32_t	mtl_major;
86 	minor32_t	mtl_minor;
87 	ino64_t		mtl_ino;
88 	char		mtl_fstype[_ST_FSTYPSZ];
89 };
90 #endif /* _SYSCALL32 */
91 
92 #ifdef	__cplusplus
93 }
94 #endif
95 
96 #endif	/* _SYS_MNTIO_H */
97