1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 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 * $FreeBSD$ 33 */ 34 35 #ifndef _SYS_MOUNT_H_ 36 #define _SYS_MOUNT_H_ 37 38 #include <sys/ucred.h> 39 #include <sys/queue.h> 40 #ifdef _KERNEL 41 #include <sys/lock.h> 42 #include <sys/lockmgr.h> 43 #include <sys/_mutex.h> 44 #include <sys/_sx.h> 45 #endif 46 47 /* 48 * NOTE: When changing statfs structure, mount structure, MNT_* flags or 49 * MNTK_* flags also update DDB show mount command in vfs_subr.c. 50 */ 51 52 typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ 53 54 /* 55 * File identifier. 56 * These are unique per filesystem on a single machine. 57 */ 58 #define MAXFIDSZ 16 59 60 struct fid { 61 u_short fid_len; /* length of data in bytes */ 62 u_short fid_data0; /* force longword alignment */ 63 char fid_data[MAXFIDSZ]; /* data (variable length) */ 64 }; 65 66 /* 67 * filesystem statistics 68 */ 69 #define MFSNAMELEN 16 /* length of type name including null */ 70 #define MNAMELEN 1024 /* size of on/from name bufs */ 71 #define STATFS_VERSION 0x20140518 /* current version number */ 72 struct statfs { 73 uint32_t f_version; /* structure version number */ 74 uint32_t f_type; /* type of filesystem */ 75 uint64_t f_flags; /* copy of mount exported flags */ 76 uint64_t f_bsize; /* filesystem fragment size */ 77 uint64_t f_iosize; /* optimal transfer block size */ 78 uint64_t f_blocks; /* total data blocks in filesystem */ 79 uint64_t f_bfree; /* free blocks in filesystem */ 80 int64_t f_bavail; /* free blocks avail to non-superuser */ 81 uint64_t f_files; /* total file nodes in filesystem */ 82 int64_t f_ffree; /* free nodes avail to non-superuser */ 83 uint64_t f_syncwrites; /* count of sync writes since mount */ 84 uint64_t f_asyncwrites; /* count of async writes since mount */ 85 uint64_t f_syncreads; /* count of sync reads since mount */ 86 uint64_t f_asyncreads; /* count of async reads since mount */ 87 uint64_t f_spare[10]; /* unused spare */ 88 uint32_t f_namemax; /* maximum filename length */ 89 uid_t f_owner; /* user that mounted the filesystem */ 90 fsid_t f_fsid; /* filesystem id */ 91 char f_charspare[80]; /* spare string space */ 92 char f_fstypename[MFSNAMELEN]; /* filesystem type name */ 93 char f_mntfromname[MNAMELEN]; /* mounted filesystem */ 94 char f_mntonname[MNAMELEN]; /* directory on which mounted */ 95 }; 96 97 #if defined(_WANT_FREEBSD11_STATFS) || defined(_KERNEL) 98 #define FREEBSD11_STATFS_VERSION 0x20030518 /* current version number */ 99 struct freebsd11_statfs { 100 uint32_t f_version; /* structure version number */ 101 uint32_t f_type; /* type of filesystem */ 102 uint64_t f_flags; /* copy of mount exported flags */ 103 uint64_t f_bsize; /* filesystem fragment size */ 104 uint64_t f_iosize; /* optimal transfer block size */ 105 uint64_t f_blocks; /* total data blocks in filesystem */ 106 uint64_t f_bfree; /* free blocks in filesystem */ 107 int64_t f_bavail; /* free blocks avail to non-superuser */ 108 uint64_t f_files; /* total file nodes in filesystem */ 109 int64_t f_ffree; /* free nodes avail to non-superuser */ 110 uint64_t f_syncwrites; /* count of sync writes since mount */ 111 uint64_t f_asyncwrites; /* count of async writes since mount */ 112 uint64_t f_syncreads; /* count of sync reads since mount */ 113 uint64_t f_asyncreads; /* count of async reads since mount */ 114 uint64_t f_spare[10]; /* unused spare */ 115 uint32_t f_namemax; /* maximum filename length */ 116 uid_t f_owner; /* user that mounted the filesystem */ 117 fsid_t f_fsid; /* filesystem id */ 118 char f_charspare[80]; /* spare string space */ 119 char f_fstypename[16]; /* filesystem type name */ 120 char f_mntfromname[88]; /* mounted filesystem */ 121 char f_mntonname[88]; /* directory on which mounted */ 122 }; 123 #endif /* _WANT_FREEBSD11_STATFS || _KERNEL */ 124 125 #ifdef _KERNEL 126 #define OMFSNAMELEN 16 /* length of fs type name, including null */ 127 #define OMNAMELEN (88 - 2 * sizeof(long)) /* size of on/from name bufs */ 128 129 /* XXX getfsstat.2 is out of date with write and read counter changes here. */ 130 /* XXX statfs.2 is out of date with read counter changes here. */ 131 struct ostatfs { 132 long f_spare2; /* placeholder */ 133 long f_bsize; /* fundamental filesystem block size */ 134 long f_iosize; /* optimal transfer block size */ 135 long f_blocks; /* total data blocks in filesystem */ 136 long f_bfree; /* free blocks in fs */ 137 long f_bavail; /* free blocks avail to non-superuser */ 138 long f_files; /* total file nodes in filesystem */ 139 long f_ffree; /* free file nodes in fs */ 140 fsid_t f_fsid; /* filesystem id */ 141 uid_t f_owner; /* user that mounted the filesystem */ 142 int f_type; /* type of filesystem */ 143 int f_flags; /* copy of mount exported flags */ 144 long f_syncwrites; /* count of sync writes since mount */ 145 long f_asyncwrites; /* count of async writes since mount */ 146 char f_fstypename[OMFSNAMELEN]; /* fs type name */ 147 char f_mntonname[OMNAMELEN]; /* directory on which mounted */ 148 long f_syncreads; /* count of sync reads since mount */ 149 long f_asyncreads; /* count of async reads since mount */ 150 short f_spares1; /* unused spare */ 151 char f_mntfromname[OMNAMELEN];/* mounted filesystem */ 152 short f_spares2; /* unused spare */ 153 /* 154 * XXX on machines where longs are aligned to 8-byte boundaries, there 155 * is an unnamed int32_t here. This spare was after the apparent end 156 * of the struct until we bit off the read counters from f_mntonname. 157 */ 158 long f_spare[2]; /* unused spare */ 159 }; 160 161 TAILQ_HEAD(vnodelst, vnode); 162 163 /* Mount options list */ 164 TAILQ_HEAD(vfsoptlist, vfsopt); 165 struct vfsopt { 166 TAILQ_ENTRY(vfsopt) link; 167 char *name; 168 void *value; 169 int len; 170 int pos; 171 int seen; 172 }; 173 174 /* 175 * Structure per mounted filesystem. Each mounted filesystem has an 176 * array of operations and an instance record. The filesystems are 177 * put on a doubly linked list. 178 * 179 * Lock reference: 180 * l - mnt_listmtx 181 * m - mountlist_mtx 182 * i - interlock 183 * v - vnode freelist mutex 184 * 185 * Unmarked fields are considered stable as long as a ref is held. 186 * 187 */ 188 struct mount { 189 struct mtx mnt_mtx; /* mount structure interlock */ 190 int mnt_gen; /* struct mount generation */ 191 #define mnt_startzero mnt_list 192 TAILQ_ENTRY(mount) mnt_list; /* (m) mount list */ 193 struct vfsops *mnt_op; /* operations on fs */ 194 struct vfsconf *mnt_vfc; /* configuration info */ 195 struct vnode *mnt_vnodecovered; /* vnode we mounted on */ 196 struct vnode *mnt_syncer; /* syncer vnode */ 197 int mnt_ref; /* (i) Reference count */ 198 struct vnodelst mnt_nvnodelist; /* (i) list of vnodes */ 199 int mnt_nvnodelistsize; /* (i) # of vnodes */ 200 int mnt_writeopcount; /* (i) write syscalls pending */ 201 int mnt_kern_flag; /* (i) kernel only flags */ 202 uint64_t mnt_flag; /* (i) flags shared with user */ 203 struct vfsoptlist *mnt_opt; /* current mount options */ 204 struct vfsoptlist *mnt_optnew; /* new options passed to fs */ 205 int mnt_maxsymlinklen; /* max size of short symlink */ 206 struct statfs mnt_stat; /* cache of filesystem stats */ 207 struct ucred *mnt_cred; /* credentials of mounter */ 208 void * mnt_data; /* private data */ 209 time_t mnt_time; /* last time written*/ 210 int mnt_iosize_max; /* max size for clusters, etc */ 211 struct netexport *mnt_export; /* export list */ 212 struct label *mnt_label; /* MAC label for the fs */ 213 u_int mnt_hashseed; /* Random seed for vfs_hash */ 214 int mnt_lockref; /* (i) Lock reference count */ 215 int mnt_secondary_writes; /* (i) # of secondary writes */ 216 int mnt_secondary_accwrites;/* (i) secondary wr. starts */ 217 struct thread *mnt_susp_owner; /* (i) thread owning suspension */ 218 #define mnt_endzero mnt_gjprovider 219 char *mnt_gjprovider; /* gjournal provider name */ 220 struct mtx mnt_listmtx; 221 struct vnodelst mnt_activevnodelist; /* (l) list of active vnodes */ 222 int mnt_activevnodelistsize;/* (l) # of active vnodes */ 223 struct vnodelst mnt_tmpfreevnodelist; /* (l) list of free vnodes */ 224 int mnt_tmpfreevnodelistsize;/* (l) # of free vnodes */ 225 struct lock mnt_explock; /* vfs_export walkers lock */ 226 TAILQ_ENTRY(mount) mnt_upper_link; /* (m) we in the all uppers */ 227 TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/ 228 }; 229 230 /* 231 * Definitions for MNT_VNODE_FOREACH_ALL. 232 */ 233 struct vnode *__mnt_vnode_next_all(struct vnode **mvp, struct mount *mp); 234 struct vnode *__mnt_vnode_first_all(struct vnode **mvp, struct mount *mp); 235 void __mnt_vnode_markerfree_all(struct vnode **mvp, struct mount *mp); 236 237 #define MNT_VNODE_FOREACH_ALL(vp, mp, mvp) \ 238 for (vp = __mnt_vnode_first_all(&(mvp), (mp)); \ 239 (vp) != NULL; vp = __mnt_vnode_next_all(&(mvp), (mp))) 240 241 #define MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp) \ 242 do { \ 243 MNT_ILOCK(mp); \ 244 __mnt_vnode_markerfree_all(&(mvp), (mp)); \ 245 /* MNT_IUNLOCK(mp); -- done in above function */ \ 246 mtx_assert(MNT_MTX(mp), MA_NOTOWNED); \ 247 } while (0) 248 249 /* 250 * Definitions for MNT_VNODE_FOREACH_ACTIVE. 251 */ 252 struct vnode *__mnt_vnode_next_active(struct vnode **mvp, struct mount *mp); 253 struct vnode *__mnt_vnode_first_active(struct vnode **mvp, struct mount *mp); 254 void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *); 255 256 #define MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) \ 257 for (vp = __mnt_vnode_first_active(&(mvp), (mp)); \ 258 (vp) != NULL; vp = __mnt_vnode_next_active(&(mvp), (mp))) 259 260 #define MNT_VNODE_FOREACH_ACTIVE_ABORT(mp, mvp) \ 261 __mnt_vnode_markerfree_active(&(mvp), (mp)) 262 263 #define MNT_ILOCK(mp) mtx_lock(&(mp)->mnt_mtx) 264 #define MNT_ITRYLOCK(mp) mtx_trylock(&(mp)->mnt_mtx) 265 #define MNT_IUNLOCK(mp) mtx_unlock(&(mp)->mnt_mtx) 266 #define MNT_MTX(mp) (&(mp)->mnt_mtx) 267 #define MNT_REF(mp) (mp)->mnt_ref++ 268 #define MNT_REL(mp) do { \ 269 KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \ 270 (mp)->mnt_ref--; \ 271 if ((mp)->mnt_ref == 0) \ 272 wakeup((mp)); \ 273 } while (0) 274 275 #endif /* _KERNEL */ 276 277 /* 278 * User specifiable flags, stored in mnt_flag. 279 */ 280 #define MNT_RDONLY 0x0000000000000001ULL /* read only filesystem */ 281 #define MNT_SYNCHRONOUS 0x0000000000000002ULL /* fs written synchronously */ 282 #define MNT_NOEXEC 0x0000000000000004ULL /* can't exec from filesystem */ 283 #define MNT_NOSUID 0x0000000000000008ULL /* don't honor setuid fs bits */ 284 #define MNT_NFS4ACLS 0x0000000000000010ULL /* enable NFS version 4 ACLs */ 285 #define MNT_UNION 0x0000000000000020ULL /* union with underlying fs */ 286 #define MNT_ASYNC 0x0000000000000040ULL /* fs written asynchronously */ 287 #define MNT_SUIDDIR 0x0000000000100000ULL /* special SUID dir handling */ 288 #define MNT_SOFTDEP 0x0000000000200000ULL /* using soft updates */ 289 #define MNT_NOSYMFOLLOW 0x0000000000400000ULL /* do not follow symlinks */ 290 #define MNT_GJOURNAL 0x0000000002000000ULL /* GEOM journal support enabled */ 291 #define MNT_MULTILABEL 0x0000000004000000ULL /* MAC support for objects */ 292 #define MNT_ACLS 0x0000000008000000ULL /* ACL support enabled */ 293 #define MNT_NOATIME 0x0000000010000000ULL /* dont update file access time */ 294 #define MNT_NOCLUSTERR 0x0000000040000000ULL /* disable cluster read */ 295 #define MNT_NOCLUSTERW 0x0000000080000000ULL /* disable cluster write */ 296 #define MNT_SUJ 0x0000000100000000ULL /* using journaled soft updates */ 297 #define MNT_AUTOMOUNTED 0x0000000200000000ULL /* mounted by automountd(8) */ 298 299 /* 300 * NFS export related mount flags. 301 */ 302 #define MNT_EXRDONLY 0x0000000000000080ULL /* exported read only */ 303 #define MNT_EXPORTED 0x0000000000000100ULL /* filesystem is exported */ 304 #define MNT_DEFEXPORTED 0x0000000000000200ULL /* exported to the world */ 305 #define MNT_EXPORTANON 0x0000000000000400ULL /* anon uid mapping for all */ 306 #define MNT_EXKERB 0x0000000000000800ULL /* exported with Kerberos */ 307 #define MNT_EXPUBLIC 0x0000000020000000ULL /* public export (WebNFS) */ 308 309 /* 310 * Flags set by internal operations, 311 * but visible to the user. 312 * XXX some of these are not quite right.. (I've never seen the root flag set) 313 */ 314 #define MNT_LOCAL 0x0000000000001000ULL /* filesystem is stored locally */ 315 #define MNT_QUOTA 0x0000000000002000ULL /* quotas are enabled on fs */ 316 #define MNT_ROOTFS 0x0000000000004000ULL /* identifies the root fs */ 317 #define MNT_USER 0x0000000000008000ULL /* mounted by a user */ 318 #define MNT_IGNORE 0x0000000000800000ULL /* do not show entry in df */ 319 #define MNT_VERIFIED 0x0000000400000000ULL /* filesystem is verified */ 320 321 /* 322 * Mask of flags that are visible to statfs(). 323 * XXX I think that this could now become (~(MNT_CMDFLAGS)) 324 * but the 'mount' program may need changing to handle this. 325 */ 326 #define MNT_VISFLAGMASK (MNT_RDONLY | MNT_SYNCHRONOUS | MNT_NOEXEC | \ 327 MNT_NOSUID | MNT_UNION | MNT_SUJ | \ 328 MNT_ASYNC | MNT_EXRDONLY | MNT_EXPORTED | \ 329 MNT_DEFEXPORTED | MNT_EXPORTANON| MNT_EXKERB | \ 330 MNT_LOCAL | MNT_USER | MNT_QUOTA | \ 331 MNT_ROOTFS | MNT_NOATIME | MNT_NOCLUSTERR| \ 332 MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \ 333 MNT_IGNORE | MNT_EXPUBLIC | MNT_NOSYMFOLLOW | \ 334 MNT_GJOURNAL | MNT_MULTILABEL | MNT_ACLS | \ 335 MNT_NFS4ACLS | MNT_AUTOMOUNTED | MNT_VERIFIED) 336 337 /* Mask of flags that can be updated. */ 338 #define MNT_UPDATEMASK (MNT_NOSUID | MNT_NOEXEC | \ 339 MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | \ 340 MNT_NOATIME | \ 341 MNT_NOSYMFOLLOW | MNT_IGNORE | \ 342 MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR | \ 343 MNT_ACLS | MNT_USER | MNT_NFS4ACLS | \ 344 MNT_AUTOMOUNTED) 345 346 /* 347 * External filesystem command modifier flags. 348 * Unmount can use the MNT_FORCE flag. 349 * XXX: These are not STATES and really should be somewhere else. 350 * XXX: MNT_BYFSID and MNT_NONBUSY collide with MNT_ACLS and MNT_MULTILABEL, 351 * but because MNT_ACLS and MNT_MULTILABEL are only used for mount(2), 352 * and MNT_BYFSID and MNT_NONBUSY are only used for unmount(2), 353 * it's harmless. 354 */ 355 #define MNT_UPDATE 0x0000000000010000ULL /* not real mount, just update */ 356 #define MNT_DELEXPORT 0x0000000000020000ULL /* delete export host lists */ 357 #define MNT_RELOAD 0x0000000000040000ULL /* reload filesystem data */ 358 #define MNT_FORCE 0x0000000000080000ULL /* force unmount or readonly */ 359 #define MNT_SNAPSHOT 0x0000000001000000ULL /* snapshot the filesystem */ 360 #define MNT_NONBUSY 0x0000000004000000ULL /* check vnode use counts. */ 361 #define MNT_BYFSID 0x0000000008000000ULL /* specify filesystem by ID. */ 362 #define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ 363 MNT_FORCE | MNT_SNAPSHOT | MNT_NONBUSY | \ 364 MNT_BYFSID) 365 /* 366 * Internal filesystem control flags stored in mnt_kern_flag. 367 * 368 * MNTK_UNMOUNT locks the mount entry so that name lookup cannot proceed 369 * past the mount point. This keeps the subtree stable during mounts 370 * and unmounts. 371 * 372 * MNTK_UNMOUNTF permits filesystems to detect a forced unmount while 373 * dounmount() is still waiting to lock the mountpoint. This allows 374 * the filesystem to cancel operations that might otherwise deadlock 375 * with the unmount attempt (used by NFS). 376 * 377 * MNTK_NOINSMNTQ is strict subset of MNTK_UNMOUNT. They are separated 378 * to allow for failed unmount attempt to restore the syncer vnode for 379 * the mount. 380 */ 381 #define MNTK_UNMOUNTF 0x00000001 /* forced unmount in progress */ 382 #define MNTK_ASYNC 0x00000002 /* filtered async flag */ 383 #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ 384 #define MNTK_NOINSMNTQ 0x00000008 /* insmntque is not allowed */ 385 #define MNTK_DRAINING 0x00000010 /* lock draining is happening */ 386 #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ 387 #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */ 388 #define MNTK_SHARED_WRITES 0x00000080 /* Allow shared locking for writes */ 389 #define MNTK_NO_IOPF 0x00000100 /* Disallow page faults during reads 390 and writes. Filesystem shall properly 391 handle i/o state on EFAULT. */ 392 #define MNTK_VGONE_UPPER 0x00000200 393 #define MNTK_VGONE_WAITER 0x00000400 394 #define MNTK_LOOKUP_EXCL_DOTDOT 0x00000800 395 #define MNTK_MARKER 0x00001000 396 #define MNTK_UNMAPPED_BUFS 0x00002000 397 #define MNTK_USES_BCACHE 0x00004000 /* FS uses the buffer cache. */ 398 #define MNTK_NOASYNC 0x00800000 /* disable async */ 399 #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ 400 #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ 401 #define MNTK_SUSPEND 0x08000000 /* request write suspension */ 402 #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ 403 #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ 404 #define MNTK_NULL_NOCACHE 0x20000000 /* auto disable cache for nullfs 405 mounts over this fs */ 406 #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ 407 #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ 408 409 #ifdef _KERNEL 410 static inline int 411 MNT_SHARED_WRITES(struct mount *mp) 412 { 413 414 return (mp != NULL && (mp->mnt_kern_flag & MNTK_SHARED_WRITES) != 0); 415 } 416 417 static inline int 418 MNT_EXTENDED_SHARED(struct mount *mp) 419 { 420 421 return (mp != NULL && (mp->mnt_kern_flag & MNTK_EXTENDED_SHARED) != 0); 422 } 423 #endif 424 425 /* 426 * Sysctl CTL_VFS definitions. 427 * 428 * Second level identifier specifies which filesystem. Second level 429 * identifier VFS_VFSCONF returns information about all filesystems. 430 * Second level identifier VFS_GENERIC is non-terminal. 431 */ 432 #define VFS_VFSCONF 0 /* get configured filesystems */ 433 #define VFS_GENERIC 0 /* generic filesystem information */ 434 /* 435 * Third level identifiers for VFS_GENERIC are given below; third 436 * level identifiers for specific filesystems are given in their 437 * mount specific header files. 438 */ 439 #define VFS_MAXTYPENUM 1 /* int: highest defined filesystem type */ 440 #define VFS_CONF 2 /* struct: vfsconf for filesystem given 441 as next argument */ 442 443 /* 444 * Flags for various system call interfaces. 445 * 446 * waitfor flags to vfs_sync() and getfsstat() 447 */ 448 #define MNT_WAIT 1 /* synchronously wait for I/O to complete */ 449 #define MNT_NOWAIT 2 /* start all I/O, but do not wait for it */ 450 #define MNT_LAZY 3 /* push data not written by filesystem syncer */ 451 #define MNT_SUSPEND 4 /* Suspend file system after sync */ 452 453 /* 454 * Generic file handle 455 */ 456 struct fhandle { 457 fsid_t fh_fsid; /* Filesystem id of mount point */ 458 struct fid fh_fid; /* Filesys specific id */ 459 }; 460 typedef struct fhandle fhandle_t; 461 462 /* 463 * Old export arguments without security flavor list 464 */ 465 struct oexport_args { 466 int ex_flags; /* export related flags */ 467 uid_t ex_root; /* mapping for root uid */ 468 struct xucred ex_anon; /* mapping for anonymous user */ 469 struct sockaddr *ex_addr; /* net address to which exported */ 470 u_char ex_addrlen; /* and the net address length */ 471 struct sockaddr *ex_mask; /* mask of valid bits in saddr */ 472 u_char ex_masklen; /* and the smask length */ 473 char *ex_indexfile; /* index file for WebNFS URLs */ 474 }; 475 476 /* 477 * Export arguments for local filesystem mount calls. 478 */ 479 #define MAXSECFLAVORS 5 480 struct export_args { 481 int ex_flags; /* export related flags */ 482 uid_t ex_root; /* mapping for root uid */ 483 struct xucred ex_anon; /* mapping for anonymous user */ 484 struct sockaddr *ex_addr; /* net address to which exported */ 485 u_char ex_addrlen; /* and the net address length */ 486 struct sockaddr *ex_mask; /* mask of valid bits in saddr */ 487 u_char ex_masklen; /* and the smask length */ 488 char *ex_indexfile; /* index file for WebNFS URLs */ 489 int ex_numsecflavors; /* security flavor count */ 490 int ex_secflavors[MAXSECFLAVORS]; /* list of security flavors */ 491 }; 492 493 /* 494 * Structure holding information for a publicly exported filesystem 495 * (WebNFS). Currently the specs allow just for one such filesystem. 496 */ 497 struct nfs_public { 498 int np_valid; /* Do we hold valid information */ 499 fhandle_t np_handle; /* Filehandle for pub fs (internal) */ 500 struct mount *np_mount; /* Mountpoint of exported fs */ 501 char *np_index; /* Index file */ 502 }; 503 504 /* 505 * Filesystem configuration information. One of these exists for each 506 * type of filesystem supported by the kernel. These are searched at 507 * mount time to identify the requested filesystem. 508 * 509 * XXX: Never change the first two arguments! 510 */ 511 struct vfsconf { 512 u_int vfc_version; /* ABI version number */ 513 char vfc_name[MFSNAMELEN]; /* filesystem type name */ 514 struct vfsops *vfc_vfsops; /* filesystem operations vector */ 515 int vfc_typenum; /* historic filesystem type number */ 516 int vfc_refcount; /* number mounted of this type */ 517 int vfc_flags; /* permanent flags */ 518 struct vfsoptdecl *vfc_opts; /* mount options */ 519 TAILQ_ENTRY(vfsconf) vfc_list; /* list of vfscons */ 520 }; 521 522 /* Userland version of the struct vfsconf. */ 523 struct xvfsconf { 524 struct vfsops *vfc_vfsops; /* filesystem operations vector */ 525 char vfc_name[MFSNAMELEN]; /* filesystem type name */ 526 int vfc_typenum; /* historic filesystem type number */ 527 int vfc_refcount; /* number mounted of this type */ 528 int vfc_flags; /* permanent flags */ 529 struct vfsconf *vfc_next; /* next in list */ 530 }; 531 532 #ifndef BURN_BRIDGES 533 struct ovfsconf { 534 void *vfc_vfsops; 535 char vfc_name[32]; 536 int vfc_index; 537 int vfc_refcount; 538 int vfc_flags; 539 }; 540 #endif 541 542 /* 543 * NB: these flags refer to IMPLEMENTATION properties, not properties of 544 * any actual mounts; i.e., it does not make sense to change the flags. 545 */ 546 #define VFCF_STATIC 0x00010000 /* statically compiled into kernel */ 547 #define VFCF_NETWORK 0x00020000 /* may get data over the network */ 548 #define VFCF_READONLY 0x00040000 /* writes are not implemented */ 549 #define VFCF_SYNTHETIC 0x00080000 /* data does not represent real files */ 550 #define VFCF_LOOPBACK 0x00100000 /* aliases some other mounted FS */ 551 #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ 552 #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ 553 #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ 554 #define VFCF_SBDRY 0x01000000 /* defer stop requests */ 555 556 typedef uint32_t fsctlop_t; 557 558 struct vfsidctl { 559 int vc_vers; /* should be VFSIDCTL_VERS1 (below) */ 560 fsid_t vc_fsid; /* fsid to operate on */ 561 char vc_fstypename[MFSNAMELEN]; 562 /* type of fs 'nfs' or '*' */ 563 fsctlop_t vc_op; /* operation VFS_CTL_* (below) */ 564 void *vc_ptr; /* pointer to data structure */ 565 size_t vc_len; /* sizeof said structure */ 566 u_int32_t vc_spare[12]; /* spare (must be zero) */ 567 }; 568 569 /* vfsidctl API version. */ 570 #define VFS_CTL_VERS1 0x01 571 572 /* 573 * New style VFS sysctls, do not reuse/conflict with the namespace for 574 * private sysctls. 575 * All "global" sysctl ops have the 33rd bit set: 576 * 0x...1.... 577 * Private sysctl ops should have the 33rd bit unset. 578 */ 579 #define VFS_CTL_QUERY 0x00010001 /* anything wrong? (vfsquery) */ 580 #define VFS_CTL_TIMEO 0x00010002 /* set timeout for vfs notification */ 581 #define VFS_CTL_NOLOCKS 0x00010003 /* disable file locking */ 582 583 struct vfsquery { 584 u_int32_t vq_flags; 585 u_int32_t vq_spare[31]; 586 }; 587 588 /* vfsquery flags */ 589 #define VQ_NOTRESP 0x0001 /* server down */ 590 #define VQ_NEEDAUTH 0x0002 /* server bad auth */ 591 #define VQ_LOWDISK 0x0004 /* we're low on space */ 592 #define VQ_MOUNT 0x0008 /* new filesystem arrived */ 593 #define VQ_UNMOUNT 0x0010 /* filesystem has left */ 594 #define VQ_DEAD 0x0020 /* filesystem is dead, needs force unmount */ 595 #define VQ_ASSIST 0x0040 /* filesystem needs assistance from external 596 program */ 597 #define VQ_NOTRESPLOCK 0x0080 /* server lockd down */ 598 #define VQ_FLAG0100 0x0100 /* placeholder */ 599 #define VQ_FLAG0200 0x0200 /* placeholder */ 600 #define VQ_FLAG0400 0x0400 /* placeholder */ 601 #define VQ_FLAG0800 0x0800 /* placeholder */ 602 #define VQ_FLAG1000 0x1000 /* placeholder */ 603 #define VQ_FLAG2000 0x2000 /* placeholder */ 604 #define VQ_FLAG4000 0x4000 /* placeholder */ 605 #define VQ_FLAG8000 0x8000 /* placeholder */ 606 607 #ifdef _KERNEL 608 /* Point a sysctl request at a vfsidctl's data. */ 609 #define VCTLTOREQ(vc, req) \ 610 do { \ 611 (req)->newptr = (vc)->vc_ptr; \ 612 (req)->newlen = (vc)->vc_len; \ 613 (req)->newidx = 0; \ 614 } while (0) 615 #endif 616 617 struct iovec; 618 struct uio; 619 620 #ifdef _KERNEL 621 622 /* 623 * vfs_busy specific flags and mask. 624 */ 625 #define MBF_NOWAIT 0x01 626 #define MBF_MNTLSTLOCK 0x02 627 #define MBF_MASK (MBF_NOWAIT | MBF_MNTLSTLOCK) 628 629 #ifdef MALLOC_DECLARE 630 MALLOC_DECLARE(M_MOUNT); 631 MALLOC_DECLARE(M_STATFS); 632 #endif 633 extern int maxvfsconf; /* highest defined filesystem type */ 634 635 TAILQ_HEAD(vfsconfhead, vfsconf); 636 extern struct vfsconfhead vfsconf; 637 638 /* 639 * Operations supported on mounted filesystem. 640 */ 641 struct mount_args; 642 struct nameidata; 643 struct sysctl_req; 644 struct mntarg; 645 646 typedef int vfs_cmount_t(struct mntarg *ma, void *data, uint64_t flags); 647 typedef int vfs_unmount_t(struct mount *mp, int mntflags); 648 typedef int vfs_root_t(struct mount *mp, int flags, struct vnode **vpp); 649 typedef int vfs_quotactl_t(struct mount *mp, int cmds, uid_t uid, void *arg); 650 typedef int vfs_statfs_t(struct mount *mp, struct statfs *sbp); 651 typedef int vfs_sync_t(struct mount *mp, int waitfor); 652 typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags, 653 struct vnode **vpp); 654 typedef int vfs_fhtovp_t(struct mount *mp, struct fid *fhp, 655 int flags, struct vnode **vpp); 656 typedef int vfs_checkexp_t(struct mount *mp, struct sockaddr *nam, 657 int *extflagsp, struct ucred **credanonp, 658 int *numsecflavors, int **secflavors); 659 typedef int vfs_init_t(struct vfsconf *); 660 typedef int vfs_uninit_t(struct vfsconf *); 661 typedef int vfs_extattrctl_t(struct mount *mp, int cmd, 662 struct vnode *filename_vp, int attrnamespace, 663 const char *attrname); 664 typedef int vfs_mount_t(struct mount *mp); 665 typedef int vfs_sysctl_t(struct mount *mp, fsctlop_t op, 666 struct sysctl_req *req); 667 typedef void vfs_susp_clean_t(struct mount *mp); 668 typedef void vfs_notify_lowervp_t(struct mount *mp, struct vnode *lowervp); 669 typedef void vfs_purge_t(struct mount *mp); 670 671 struct vfsops { 672 vfs_mount_t *vfs_mount; 673 vfs_cmount_t *vfs_cmount; 674 vfs_unmount_t *vfs_unmount; 675 vfs_root_t *vfs_root; 676 vfs_quotactl_t *vfs_quotactl; 677 vfs_statfs_t *vfs_statfs; 678 vfs_sync_t *vfs_sync; 679 vfs_vget_t *vfs_vget; 680 vfs_fhtovp_t *vfs_fhtovp; 681 vfs_checkexp_t *vfs_checkexp; 682 vfs_init_t *vfs_init; 683 vfs_uninit_t *vfs_uninit; 684 vfs_extattrctl_t *vfs_extattrctl; 685 vfs_sysctl_t *vfs_sysctl; 686 vfs_susp_clean_t *vfs_susp_clean; 687 vfs_notify_lowervp_t *vfs_reclaim_lowervp; 688 vfs_notify_lowervp_t *vfs_unlink_lowervp; 689 vfs_purge_t *vfs_purge; 690 vfs_mount_t *vfs_spare[6]; /* spares for ABI compat */ 691 }; 692 693 vfs_statfs_t __vfs_statfs; 694 695 #define VFS_PROLOGUE(MP) do { \ 696 struct mount *mp__; \ 697 int _prev_stops; \ 698 \ 699 mp__ = (MP); \ 700 _prev_stops = sigdeferstop((mp__ != NULL && \ 701 (mp__->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0) ? \ 702 SIGDEFERSTOP_SILENT : SIGDEFERSTOP_NOP); 703 704 #define VFS_EPILOGUE(MP) \ 705 sigallowstop(_prev_stops); \ 706 } while (0) 707 708 #define VFS_MOUNT(MP) ({ \ 709 int _rc; \ 710 \ 711 VFS_PROLOGUE(MP); \ 712 _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ 713 VFS_EPILOGUE(MP); \ 714 _rc; }) 715 716 #define VFS_UNMOUNT(MP, FORCE) ({ \ 717 int _rc; \ 718 \ 719 VFS_PROLOGUE(MP); \ 720 _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ 721 VFS_EPILOGUE(MP); \ 722 _rc; }) 723 724 #define VFS_ROOT(MP, FLAGS, VPP) ({ \ 725 int _rc; \ 726 \ 727 VFS_PROLOGUE(MP); \ 728 _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ 729 VFS_EPILOGUE(MP); \ 730 _rc; }) 731 732 #define VFS_QUOTACTL(MP, C, U, A) ({ \ 733 int _rc; \ 734 \ 735 VFS_PROLOGUE(MP); \ 736 _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ 737 VFS_EPILOGUE(MP); \ 738 _rc; }) 739 740 #define VFS_STATFS(MP, SBP) ({ \ 741 int _rc; \ 742 \ 743 VFS_PROLOGUE(MP); \ 744 _rc = __vfs_statfs((MP), (SBP)); \ 745 VFS_EPILOGUE(MP); \ 746 _rc; }) 747 748 #define VFS_SYNC(MP, WAIT) ({ \ 749 int _rc; \ 750 \ 751 VFS_PROLOGUE(MP); \ 752 _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ 753 VFS_EPILOGUE(MP); \ 754 _rc; }) 755 756 #define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ 757 int _rc; \ 758 \ 759 VFS_PROLOGUE(MP); \ 760 _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ 761 VFS_EPILOGUE(MP); \ 762 _rc; }) 763 764 #define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) ({ \ 765 int _rc; \ 766 \ 767 VFS_PROLOGUE(MP); \ 768 _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP); \ 769 VFS_EPILOGUE(MP); \ 770 _rc; }) 771 772 #define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ 773 int _rc; \ 774 \ 775 VFS_PROLOGUE(MP); \ 776 _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ 777 SEC); \ 778 VFS_EPILOGUE(MP); \ 779 _rc; }) 780 781 #define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ 782 int _rc; \ 783 \ 784 VFS_PROLOGUE(MP); \ 785 _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ 786 VFS_EPILOGUE(MP); \ 787 _rc; }) 788 789 #define VFS_SYSCTL(MP, OP, REQ) ({ \ 790 int _rc; \ 791 \ 792 VFS_PROLOGUE(MP); \ 793 _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ 794 VFS_EPILOGUE(MP); \ 795 _rc; }) 796 797 #define VFS_SUSP_CLEAN(MP) do { \ 798 if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ 799 VFS_PROLOGUE(MP); \ 800 (*(MP)->mnt_op->vfs_susp_clean)(MP); \ 801 VFS_EPILOGUE(MP); \ 802 } \ 803 } while (0) 804 805 #define VFS_RECLAIM_LOWERVP(MP, VP) do { \ 806 if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ 807 VFS_PROLOGUE(MP); \ 808 (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ 809 VFS_EPILOGUE(MP); \ 810 } \ 811 } while (0) 812 813 #define VFS_UNLINK_LOWERVP(MP, VP) do { \ 814 if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \ 815 VFS_PROLOGUE(MP); \ 816 (*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \ 817 VFS_EPILOGUE(MP); \ 818 } \ 819 } while (0) 820 821 #define VFS_PURGE(MP) do { \ 822 if (*(MP)->mnt_op->vfs_purge != NULL) { \ 823 VFS_PROLOGUE(MP); \ 824 (*(MP)->mnt_op->vfs_purge)(MP); \ 825 VFS_EPILOGUE(MP); \ 826 } \ 827 } while (0) 828 829 #define VFS_KNOTE_LOCKED(vp, hint) do \ 830 { \ 831 if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ 832 VN_KNOTE((vp), (hint), KNF_LISTLOCKED); \ 833 } while (0) 834 835 #define VFS_KNOTE_UNLOCKED(vp, hint) do \ 836 { \ 837 if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ 838 VN_KNOTE((vp), (hint), 0); \ 839 } while (0) 840 841 #define VFS_NOTIFY_UPPER_RECLAIM 1 842 #define VFS_NOTIFY_UPPER_UNLINK 2 843 844 #include <sys/module.h> 845 846 /* 847 * Version numbers. 848 */ 849 #define VFS_VERSION_00 0x19660120 850 #define VFS_VERSION_01 0x20121030 851 #define VFS_VERSION VFS_VERSION_01 852 853 #define VFS_SET(vfsops, fsname, flags) \ 854 static struct vfsconf fsname ## _vfsconf = { \ 855 .vfc_version = VFS_VERSION, \ 856 .vfc_name = #fsname, \ 857 .vfc_vfsops = &vfsops, \ 858 .vfc_typenum = -1, \ 859 .vfc_flags = flags, \ 860 }; \ 861 static moduledata_t fsname ## _mod = { \ 862 #fsname, \ 863 vfs_modevent, \ 864 & fsname ## _vfsconf \ 865 }; \ 866 DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE) 867 868 /* 869 * exported vnode operations 870 */ 871 872 int dounmount(struct mount *, int, struct thread *); 873 874 int kernel_mount(struct mntarg *ma, uint64_t flags); 875 int kernel_vmount(int flags, ...); 876 struct mntarg *mount_arg(struct mntarg *ma, const char *name, const void *val, int len); 877 struct mntarg *mount_argb(struct mntarg *ma, int flag, const char *name); 878 struct mntarg *mount_argf(struct mntarg *ma, const char *name, const char *fmt, ...); 879 struct mntarg *mount_argsu(struct mntarg *ma, const char *name, const void *val, int len); 880 void statfs_scale_blocks(struct statfs *sf, long max_size); 881 struct vfsconf *vfs_byname(const char *); 882 struct vfsconf *vfs_byname_kld(const char *, struct thread *td, int *); 883 void vfs_mount_destroy(struct mount *); 884 void vfs_event_signal(fsid_t *, u_int32_t, intptr_t); 885 void vfs_freeopts(struct vfsoptlist *opts); 886 void vfs_deleteopt(struct vfsoptlist *opts, const char *name); 887 int vfs_buildopts(struct uio *auio, struct vfsoptlist **options); 888 int vfs_flagopt(struct vfsoptlist *opts, const char *name, uint64_t *w, 889 uint64_t val); 890 int vfs_getopt(struct vfsoptlist *, const char *, void **, int *); 891 int vfs_getopt_pos(struct vfsoptlist *opts, const char *name); 892 int vfs_getopt_size(struct vfsoptlist *opts, const char *name, 893 off_t *value); 894 char *vfs_getopts(struct vfsoptlist *, const char *, int *error); 895 int vfs_copyopt(struct vfsoptlist *, const char *, void *, int); 896 int vfs_filteropt(struct vfsoptlist *, const char **legal); 897 void vfs_opterror(struct vfsoptlist *opts, const char *fmt, ...); 898 int vfs_scanopt(struct vfsoptlist *opts, const char *name, const char *fmt, ...); 899 int vfs_setopt(struct vfsoptlist *opts, const char *name, void *value, 900 int len); 901 int vfs_setopt_part(struct vfsoptlist *opts, const char *name, void *value, 902 int len); 903 int vfs_setopts(struct vfsoptlist *opts, const char *name, 904 const char *value); 905 int vfs_setpublicfs /* set publicly exported fs */ 906 (struct mount *, struct netexport *, struct export_args *); 907 void vfs_msync(struct mount *, int); 908 int vfs_busy(struct mount *, int); 909 int vfs_export /* process mount export info */ 910 (struct mount *, struct export_args *); 911 void vfs_allocate_syncvnode(struct mount *); 912 void vfs_deallocate_syncvnode(struct mount *); 913 int vfs_donmount(struct thread *td, uint64_t fsflags, 914 struct uio *fsoptions); 915 void vfs_getnewfsid(struct mount *); 916 struct cdev *vfs_getrootfsid(struct mount *); 917 struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */ 918 struct mount *vfs_busyfs(fsid_t *); 919 int vfs_modevent(module_t, int, void *); 920 void vfs_mount_error(struct mount *, const char *, ...); 921 void vfs_mountroot(void); /* mount our root filesystem */ 922 void vfs_mountedfrom(struct mount *, const char *from); 923 void vfs_notify_upper(struct vnode *, int); 924 void vfs_oexport_conv(const struct oexport_args *oexp, 925 struct export_args *exp); 926 void vfs_ref(struct mount *); 927 void vfs_rel(struct mount *); 928 struct mount *vfs_mount_alloc(struct vnode *, struct vfsconf *, const char *, 929 struct ucred *); 930 int vfs_suser(struct mount *, struct thread *); 931 void vfs_unbusy(struct mount *); 932 void vfs_unmountall(void); 933 extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ 934 extern struct mtx mountlist_mtx; 935 extern struct nfs_public nfs_pub; 936 extern struct sx vfsconf_sx; 937 #define vfsconf_lock() sx_xlock(&vfsconf_sx) 938 #define vfsconf_unlock() sx_xunlock(&vfsconf_sx) 939 #define vfsconf_slock() sx_slock(&vfsconf_sx) 940 #define vfsconf_sunlock() sx_sunlock(&vfsconf_sx) 941 942 /* 943 * Declarations for these vfs default operations are located in 944 * kern/vfs_default.c. They will be automatically used to replace 945 * null entries in VFS ops tables when registering a new filesystem 946 * type in the global table. 947 */ 948 vfs_root_t vfs_stdroot; 949 vfs_quotactl_t vfs_stdquotactl; 950 vfs_statfs_t vfs_stdstatfs; 951 vfs_sync_t vfs_stdsync; 952 vfs_sync_t vfs_stdnosync; 953 vfs_vget_t vfs_stdvget; 954 vfs_fhtovp_t vfs_stdfhtovp; 955 vfs_checkexp_t vfs_stdcheckexp; 956 vfs_init_t vfs_stdinit; 957 vfs_uninit_t vfs_stduninit; 958 vfs_extattrctl_t vfs_stdextattrctl; 959 vfs_sysctl_t vfs_stdsysctl; 960 961 void syncer_suspend(void); 962 void syncer_resume(void); 963 964 #else /* !_KERNEL */ 965 966 #include <sys/cdefs.h> 967 968 struct stat; 969 970 __BEGIN_DECLS 971 int fhopen(const struct fhandle *, int); 972 int fhstat(const struct fhandle *, struct stat *); 973 int fhstatfs(const struct fhandle *, struct statfs *); 974 int fstatfs(int, struct statfs *); 975 int getfh(const char *, fhandle_t *); 976 int getfsstat(struct statfs *, long, int); 977 int getmntinfo(struct statfs **, int); 978 int lgetfh(const char *, fhandle_t *); 979 int mount(const char *, const char *, int, void *); 980 int nmount(struct iovec *, unsigned int, int); 981 int statfs(const char *, struct statfs *); 982 int unmount(const char *, int); 983 984 /* C library stuff */ 985 int getvfsbyname(const char *, struct xvfsconf *); 986 __END_DECLS 987 988 #endif /* _KERNEL */ 989 990 #endif /* !_SYS_MOUNT_H_ */ 991