1 | /* |
---|
2 | * Copyright (c) 1989, 1991, 1993 |
---|
3 | * The Regents of the University of California. All rights reserved. |
---|
4 | * |
---|
5 | * Redistribution and use in source and binary forms, with or without |
---|
6 | * modification, are permitted provided that the following conditions |
---|
7 | * are met: |
---|
8 | * 1. Redistributions of source code must retain the above copyright |
---|
9 | * notice, this list of conditions and the following disclaimer. |
---|
10 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
11 | * notice, this list of conditions and the following disclaimer in the |
---|
12 | * documentation and/or other materials provided with the distribution. |
---|
13 | * 3. All advertising materials mentioning features or use of this software |
---|
14 | * must display the following acknowledgement: |
---|
15 | * This product includes software developed by the University of |
---|
16 | * California, Berkeley and its contributors. |
---|
17 | * 4. Neither the name of the University nor the names of its contributors |
---|
18 | * may be used to endorse or promote products derived from this software |
---|
19 | * without specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
---|
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
---|
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
31 | * SUCH DAMAGE. |
---|
32 | * |
---|
33 | * @(#)mount.h 8.13 (Berkeley) 3/27/94 |
---|
34 | * $Id$ |
---|
35 | */ |
---|
36 | |
---|
37 | #ifndef _SYS_MOUNT_H_ |
---|
38 | #define _SYS_MOUNT_H_ |
---|
39 | |
---|
40 | #ifndef KERNEL |
---|
41 | #include <sys/ucred.h> |
---|
42 | #endif |
---|
43 | #include <sys/queue.h> |
---|
44 | |
---|
45 | typedef struct fsid { long val[2]; } fsid_t; /* file system id type */ |
---|
46 | |
---|
47 | /* |
---|
48 | * File identifier. |
---|
49 | * These are unique per filesystem on a single machine. |
---|
50 | */ |
---|
51 | #define MAXFIDSZ 16 |
---|
52 | |
---|
53 | struct fid { |
---|
54 | u_short fid_len; /* length of data in bytes */ |
---|
55 | u_short fid_reserved; /* force longword alignment */ |
---|
56 | char fid_data[MAXFIDSZ]; /* data (variable length) */ |
---|
57 | }; |
---|
58 | |
---|
59 | /* |
---|
60 | * file system statistics |
---|
61 | */ |
---|
62 | |
---|
63 | #define MNAMELEN 90 /* length of buffer for returned name */ |
---|
64 | |
---|
65 | struct statfs { |
---|
66 | long f_spare2; /* placeholder */ |
---|
67 | long f_bsize; /* fundamental file system block size */ |
---|
68 | long f_iosize; /* optimal transfer block size */ |
---|
69 | long f_blocks; /* total data blocks in file system */ |
---|
70 | long f_bfree; /* free blocks in fs */ |
---|
71 | long f_bavail; /* free blocks avail to non-superuser */ |
---|
72 | long f_files; /* total file nodes in file system */ |
---|
73 | long f_ffree; /* free file nodes in fs */ |
---|
74 | fsid_t f_fsid; /* file system id */ |
---|
75 | uid_t f_owner; /* user that mounted the filesystem */ |
---|
76 | int f_type; /* type of filesystem (see below) */ |
---|
77 | int f_flags; /* copy of mount flags */ |
---|
78 | long f_spare[6]; /* spare for later */ |
---|
79 | char f_mntonname[MNAMELEN]; /* directory on which mounted */ |
---|
80 | char f_mntfromname[MNAMELEN];/* mounted filesystem */ |
---|
81 | }; |
---|
82 | |
---|
83 | /* |
---|
84 | * File system types. |
---|
85 | */ |
---|
86 | #define MOUNT_NONE 0 |
---|
87 | #define MOUNT_UFS 1 /* Fast Filesystem */ |
---|
88 | #define MOUNT_NFS 2 /* Sun-compatible Network Filesystem */ |
---|
89 | #define MOUNT_MFS 3 /* Memory-based Filesystem */ |
---|
90 | #define MOUNT_MSDOS 4 /* MS/DOS Filesystem */ |
---|
91 | #define MOUNT_LFS 5 /* Log-based Filesystem */ |
---|
92 | #define MOUNT_LOFS 6 /* Loopback Filesystem */ |
---|
93 | #define MOUNT_FDESC 7 /* File Descriptor Filesystem */ |
---|
94 | #define MOUNT_PORTAL 8 /* Portal Filesystem */ |
---|
95 | #define MOUNT_NULL 9 /* Minimal Filesystem Layer */ |
---|
96 | #define MOUNT_UMAP 10 /* User/Group Identifier Remapping Filesystem */ |
---|
97 | #define MOUNT_KERNFS 11 /* Kernel Information Filesystem */ |
---|
98 | #define MOUNT_PROCFS 12 /* /proc Filesystem */ |
---|
99 | #define MOUNT_AFS 13 /* Andrew Filesystem */ |
---|
100 | #define MOUNT_CD9660 14 /* ISO9660 (aka CDROM) Filesystem */ |
---|
101 | #define MOUNT_UNION 15 /* Union (translucent) Filesystem */ |
---|
102 | #define MOUNT_DEVFS 16 /* existing device Filesystem */ |
---|
103 | #define MOUNT_EXT2FS 17 /* Linux EXT2FS */ |
---|
104 | #define MOUNT_TFS 18 /* Netcon Novell filesystem */ |
---|
105 | #define MOUNT_CFS 19 /* Coda filesystem */ |
---|
106 | #define MOUNT_MAXTYPE 19 |
---|
107 | |
---|
108 | #define INITMOUNTNAMES { \ |
---|
109 | "none", /* 0 MOUNT_NONE */ \ |
---|
110 | "ufs", /* 1 MOUNT_UFS */ \ |
---|
111 | "nfs", /* 2 MOUNT_NFS */ \ |
---|
112 | "mfs", /* 3 MOUNT_MFS */ \ |
---|
113 | "msdos", /* 4 MOUNT_MSDOS */ \ |
---|
114 | "lfs", /* 5 MOUNT_LFS */ \ |
---|
115 | "lofs", /* 6 MOUNT_LOFS */ \ |
---|
116 | "fdesc", /* 7 MOUNT_FDESC */ \ |
---|
117 | "portal", /* 8 MOUNT_PORTAL */ \ |
---|
118 | "null", /* 9 MOUNT_NULL */ \ |
---|
119 | "umap", /* 10 MOUNT_UMAP */ \ |
---|
120 | "kernfs", /* 11 MOUNT_KERNFS */ \ |
---|
121 | "procfs", /* 12 MOUNT_PROCFS */ \ |
---|
122 | "afs", /* 13 MOUNT_AFS */ \ |
---|
123 | "cd9660", /* 14 MOUNT_CD9660 */ \ |
---|
124 | "union", /* 15 MOUNT_UNION */ \ |
---|
125 | "devfs", /* 16 MOUNT_DEVFS */ \ |
---|
126 | "ext2fs", /* 17 MOUNT_EXT2FS */ \ |
---|
127 | "tfs", /* 18 MOUNT_TFS */ \ |
---|
128 | "cfs", /* 19 MOUNT_CFS */ \ |
---|
129 | 0, /* 20 MOUNT_SPARE */ \ |
---|
130 | } |
---|
131 | |
---|
132 | /* |
---|
133 | * Structure per mounted file system. Each mounted file system has an |
---|
134 | * array of operations and an instance record. The file systems are |
---|
135 | * put on a doubly linked list. |
---|
136 | */ |
---|
137 | LIST_HEAD(vnodelst, vnode); |
---|
138 | |
---|
139 | struct mount { |
---|
140 | CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */ |
---|
141 | struct vfsops *mnt_op; /* operations on fs */ |
---|
142 | struct vfsconf *mnt_vfc; /* configuration info */ |
---|
143 | struct vnode *mnt_vnodecovered; /* vnode we mounted on */ |
---|
144 | struct vnodelst mnt_vnodelist; /* list of vnodes this mount */ |
---|
145 | int mnt_flag; /* flags */ |
---|
146 | int mnt_maxsymlinklen; /* max size of short symlink */ |
---|
147 | struct statfs mnt_stat; /* cache of filesystem stats */ |
---|
148 | qaddr_t mnt_data; /* private data */ |
---|
149 | /* struct vfsconf *mnt_vfc; */ /* configuration info */ |
---|
150 | time_t mnt_time; /* last time written*/ |
---|
151 | }; |
---|
152 | |
---|
153 | /* |
---|
154 | * Mount flags. |
---|
155 | * |
---|
156 | * Unmount uses MNT_FORCE flag. |
---|
157 | */ |
---|
158 | #define MNT_RDONLY 0x00000001 /* read only filesystem */ |
---|
159 | #define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */ |
---|
160 | #define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */ |
---|
161 | #define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */ |
---|
162 | #define MNT_NODEV 0x00000010 /* don't interpret special files */ |
---|
163 | #define MNT_UNION 0x00000020 /* union with underlying filesystem */ |
---|
164 | #define MNT_ASYNC 0x00000040 /* file system written asynchronously */ |
---|
165 | #define MNT_NOATIME 0x10000000 /* Disable update of file access times */ |
---|
166 | |
---|
167 | /* |
---|
168 | * exported mount flags. |
---|
169 | */ |
---|
170 | #define MNT_EXRDONLY 0x00000080 /* exported read only */ |
---|
171 | #define MNT_EXPORTED 0x00000100 /* file system is exported */ |
---|
172 | #define MNT_DEFEXPORTED 0x00000200 /* exported to the world */ |
---|
173 | #define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */ |
---|
174 | #define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */ |
---|
175 | |
---|
176 | /* |
---|
177 | * Flags set by internal operations. |
---|
178 | */ |
---|
179 | #define MNT_LOCAL 0x00001000 /* filesystem is stored locally */ |
---|
180 | #define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */ |
---|
181 | #define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */ |
---|
182 | #define MNT_USER 0x00008000 /* mounted by a user */ |
---|
183 | |
---|
184 | /* |
---|
185 | * Mask of flags that are visible to statfs() |
---|
186 | */ |
---|
187 | #define MNT_VISFLAGMASK (MNT_RDONLY|MNT_SYNCHRONOUS|MNT_NOEXEC|MNT_NOSUID| \ |
---|
188 | MNT_NODEV|MNT_UNION|MNT_ASYNC|MNT_EXRDONLY|MNT_EXPORTED| \ |
---|
189 | MNT_DEFEXPORTED|MNT_EXPORTANON|MNT_EXKERB|MNT_LOCAL| \ |
---|
190 | MNT_QUOTA|MNT_ROOTFS|MNT_USER|MNT_NOATIME) |
---|
191 | |
---|
192 | /* |
---|
193 | * filesystem control flags. |
---|
194 | * |
---|
195 | * MNT_MLOCK lock the mount entry so that name lookup cannot proceed |
---|
196 | * past the mount point. This keeps the subtree stable during mounts |
---|
197 | * and unmounts. |
---|
198 | */ |
---|
199 | #define MNT_UPDATE 0x00010000 /* not a real mount, just an update */ |
---|
200 | #define MNT_DELEXPORT 0x00020000 /* delete export host lists */ |
---|
201 | #define MNT_RELOAD 0x00040000 /* reload filesystem data */ |
---|
202 | #define MNT_FORCE 0x00080000 /* force unmount or readonly change */ |
---|
203 | #define MNT_MLOCK 0x00100000 /* lock so that subtree is stable */ |
---|
204 | #define MNT_MWAIT 0x00200000 /* someone is waiting for lock */ |
---|
205 | #define MNT_MPBUSY 0x00400000 /* scan of mount point in progress */ |
---|
206 | #define MNT_MPWANT 0x00800000 /* waiting for mount point */ |
---|
207 | #define MNT_UNMOUNT 0x01000000 /* unmount in progress */ |
---|
208 | #define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */ |
---|
209 | |
---|
210 | /* |
---|
211 | * used to get configured filesystems information |
---|
212 | */ |
---|
213 | #define VFS_MAXNAMELEN 32 |
---|
214 | struct vfsconf { |
---|
215 | void *vfc_vfsops; |
---|
216 | char vfc_name[VFS_MAXNAMELEN]; |
---|
217 | int vfc_index; |
---|
218 | int vfc_refcount; |
---|
219 | int vfc_flags; |
---|
220 | }; |
---|
221 | |
---|
222 | /* |
---|
223 | * NB: these flags refer to IMPLEMENTATION properties, not properties of |
---|
224 | * any actual mounts; i.e., it does not make sense to change the flags. |
---|
225 | */ |
---|
226 | #define VFCF_STATIC 0x00000001 /* statically compiled into kernel */ |
---|
227 | #define VFCF_NETWORK 0x00000002 /* may get data over the network */ |
---|
228 | #define VFCF_READONLY 0x00000004 /* writes are not implemented */ |
---|
229 | #define VFCF_SYNTHETIC 0x00000008 /* data does not represent real files */ |
---|
230 | #define VFCF_LOOPBACK 0x00000010 /* aliases some other mounted FS */ |
---|
231 | #define VFCF_UNICODE 0x00000020 /* stores file names as Unicode*/ |
---|
232 | |
---|
233 | /* |
---|
234 | * Operations supported on mounted file system. |
---|
235 | */ |
---|
236 | #ifdef KERNEL |
---|
237 | |
---|
238 | extern int doforce; /* Flag to permit forcible unmounting. */ |
---|
239 | extern struct vfsconf void_vfsconf; |
---|
240 | extern struct vfsconf *vfsconf[]; |
---|
241 | |
---|
242 | #ifdef __STDC__ |
---|
243 | struct nameidata; |
---|
244 | struct mbuf; |
---|
245 | #endif |
---|
246 | |
---|
247 | struct vfsops { |
---|
248 | int (*vfs_mount) __P((struct mount *mp, char *path, caddr_t data, |
---|
249 | struct nameidata *ndp, struct proc *p)); |
---|
250 | int (*vfs_start) __P((struct mount *mp, int flags, |
---|
251 | struct proc *p)); |
---|
252 | int (*vfs_unmount) __P((struct mount *mp, int mntflags, |
---|
253 | struct proc *p)); |
---|
254 | int (*vfs_root) __P((struct mount *mp, struct vnode **vpp)); |
---|
255 | int (*vfs_quotactl) __P((struct mount *mp, int cmds, uid_t uid, |
---|
256 | caddr_t arg, struct proc *p)); |
---|
257 | int (*vfs_statfs) __P((struct mount *mp, struct statfs *sbp, |
---|
258 | struct proc *p)); |
---|
259 | int (*vfs_sync) __P((struct mount *mp, int waitfor, |
---|
260 | struct ucred *cred, struct proc *p)); |
---|
261 | int (*vfs_vget) __P((struct mount *mp, ino_t ino, |
---|
262 | struct vnode **vpp)); |
---|
263 | int (*vfs_fhtovp) __P((struct mount *mp, struct fid *fhp, |
---|
264 | struct mbuf *nam, struct vnode **vpp, |
---|
265 | int *exflagsp, struct ucred **credanonp)); |
---|
266 | int (*vfs_vptofh) __P((struct vnode *vp, struct fid *fhp)); |
---|
267 | int (*vfs_init) __P((void)); |
---|
268 | }; |
---|
269 | |
---|
270 | #define VFS_MOUNT(MP, PATH, DATA, NDP, P) \ |
---|
271 | (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P) |
---|
272 | #define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P) |
---|
273 | #define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P) |
---|
274 | #define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP) |
---|
275 | #define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P) |
---|
276 | #define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P) |
---|
277 | #define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P) |
---|
278 | #define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP) |
---|
279 | #define VFS_FHTOVP(MP, FIDP, NAM, VPP, EXFLG, CRED) \ |
---|
280 | (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, NAM, VPP, EXFLG, CRED) |
---|
281 | #define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) |
---|
282 | |
---|
283 | #ifdef VFS_LKM |
---|
284 | #include <sys/conf.h> |
---|
285 | #include <sys/exec.h> |
---|
286 | #include <sys/sysent.h> |
---|
287 | #include <sys/lkm.h> |
---|
288 | |
---|
289 | #define VFS_SET(vfsops, fsname, index, flags) \ |
---|
290 | static struct vfsconf _fs_vfsconf = { \ |
---|
291 | &vfsops, \ |
---|
292 | #fsname, \ |
---|
293 | index, \ |
---|
294 | 0, \ |
---|
295 | flags \ |
---|
296 | }; \ |
---|
297 | extern struct linker_set MODVNOPS; \ |
---|
298 | MOD_VFS(#fsname,index,&MODVNOPS,&_fs_vfsconf); \ |
---|
299 | int \ |
---|
300 | fsname ## _mod(struct lkm_table *lkmtp, int cmd, int ver) { \ |
---|
301 | DISPATCH(lkmtp, cmd, ver, lkm_nullcmd, lkm_nullcmd, lkm_nullcmd); } |
---|
302 | #else |
---|
303 | |
---|
304 | #define VFS_SET(vfsops, fsname, index, flags) \ |
---|
305 | static struct vfsconf _fs_vfsconf = { \ |
---|
306 | &vfsops, \ |
---|
307 | #fsname, \ |
---|
308 | index, \ |
---|
309 | 0, \ |
---|
310 | flags | VFCF_STATIC \ |
---|
311 | }; \ |
---|
312 | DATA_SET(vfs_set,_fs_vfsconf) |
---|
313 | #endif /* VFS_LKM */ |
---|
314 | |
---|
315 | #endif /* KERNEL */ |
---|
316 | |
---|
317 | /* |
---|
318 | * Flags for various system call interfaces. |
---|
319 | * |
---|
320 | * waitfor flags to vfs_sync() and getfsstat() |
---|
321 | */ |
---|
322 | #define MNT_WAIT 1 |
---|
323 | #define MNT_NOWAIT 2 |
---|
324 | |
---|
325 | /* |
---|
326 | * Generic file handle |
---|
327 | */ |
---|
328 | struct fhandle { |
---|
329 | fsid_t fh_fsid; /* File system id of mount point */ |
---|
330 | struct fid fh_fid; /* File sys specific id */ |
---|
331 | }; |
---|
332 | typedef struct fhandle fhandle_t; |
---|
333 | |
---|
334 | #ifdef KERNEL |
---|
335 | #include <net/radix.h> |
---|
336 | #include <sys/socket.h> /* XXX for AF_MAX */ |
---|
337 | |
---|
338 | /* |
---|
339 | * Network address lookup element |
---|
340 | */ |
---|
341 | struct netcred { |
---|
342 | struct radix_node netc_rnodes[2]; |
---|
343 | int netc_exflags; |
---|
344 | struct ucred netc_anon; |
---|
345 | }; |
---|
346 | |
---|
347 | /* |
---|
348 | * Network export information |
---|
349 | */ |
---|
350 | struct netexport { |
---|
351 | struct netcred ne_defexported; /* Default export */ |
---|
352 | struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */ |
---|
353 | }; |
---|
354 | #endif /* KERNEL */ |
---|
355 | |
---|
356 | /* |
---|
357 | * Export arguments for local filesystem mount calls. |
---|
358 | */ |
---|
359 | struct export_args { |
---|
360 | int ex_flags; /* export related flags */ |
---|
361 | uid_t ex_root; /* mapping for root uid */ |
---|
362 | struct ucred ex_anon; /* mapping for anonymous user */ |
---|
363 | struct sockaddr *ex_addr; /* net address to which exported */ |
---|
364 | int ex_addrlen; /* and the net address length */ |
---|
365 | struct sockaddr *ex_mask; /* mask of valid bits in saddr */ |
---|
366 | int ex_masklen; /* and the smask length */ |
---|
367 | }; |
---|
368 | |
---|
369 | /* |
---|
370 | * Arguments to mount UFS-based filesystems |
---|
371 | */ |
---|
372 | struct ufs_args { |
---|
373 | char *fspec; /* block special device to mount */ |
---|
374 | struct export_args export; /* network export information */ |
---|
375 | }; |
---|
376 | |
---|
377 | #ifdef MFS |
---|
378 | /* |
---|
379 | * Arguments to mount MFS |
---|
380 | */ |
---|
381 | struct mfs_args { |
---|
382 | char *fspec; /* name to export for statfs */ |
---|
383 | struct export_args export; /* if exported MFSes are supported */ |
---|
384 | caddr_t base; /* base of file system in memory */ |
---|
385 | u_long size; /* size of file system */ |
---|
386 | }; |
---|
387 | #endif /* MFS */ |
---|
388 | |
---|
389 | #ifdef MSDOSFS |
---|
390 | /* |
---|
391 | * Arguments to mount MSDOS filesystems. |
---|
392 | */ |
---|
393 | struct msdosfs_args { |
---|
394 | char *fspec; /* blocks special holding the fs to mount */ |
---|
395 | struct export_args export; /* network export information */ |
---|
396 | uid_t uid; /* uid that owns msdosfs files */ |
---|
397 | gid_t gid; /* gid that owns msdosfs files */ |
---|
398 | mode_t mask; /* mask to be applied for msdosfs perms */ |
---|
399 | }; |
---|
400 | #endif |
---|
401 | |
---|
402 | #ifdef CD9660 |
---|
403 | /* |
---|
404 | * Arguments to mount ISO 9660 filesystems. |
---|
405 | */ |
---|
406 | struct iso_args { |
---|
407 | char *fspec; /* block special device to mount */ |
---|
408 | struct export_args export; /* network export info */ |
---|
409 | int flags; /* mounting flags, see below */ |
---|
410 | int ssector; /* starting sector */ |
---|
411 | |
---|
412 | }; |
---|
413 | #define ISOFSMNT_NORRIP 0x00000001 /* disable Rock Ridge Ext.*/ |
---|
414 | #define ISOFSMNT_GENS 0x00000002 /* enable generation numbers */ |
---|
415 | #define ISOFSMNT_EXTATT 0x00000004 /* enable extended attributes */ |
---|
416 | #endif /* CD9660 */ |
---|
417 | |
---|
418 | #ifdef NFS |
---|
419 | /* |
---|
420 | * Arguments to mount NFS |
---|
421 | */ |
---|
422 | struct nfs_args { |
---|
423 | struct sockaddr *addr; /* file server address */ |
---|
424 | int addrlen; /* length of address */ |
---|
425 | int sotype; /* Socket type */ |
---|
426 | int proto; /* and Protocol */ |
---|
427 | u_char *fh; /* File handle to be mounted */ |
---|
428 | int fhsize; /* Size, in bytes, of fh */ |
---|
429 | int flags; /* flags */ |
---|
430 | int wsize; /* write size in bytes */ |
---|
431 | int rsize; /* read size in bytes */ |
---|
432 | int readdirsize; /* readdir size in bytes */ |
---|
433 | int timeo; /* initial timeout in .1 secs */ |
---|
434 | int retrans; /* times to retry send */ |
---|
435 | int maxgrouplist; /* Max. size of group list */ |
---|
436 | int readahead; /* # of blocks to readahead */ |
---|
437 | int leaseterm; /* Term (sec) of lease */ |
---|
438 | int deadthresh; /* Retrans threshold */ |
---|
439 | char *hostname; /* server's name */ |
---|
440 | }; |
---|
441 | |
---|
442 | /* |
---|
443 | * NFS mount option flags |
---|
444 | */ |
---|
445 | #define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */ |
---|
446 | #define NFSMNT_WSIZE 0x00000002 /* set write size */ |
---|
447 | #define NFSMNT_RSIZE 0x00000004 /* set read size */ |
---|
448 | #define NFSMNT_TIMEO 0x00000008 /* set initial timeout */ |
---|
449 | #define NFSMNT_RETRANS 0x00000010 /* set number of request retrys */ |
---|
450 | #define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */ |
---|
451 | #define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */ |
---|
452 | #define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */ |
---|
453 | #define NFSMNT_NQNFS 0x00000100 /* Use Nqnfs protocol */ |
---|
454 | #define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */ |
---|
455 | #define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */ |
---|
456 | #define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */ |
---|
457 | #define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */ |
---|
458 | #define NFSMNT_READAHEAD 0x00002000 /* set read ahead */ |
---|
459 | #define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */ |
---|
460 | #define NFSMNT_RESVPORT 0x00008000 /* Allocate a reserved port */ |
---|
461 | #define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */ |
---|
462 | #define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */ |
---|
463 | #define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */ |
---|
464 | #define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */ |
---|
465 | #define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */ |
---|
466 | #define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */ |
---|
467 | #define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */ |
---|
468 | #define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */ |
---|
469 | #define NFSMNT_DISMNT 0x00800000 /* Dismounted */ |
---|
470 | #define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */ |
---|
471 | #define NFSMNT_WANTSND 0x02000000 /* Want above */ |
---|
472 | #define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */ |
---|
473 | #define NFSMNT_WANTRCV 0x08000000 /* Want above */ |
---|
474 | #define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */ |
---|
475 | #define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */ |
---|
476 | #define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */ |
---|
477 | #define NFSMNT_AUTHERR 0x80000000 /* Authentication error */ |
---|
478 | #endif /* NFS */ |
---|
479 | |
---|
480 | #ifdef KERNEL |
---|
481 | extern int (*mountroot) __P((void *)); |
---|
482 | extern struct vfsops *mountrootvfsops; |
---|
483 | |
---|
484 | /* |
---|
485 | * exported vnode operations |
---|
486 | */ |
---|
487 | int dounmount __P((struct mount *, int, struct proc *)); |
---|
488 | struct mount *getvfs __P((fsid_t *)); /* return vfs given fsid */ |
---|
489 | void getnewfsid __P((struct mount *, int)); |
---|
490 | int vflush __P((struct mount *, struct vnode *, int)); |
---|
491 | int vfs_export /* process mount export info */ |
---|
492 | __P((struct mount *, struct netexport *, struct export_args *)); |
---|
493 | struct netcred *vfs_export_lookup /* lookup host in fs export list */ |
---|
494 | __P((struct mount *, struct netexport *, struct mbuf *)); |
---|
495 | int vfs_lock __P((struct mount *)); /* lock a vfs */ |
---|
496 | int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */ |
---|
497 | int vfs_mountroot __P((void *)); /* XXX goes away? */ |
---|
498 | void vfs_msync __P((struct mount *, int)); |
---|
499 | void vfs_unlock __P((struct mount *)); /* unlock a vfs */ |
---|
500 | void vfs_unmountall __P((void)); |
---|
501 | int vfs_busy __P((struct mount *)); /* mark a vfs busy */ |
---|
502 | void vfs_unbusy __P((struct mount *)); /* mark a vfs not busy */ |
---|
503 | extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ |
---|
504 | extern struct vfsops *vfssw[]; /* filesystem type table */ |
---|
505 | |
---|
506 | #else /* KERNEL */ |
---|
507 | |
---|
508 | #include <sys/cdefs.h> |
---|
509 | |
---|
510 | __BEGIN_DECLS |
---|
511 | int fstatfs __P((int, struct statfs *)); |
---|
512 | int getfh __P((const char *, fhandle_t *)); |
---|
513 | int getfsstat __P((struct statfs *, long, int)); |
---|
514 | int getmntinfo __P((struct statfs **, int)); |
---|
515 | int mount __P((int, const char *, int, void *)); |
---|
516 | int statfs __P((const char *, struct statfs *)); |
---|
517 | int unmount __P((const char *, int)); |
---|
518 | |
---|
519 | /* C library stuff */ |
---|
520 | struct vfsconf *getvfsbyname __P((const char *)); |
---|
521 | struct vfsconf *getvfsbytype __P((int)); |
---|
522 | struct vfsconf *getvfsent __P((void)); |
---|
523 | void setvfsent __P((int)); |
---|
524 | void endvfsent __P((void)); |
---|
525 | int vfsisloadable __P((const char *)); |
---|
526 | int vfsload __P((const char *)); |
---|
527 | __END_DECLS |
---|
528 | |
---|
529 | #endif /* KERNEL */ |
---|
530 | |
---|
531 | #endif /* !_SYS_MOUNT_H_ */ |
---|