FreeBSD/Linux Kernel Cross Reference
sys/sys/fstypes.h
1 /* $NetBSD: fstypes.h,v 1.3.10.2 2006/01/20 20:48:41 riz Exp $ */
2
3 /*
4 * Copyright (c) 1989, 1991, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * @(#)mount.h 8.21 (Berkeley) 5/20/95
32 */
33
34 #ifndef _SYS_FSTYPES_H_
35 #define _SYS_FSTYPES_H_
36
37 typedef struct { int32_t __fsid_val[2]; } fsid_t; /* file system id type */
38
39 /*
40 * File identifier.
41 * These are unique per filesystem on a single machine.
42 */
43 #define _VFS_MAXFIDSZ 16
44
45 struct fid {
46 unsigned short fid_len; /* length of data in bytes */
47 unsigned short fid_reserved; /* force longword alignment */
48 char fid_data[_VFS_MAXFIDSZ];/* data (variable length) */
49 };
50
51 #if defined(_NETBSD_SOURCE)
52 #define VFS_MAXFIDSZ _VFS_MAXFIDSZ
53 #endif
54
55 /*
56 * Generic file handle
57 */
58 struct fhandle {
59 fsid_t fh_fsid; /* File system id of mount point */
60 struct fid fh_fid; /* File sys specific id */
61 };
62 typedef struct fhandle fhandle_t;
63
64 /*
65 * Mount flags. XXX BEWARE: these are not in numerical order!
66 *
67 * Unmount uses MNT_FORCE flag.
68 *
69 * Note that all mount flags are listed here. if you need to add one, take
70 * one of the __MNT_UNUSED flags.
71 */
72
73 #define __MNT_UNUSED3 0x00800000
74 #define __MNT_UNUSED4 0x00200000
75 #define __MNT_UNUSED5 0x01000000
76 #define __MNT_UNUSED6 0x02000000
77
78 #define MNT_RDONLY 0x00000001 /* read only filesystem */
79 #define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
80 #define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
81 #define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
82 #define MNT_NODEV 0x00000010 /* don't interpret special files */
83 #define MNT_UNION 0x00000020 /* union with underlying filesystem */
84 #define MNT_ASYNC 0x00000040 /* file system written asynchronously */
85 #define MNT_NOCOREDUMP 0x00008000 /* don't write core dumps to this FS */
86 #define MNT_IGNORE 0x00100000 /* don't show entry in df */
87 #define MNT_NOATIME 0x04000000 /* Never update access times in fs */
88 #define MNT_SYMPERM 0x20000000 /* recognize symlink permission */
89 #define MNT_NODEVMTIME 0x40000000 /* Never update mod times for devs */
90 #define MNT_SOFTDEP 0x80000000 /* Use soft dependencies */
91
92 #define __MNT_BASIC_FLAGS \
93 { MNT_RDONLY, 0, "read-only" }, \
94 { MNT_SYNCHRONOUS, 0, "synchronous" }, \
95 { MNT_NOEXEC, 0, "noexec" }, \
96 { MNT_NOSUID, 0, "nosuid" }, \
97 { MNT_NODEV, 0, "nodev" }, \
98 { MNT_UNION, 0, "union" }, \
99 { MNT_ASYNC, 0, "asynchronous" }, \
100 { MNT_NOCOREDUMP, 0, "nocoredump" }, \
101 { MNT_IGNORE, 0, "hidden" }, \
102 { MNT_NOATIME, 0, "noatime" }, \
103 { MNT_SYMPERM, 0, "symperm" }, \
104 { MNT_NODEVMTIME, 0, "nodevmtime" }, \
105 { MNT_SOFTDEP, 0, "soft dependencies" },
106
107 /*
108 * exported mount flags.
109 */
110 #define MNT_EXRDONLY 0x00000080 /* exported read only */
111 #define MNT_EXPORTED 0x00000100 /* file system is exported */
112 #define MNT_DEFEXPORTED 0x00000200 /* exported to the world */
113 #define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */
114 #define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */
115 #define MNT_EXNORESPORT 0x08000000 /* don't enforce reserved ports (NFS) */
116 #define MNT_EXPUBLIC 0x10000000 /* public export (WebNFS) */
117
118 #define __MNT_EXPORTED_FLAGS \
119 { MNT_EXRDONLY, 1, "exported read-only" }, \
120 { MNT_EXPORTED, 0, "NFS exported" }, \
121 { MNT_DEFEXPORTED, 1, "exported to the world" }, \
122 { MNT_EXPORTANON, 1, "anon uid mapping" }, \
123 { MNT_EXKERB, 1, "kerberos uid mapping" }, \
124 { MNT_EXNORESPORT, 0, "non-reserved ports" }, \
125 { MNT_EXPUBLIC, 0, "WebNFS exports" },
126
127 /*
128 * Flags set by internal operations.
129 */
130 #define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
131 #define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
132 #define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
133
134 #define __MNT_INTERNAL_FLAGS \
135 { MNT_LOCAL, 0, "local" }, \
136 { MNT_QUOTA, 0, "with quotas" }, \
137 { MNT_ROOTFS, 1, "root file system" },
138
139 /*
140 * Mask of flags that are visible to statvfs()
141 */
142 #define MNT_VISFLAGMASK \
143 (MNT_SOFTDEP | MNT_NODEVMTIME | MNT_SYMPERM | MNT_EXPUBLIC | \
144 MNT_EXNORESPORT | MNT_NOATIME | \
145 MNT_IGNORE | \
146 MNT_NOCOREDUMP | MNT_ROOTFS | MNT_QUOTA | MNT_LOCAL | \
147 MNT_EXKERB | MNT_EXPORTANON | MNT_DEFEXPORTED | MNT_EXPORTED | \
148 MNT_EXRDONLY | MNT_ASYNC | MNT_UNION | MNT_NODEV | \
149 MNT_NOSUID | MNT_NOEXEC | MNT_SYNCHRONOUS | MNT_RDONLY)
150
151 /*
152 * External filesystem control flags.
153 */
154 #define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
155 #define MNT_DELEXPORT 0x00020000 /* delete export host lists */
156 #define MNT_RELOAD 0x00040000 /* reload filesystem data */
157 #define MNT_FORCE 0x00080000 /* force unmount or readonly change */
158 #define MNT_GETARGS 0x00400000 /* retrieve file system specific args */
159
160 #define __MNT_EXTERNAL_FLAGS \
161 { MNT_UPDATE, 1, "being updated" }, \
162 { MNT_DELEXPORT, 1, "delete export list" }, \
163 { MNT_RELOAD, 1, "reload filesystem data" }, \
164 { MNT_FORCE, 1, "force unmount or readonly change" }, \
165 { MNT_GETARGS, 1, "retrieve mount arguments" },
166
167 /*
168 * Internal filesystem control flags.
169 * These are set in struct mount mnt_iflag.
170 *
171 * IMNT_UNMOUNT locks the mount entry so that name lookup cannot proceed
172 * past the mount point. This keeps the subtree stable during mounts
173 * and unmounts.
174 */
175 #define IMNT_GONE 0x00000001 /* filesystem is gone.. */
176 #define IMNT_UNMOUNT 0x00000002 /* unmount in progress */
177 #define IMNT_WANTRDWR 0x00000004 /* upgrade to read/write requested */
178 #define IMNT_SUSPEND 0x00000008 /* request upper write suspension */
179 #define IMNT_SUSPENDLOW 0x00000010 /* request lower write suspension */
180 #define IMNT_SUSPENDED 0x00000020 /* write operations are suspended */
181 #define IMNT_DTYPE 0x00000040 /* returns d_type fields */
182
183 #define __MNT_FLAGS \
184 __MNT_BASIC_FLAGS \
185 __MNT_EXPORTED_FLAGS \
186 __MNT_INTERNAL_FLAGS \
187 __MNT_EXTERNAL_FLAGS
188
189 #define __MNT_FLAG_BITS \
190 "\2" \
191 "\40MNT_SOFTDEP" \
192 "\37MNT_NODEVMTIME" \
193 "\36MNT_SYMPERM" \
194 "\35MNT_EXPUBLIC" \
195 "\34MNT_EXNORESPORT" \
196 "\33MNT_NOATIME" \
197 "\32MNT_UNUSED6" \
198 "\31MNT_UNUSED5" \
199 "\30MNT_UNUSED3" \
200 "\27MNT_GETARGS" \
201 "\26MNT_UNUSED4" \
202 "\25MNT_IGNORE" \
203 "\24MNT_FORCE" \
204 "\23MNT_RELOAD" \
205 "\22MNT_DELEXPORT" \
206 "\21MNT_UPDATE" \
207 "\20MNT_NOCOREDUMP" \
208 "\17MNT_ROOTFS" \
209 "\16MNT_QUOTA" \
210 "\15MNT_LOCAL" \
211 "\14MNT_EXKERB" \
212 "\13MNT_EXPORTANON" \
213 "\12MNT_DEFEXPORTED" \
214 "\11MNT_EXPORTED" \
215 "\10MNT_EXRDONLY" \
216 "\07MNT_ASYNC" \
217 "\06MNT_UNION" \
218 "\05MNT_NODEV" \
219 "\04MNT_NOSUID" \
220 "\03MNT_NOEXEC" \
221 "\02MNT_SYNCHRONOUS" \
222 "\01MNT_RDONLY"
223
224 #define __IMNT_FLAG_BITS \
225 "\2" \
226 "\07IMNT_DTYPE" \
227 "\06IMNT_SUSPENDED" \
228 "\05IMNT_SUSPENDLOW" \
229 "\04IMNT_SUSPEND" \
230 "\03IMNT_WANTRDWR" \
231 "\02IMNT_UNMOUNT" \
232 "\01IMNT_GONE"
233
234 /*
235 * Flags for various system call interfaces.
236 *
237 * waitfor flags to vfs_sync() and getvfsstat()
238 */
239 #define MNT_WAIT 1 /* synchronously wait for I/O to complete */
240 #define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */
241 #define MNT_LAZY 3 /* push data not written by filesystem syncer */
242 #endif /* _SYS_FSTYPES_H_ */
Cache object: a96eeb2eebd74e9db85a81ffb39cc0b5
|