add tmpfs_args to mount_info, pointed out by espie@openbsd
[bitrig.git] / sys / sys / mount.h
blobc8d907722cdba344a9b228b970c3e8b67b5d8282
1 /* $OpenBSD: mount.h,v 1.109 2013/04/15 15:32:19 jsing Exp $ */
2 /* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */
4 /*
5 * Copyright (c) 1989, 1991, 1993
6 * The Regents of the University of California. All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
32 * @(#)mount.h 8.15 (Berkeley) 7/14/94
35 #ifndef _SYS_MOUNT_H_
36 #define _SYS_MOUNT_H_
38 #include <sys/cdefs.h>
39 #ifndef _KERNEL
40 #include <sys/ucred.h>
41 #endif
42 #include <sys/queue.h>
43 #include <sys/rwlock.h>
45 typedef struct { int32_t val[2]; } fsid_t; /* file system id type */
48 * File identifier.
49 * These are unique per filesystem on a single machine.
51 #define MAXFIDSZ 16
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) */
60 * Export arguments for local filesystem mount calls.
62 struct export_args {
63 int ex_flags; /* export related flags */
64 uid_t ex_root; /* mapping for root uid */
65 struct ucred ex_anon; /* mapping for anonymous user */
66 struct sockaddr *ex_addr; /* net address to which exported */
67 int ex_addrlen; /* and the net address length */
68 struct sockaddr *ex_mask; /* mask of valid bits in saddr */
69 int ex_masklen; /* and the smask length */
73 * Arguments to mount UFS-based filesystems
75 struct ufs_args {
76 char *fspec; /* block special device to mount */
77 struct export_args export_info;/* network export information */
81 * Arguments to mount MFS
83 struct mfs_args {
84 char *fspec; /* name to export for statfs */
85 struct export_args export_info;/* if exported MFSes are supported */
86 caddr_t base; /* base of file system in memory */
87 u_long size; /* size of file system */
91 * Arguments to mount tmpfs file systems
93 #define TMPFS_ARGS_VERSION 1
94 struct tmpfs_args {
95 int ta_version;
97 /* Size counters. */
98 ino_t ta_nodes_max;
99 off_t ta_size_max;
101 /* Root node attributes. */
102 uid_t ta_root_uid;
103 gid_t ta_root_gid;
104 mode_t ta_root_mode;
108 * Arguments to mount ISO 9660 filesystems.
110 struct iso_args {
111 char *fspec; /* block special device to mount */
112 struct export_args export_info;/* network export info */
113 int flags; /* mounting flags, see below */
114 int sess; /* start sector of session */
117 #define ISOFSMNT_NORRIP 0x00000001 /* disable Rock Ridge Ext.*/
118 #define ISOFSMNT_GENS 0x00000002 /* enable generation numbers */
119 #define ISOFSMNT_EXTATT 0x00000004 /* enable extended attr. */
120 #define ISOFSMNT_NOJOLIET 0x00000008 /* disable Joliet Ext.*/
121 #define ISOFSMNT_SESS 0x00000010 /* use iso_args.sess */
124 * Arguments to mount NFS
126 #define NFS_ARGSVERSION 4 /* change when nfs_args changes */
127 struct nfs_args {
128 int version; /* args structure version number */
129 struct sockaddr *addr; /* file server address */
130 int addrlen; /* length of address */
131 int sotype; /* Socket type */
132 int proto; /* and Protocol */
133 u_char *fh; /* File handle to be mounted */
134 int fhsize; /* Size, in bytes, of fh */
135 int flags; /* flags */
136 int wsize; /* write size in bytes */
137 int rsize; /* read size in bytes */
138 int readdirsize; /* readdir size in bytes */
139 int timeo; /* initial timeout in .1 secs */
140 int retrans; /* times to retry send */
141 int maxgrouplist; /* Max. size of group list */
142 int readahead; /* # of blocks to readahead */
143 int leaseterm; /* Term (sec) of lease */
144 int deadthresh; /* Retrans threshold */
145 char *hostname; /* server's name */
146 int acregmin; /* Attr cache file recently modified */
147 int acregmax; /* ac file not recently modified */
148 int acdirmin; /* ac for dir recently modified */
149 int acdirmax; /* ac for dir not recently modified */
153 * NFS mount option flags
155 #define NFSMNT_RESVPORT 0x00000000 /* always use reserved ports */
156 #define NFSMNT_SOFT 0x00000001 /* soft mount (hard is default) */
157 #define NFSMNT_WSIZE 0x00000002 /* set write size */
158 #define NFSMNT_RSIZE 0x00000004 /* set read size */
159 #define NFSMNT_TIMEO 0x00000008 /* set initial timeout */
160 #define NFSMNT_RETRANS 0x00000010 /* set number of request retries */
161 #define NFSMNT_MAXGRPS 0x00000020 /* set maximum grouplist size */
162 #define NFSMNT_INT 0x00000040 /* allow interrupts on hard mount */
163 #define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */
164 #define NFSMNT_NQNFS 0x00000100 /* Use Nqnfs protocol */
165 #define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */
166 #define NFSMNT_KERB 0x00000400 /* Use Kerberos authentication */
167 #define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */
168 #define NFSMNT_LEASETERM 0x00001000 /* set lease term (nqnfs) */
169 #define NFSMNT_READAHEAD 0x00002000 /* set read ahead */
170 #define NFSMNT_DEADTHRESH 0x00004000 /* set dead server retry thresh */
171 #define NFSMNT_NOAC 0x00008000 /* disable attribute cache */
172 #define NFSMNT_RDIRPLUS 0x00010000 /* Use Readdirplus for V3 */
173 #define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
175 /* Flags valid only in mount syscall arguments */
176 #define NFSMNT_ACREGMIN 0x00040000 /* acregmin field valid */
177 #define NFSMNT_ACREGMAX 0x00080000 /* acregmax field valid */
178 #define NFSMNT_ACDIRMIN 0x00100000 /* acdirmin field valid */
179 #define NFSMNT_ACDIRMAX 0x00200000 /* acdirmax field valid */
181 /* Flags valid only in kernel */
182 #define NFSMNT_INTERNAL 0xfffc0000 /* Bits set internally */
183 #define NFSMNT_HASWRITEVERF 0x00040000 /* Has write verifier for V3 */
184 #define NFSMNT_GOTPATHCONF 0x00080000 /* Got the V3 pathconf info */
185 #define NFSMNT_GOTFSINFO 0x00100000 /* Got the V3 fsinfo */
186 #define NFSMNT_MNTD 0x00200000 /* Mnt server for mnt point */
187 #define NFSMNT_DISMINPROG 0x00400000 /* Dismount in progress */
188 #define NFSMNT_DISMNT 0x00800000 /* Dismounted */
189 #define NFSMNT_SNDLOCK 0x01000000 /* Send socket lock */
190 #define NFSMNT_WANTSND 0x02000000 /* Want above */
191 #define NFSMNT_RCVLOCK 0x04000000 /* Rcv socket lock */
192 #define NFSMNT_WANTRCV 0x08000000 /* Want above */
193 #define NFSMNT_WAITAUTH 0x10000000 /* Wait for authentication */
194 #define NFSMNT_HASAUTH 0x20000000 /* Has authenticator */
195 #define NFSMNT_WANTAUTH 0x40000000 /* Wants an authenticator */
196 #define NFSMNT_AUTHERR 0x80000000 /* Authentication error */
199 * Arguments to mount MSDOS filesystems.
201 struct msdosfs_args {
202 char *fspec; /* blocks special holding the fs to mount */
203 struct export_args export_info;
204 /* network export information */
205 uid_t uid; /* uid that owns msdosfs files */
206 gid_t gid; /* gid that owns msdosfs files */
207 mode_t mask; /* mask to be applied for msdosfs perms */
208 int flags; /* see below */
212 * Msdosfs mount options:
214 #define MSDOSFSMNT_SHORTNAME 0x01 /* Force old DOS short names only */
215 #define MSDOSFSMNT_LONGNAME 0x02 /* Force Win'95 long names */
216 #define MSDOSFSMNT_NOWIN95 0x04 /* Completely ignore Win95 entries */
217 #define MSDOSFSMNT_ALLOWDIRX 0x10 /* dir is mode +x if r */
219 /* Arguments to mount UDF file systems */
220 struct udf_args {
221 char *fspec; /* Block special device to mount */
222 u_int32_t lastblock; /* Special device last block */
225 /* per-filesystem mount options */
226 union mount_info {
227 struct ufs_args ufs_args;
228 struct mfs_args mfs_args;
229 struct nfs_args nfs_args;
230 struct iso_args iso_args;
231 struct msdosfs_args msdosfs_args;
232 struct tmpfs_args tmpfs_args;
233 char __align[160]; /* 64-bit alignment and room to grow */
236 #define MFSNAMELEN 16 /* length of fs type name, including nul */
237 #define MNAMELEN 90 /* length of buffer for returned name */
239 /* new statfs structure with mount options and statvfs fields */
240 struct statfs {
241 u_int32_t f_flags; /* copy of mount flags */
242 u_int32_t f_bsize; /* file system block size */
243 u_int32_t f_iosize; /* optimal transfer block size */
245 /* unit is f_bsize */
246 u_int64_t f_blocks; /* total data blocks in file system */
247 u_int64_t f_bfree; /* free blocks in fs */
248 int64_t f_bavail; /* free blocks avail to non-superuser */
250 u_int64_t f_files; /* total file nodes in file system */
251 u_int64_t f_ffree; /* free file nodes in fs */
252 int64_t f_favail; /* free file nodes avail to non-root */
254 u_int64_t f_syncwrites; /* count of sync writes since mount */
255 u_int64_t f_syncreads; /* count of sync reads since mount */
256 u_int64_t f_asyncwrites; /* count of async writes since mount */
257 u_int64_t f_asyncreads; /* count of async reads since mount */
259 fsid_t f_fsid; /* file system id */
260 u_int32_t f_namemax; /* maximum filename length */
261 uid_t f_owner; /* user that mounted the file system */
262 u_int64_t f_ctime; /* last mount [-u] time */
264 char f_fstypename[MFSNAMELEN]; /* fs type name */
265 char f_mntonname[MNAMELEN]; /* directory on which mounted */
266 char f_mntfromname[MNAMELEN]; /* mounted file system */
267 char f_mntfromspec[MNAMELEN]; /* special for mount request */
268 union mount_info mount_info; /* per-filesystem mount options */
271 #ifdef _KERNEL
273 * Per-filesystem mount options minus __align which was accidentally removed
274 * in a cleanup.
276 union mount_info53 {
277 struct ufs_args ufs_args;
278 struct mfs_args mfs_args;
279 struct nfs_args nfs_args;
280 struct iso_args iso_args;
281 struct msdosfs_args msdosfs_args;
284 /* COMPAT_O53 version without f_mntfromspec and smaller f_ctime */
285 struct statfs53 {
286 u_int32_t f_flags; /* copy of mount flags */
287 u_int32_t f_bsize; /* file system block size */
288 u_int32_t f_iosize; /* optimal transfer block size */
290 /* unit is f_bsize */
291 u_int64_t f_blocks; /* total data blocks in file system */
292 u_int64_t f_bfree; /* free blocks in fs */
293 int64_t f_bavail; /* free blocks avail to non-superuser */
295 u_int64_t f_files; /* total file nodes in file system */
296 u_int64_t f_ffree; /* free file nodes in fs */
297 int64_t f_favail; /* free file nodes avail to non-root */
299 u_int64_t f_syncwrites; /* count of sync writes since mount */
300 u_int64_t f_syncreads; /* count of sync reads since mount */
301 u_int64_t f_asyncwrites; /* count of async writes since mount */
302 u_int64_t f_asyncreads; /* count of async reads since mount */
304 fsid_t f_fsid; /* file system id */
305 u_int32_t f_namemax; /* maximum filename length */
306 uid_t f_owner; /* user that mounted the file system */
307 u_int32_t f_ctime; /* last mount [-u] time */
308 u_int32_t f_spare[3]; /* spare for later */
310 char f_fstypename[MFSNAMELEN]; /* fs type name */
311 char f_mntonname[MNAMELEN]; /* directory on which mounted */
312 char f_mntfromname[MNAMELEN]; /* mounted file system */
313 union mount_info53 mount_info; /* per-filesystem mount options */
316 #endif /* _KERNEL */
320 * File system types.
322 #define MOUNT_FFS "ffs" /* UNIX "Fast" Filesystem */
323 #define MOUNT_NFS "nfs" /* Network Filesystem */
324 #define MOUNT_MFS "mfs" /* Memory Filesystem */
325 #define MOUNT_MSDOS "msdos" /* MSDOS Filesystem */
326 #define MOUNT_CD9660 "cd9660" /* ISO9660 (aka CDROM) Filesystem */
327 #define MOUNT_EXT2FS "ext2fs" /* Second Extended Filesystem */
328 #define MOUNT_UDF "udf" /* UDF */
329 #define MOUNT_TMPFS "tmpfs" /* tmpfs */
332 * Structure per mounted file system. Each mounted file system has an
333 * array of operations and an instance record. The file systems are
334 * put on a doubly linked list.
336 LIST_HEAD(vnodelst, vnode);
338 struct mount {
339 CIRCLEQ_ENTRY(mount) mnt_list; /* mount list */
340 const struct vfsops *mnt_op; /* operations on fs */
341 struct vfsconf *mnt_vfc; /* configuration info */
342 struct vnode *mnt_vnodecovered; /* vnode we mounted on */
343 struct vnode *mnt_syncer; /* syncer vnode */
344 struct vnodelst mnt_vnodelist; /* list of vnodes this mount */
345 struct rwlock mnt_lock; /* mount structure lock */
346 int mnt_flag; /* flags */
347 int mnt_maxsymlinklen; /* max size of short symlink */
348 struct statfs mnt_stat; /* cache of filesystem stats */
349 void *mnt_data; /* private data */
353 * Mount flags.
355 * Unmount uses MNT_FORCE flag.
357 #define MNT_RDONLY 0x00000001 /* read only filesystem */
358 #define MNT_SYNCHRONOUS 0x00000002 /* file system written synchronously */
359 #define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */
360 #define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */
361 #define MNT_NODEV 0x00000010 /* don't interpret special files */
362 #define MNT_ASYNC 0x00000040 /* file system written asynchronously */
365 * exported mount flags.
367 #define MNT_EXRDONLY 0x00000080 /* exported read only */
368 #define MNT_EXPORTED 0x00000100 /* file system is exported */
369 #define MNT_DEFEXPORTED 0x00000200 /* exported to the world */
370 #define MNT_EXPORTANON 0x00000400 /* use anon uid mapping for everyone */
371 #define MNT_EXKERB 0x00000800 /* exported with Kerberos uid mapping */
374 * Flags set by internal operations.
376 #define MNT_LOCAL 0x00001000 /* filesystem is stored locally */
377 #define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */
378 #define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */
381 * Extra post 4.4BSD-lite2 mount flags.
383 #define MNT_NOATIME 0x00008000 /* don't update access times on fs */
386 * Mask of flags that are visible to statfs()
388 #define MNT_VISFLAGMASK 0x0400ffff
390 #define MNT_BITS \
391 "\010\001RDONLY\002SYNCHRONOUS\003NOEXEC\004NOSUID\005NODEV" \
392 "\007ASYNC\010EXRDONLY\011EXPORTED\012DEFEXPORTED\013EXPORTANON" \
393 "\014EXKERB\015LOCAL\016QUOTA\017ROOTFS"
396 * Filesystem control flags.
398 #define MNT_UPDATE 0x00010000 /* not a real mount, just an update */
399 #define MNT_DELEXPORT 0x00020000 /* delete export host lists */
400 #define MNT_RELOAD 0x00040000 /* reload filesystem data */
401 #define MNT_FORCE 0x00080000 /* force unmount or readonly change */
402 #define MNT_WANTRDWR 0x02000000 /* want upgrade to read/write */
403 #define MNT_SOFTDEP 0x04000000 /* soft dependencies being done */
404 #define MNT_DOOMED 0x08000000 /* device behind filesystem is gone */
407 * Flags for various system call interfaces.
409 * waitfor flags to vfs_sync() and getfsstat()
411 #define MNT_WAIT 1 /* synchronously wait for I/O to complete */
412 #define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */
413 #define MNT_LAZY 3 /* push data not written by filesystem syncer */
416 * Generic file handle
418 struct fhandle {
419 fsid_t fh_fsid; /* File system id of mount point */
420 struct fid fh_fid; /* File sys specific id */
422 typedef struct fhandle fhandle_t;
425 * Sysctl CTL_VFS definitions.
427 * Second level identifier specifies which filesystem. Second level
428 * identifier VFS_GENERIC returns information about all filesystems.
430 #define VFS_GENERIC 0 /* generic filesystem information */
432 * Third level identifiers for VFS_GENERIC are given below; third
433 * level identifiers for specific filesystems are given in their
434 * mount specific header files.
436 #define VFS_MAXTYPENUM 1 /* int: highest defined filesystem type */
437 #define VFS_CONF 2 /* struct: vfsconf for filesystem given
438 as next argument */
439 #define VFS_BCACHESTAT 3 /* struct: buffer cache statistics given
440 as next argument */
441 #define CTL_VFSGENCTL_NAMES { \
442 { 0, 0 }, \
443 { "maxtypenum", CTLTYPE_INT }, \
444 { "conf", CTLTYPE_NODE }, \
445 { "bcachestat", CTLTYPE_STRUCT } \
449 * Filesystem configuration information. One of these exists for each
450 * type of filesystem supported by the kernel. These are searched at
451 * mount time to identify the requested filesystem.
453 struct vfsconf {
454 const struct vfsops *vfc_vfsops; /* filesystem operations vector */
455 char vfc_name[MFSNAMELEN]; /* filesystem type name */
456 int vfc_typenum; /* historic filesystem type number */
457 int vfc_refcount; /* number mounted of this type */
458 int vfc_flags; /* permanent flags */
459 struct vfsconf *vfc_next; /* next in list */
462 /* buffer cache statistics */
463 struct bcachestats {
464 int64_t numbufs; /* number of buffers allocated */
465 int64_t numbufpages; /* number of pages in buffer cache */
466 int64_t numdirtypages; /* number of dirty free pages */
467 int64_t numcleanpages; /* number of clean free pages */
468 int64_t pendingwrites; /* number of pending writes */
469 int64_t pendingreads; /* number of pending reads */
470 int64_t numwrites; /* total writes started */
471 int64_t numreads; /* total reads started */
472 int64_t cachehits; /* total reads found in cache */
473 int64_t busymapped; /* number of busy and mapped buffers */
474 int64_t dmapages; /* dma reachable pages in buffer cache */
475 int64_t highpages; /* pages above dma region */
476 int64_t delwribufs; /* delayed write buffers */
477 int64_t kvaslots; /* kva slots total */
478 int64_t kvaslots_avail; /* available kva slots */
480 #ifdef _KERNEL
481 extern struct bcachestats bcstats;
482 extern long buflowpages, bufhighpages, bufbackpages;
483 #define BUFPAGES_DEFICIT (((buflowpages - bcstats.numbufpages) < 0) ? 0 \
484 : buflowpages - bcstats.numbufpages)
485 #define BUFPAGES_INACT (((bcstats.numcleanpages - buflowpages) < 0) ? 0 \
486 : bcstats.numcleanpages - buflowpages)
487 extern int bufcachepercent;
488 extern void bufadjust(int);
489 struct uvm_constraint_range;
490 extern int bufbackoff(struct uvm_constraint_range*, long);
493 * Operations supported on mounted file system.
495 struct nameidata;
496 struct mbuf;
498 extern int maxvfsconf; /* highest defined filesystem type */
499 extern struct vfsconf *vfsconf; /* head of list of filesystem types */
501 struct vfsops {
502 int (*vfs_mount)(struct mount *mp, const char *path,
503 void *data,
504 struct nameidata *ndp, struct proc *p);
505 int (*vfs_start)(struct mount *mp, int flags,
506 struct proc *p);
507 int (*vfs_unmount)(struct mount *mp, int mntflags,
508 struct proc *p);
509 int (*vfs_root)(struct mount *mp, struct vnode **vpp);
510 int (*vfs_quotactl)(struct mount *mp, int cmds, uid_t uid,
511 caddr_t arg, struct proc *p);
512 int (*vfs_statfs)(struct mount *mp, struct statfs *sbp,
513 struct proc *p);
514 int (*vfs_sync)(struct mount *mp, int waitfor,
515 struct ucred *cred, struct proc *p);
516 int (*vfs_vget)(struct mount *mp, ino_t ino,
517 struct vnode **vpp);
518 int (*vfs_fhtovp)(struct mount *mp, struct fid *fhp,
519 struct vnode **vpp);
520 int (*vfs_vptofh)(struct vnode *vp, struct fid *fhp);
521 int (*vfs_init)(struct vfsconf *);
522 int (*vfs_sysctl)(int *, u_int, void *, size_t *, void *,
523 size_t, struct proc *);
524 int (*vfs_checkexp)(struct mount *mp, struct mbuf *nam,
525 int *extflagsp, struct ucred **credanonp);
528 #define VFS_MOUNT(MP, PATH, DATA, NDP, P) \
529 (*(MP)->mnt_op->vfs_mount)(MP, PATH, DATA, NDP, P)
530 #define VFS_START(MP, FLAGS, P) (*(MP)->mnt_op->vfs_start)(MP, FLAGS, P)
531 #define VFS_UNMOUNT(MP, FORCE, P) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE, P)
532 #define VFS_ROOT(MP, VPP) (*(MP)->mnt_op->vfs_root)(MP, VPP)
533 #define VFS_QUOTACTL(MP,C,U,A,P) (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A, P)
534 #define VFS_STATFS(MP, SBP, P) (*(MP)->mnt_op->vfs_statfs)(MP, SBP, P)
535 #define VFS_SYNC(MP, WAIT, C, P) (*(MP)->mnt_op->vfs_sync)(MP, WAIT, C, P)
536 #define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP)
537 #define VFS_FHTOVP(MP, FIDP, VPP) \
538 (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP)
539 #define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP)
540 #define VFS_CHECKEXP(MP, NAM, EXFLG, CRED) \
541 (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED)
544 #include <net/radix.h>
545 #include <sys/socket.h> /* XXX for AF_MAX */
548 * Network address lookup element
550 struct netcred {
551 struct radix_node netc_rnodes[2];
552 int netc_exflags;
553 struct ucred netc_anon;
557 * Network export information
559 struct netexport {
560 struct netcred ne_defexported; /* Default export */
561 struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */
565 * exported vnode operations
567 int vfs_busy(struct mount *, int);
568 #define VB_READ 0x01
569 #define VB_WRITE 0x02
570 #define VB_NOWAIT 0x04 /* immediately fail on busy lock */
571 #define VB_WAIT 0x08 /* sleep fail on busy lock */
573 int vfs_isbusy(struct mount *);
574 int vfs_mount_foreach_vnode(struct mount *, int (*func)(struct vnode *,
575 void *), void *);
576 void vfs_getnewfsid(struct mount *);
577 struct mount *vfs_getvfs(fsid_t *);
578 int vfs_mountedon(struct vnode *);
579 int vfs_rootmountalloc(char *, char *, struct mount **);
580 void vfs_unbusy(struct mount *);
581 void vfs_unmountall(void);
582 extern CIRCLEQ_HEAD(mntlist, mount) mountlist;
584 struct mount *getvfs(fsid_t *); /* return vfs given fsid */
585 /* process mount export info */
586 int vfs_export(struct mount *, struct netexport *, struct export_args *);
587 /* lookup host in fs export list */
588 struct netcred *vfs_export_lookup(struct mount *, struct netexport *,
589 struct mbuf *);
590 int vfs_allocate_syncvnode(struct mount *);
591 int speedup_syncer(void);
593 int vfs_syncwait(int); /* sync and wait for complete */
594 void vfs_shutdown(void); /* unmount and sync file systems */
595 int dounmount(struct mount *, int, struct proc *, struct vnode *);
596 void vfsinit(void);
597 int vfs_register(struct vfsconf *);
598 int vfs_unregister(struct vfsconf *);
599 #else /* _KERNEL */
600 __BEGIN_DECLS
601 int fstatfs(int, struct statfs *);
602 int getfh(const char *, fhandle_t *);
603 int getfsstat(struct statfs *, size_t, int);
604 int getmntinfo(struct statfs **, int);
605 int mount(const char *, const char *, int, void *);
606 int statfs(const char *, struct statfs *);
607 int unmount(const char *, int);
608 #if __BSD_VISIBLE
609 struct stat;
610 int fhopen(const fhandle_t *, int);
611 int fhstat(const fhandle_t *, struct stat *);
612 int fhstatfs(const fhandle_t *, struct statfs *);
613 #endif /* __BSD_VISIBLE */
614 __END_DECLS
615 #endif /* _KERNEL */
616 #endif /* !_SYS_MOUNT_H_ */