1 /* $NetBSD: mount.h,v 1.210 2013/11/23 13:35:36 christos 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_MOUNT_H_ 35 #define _SYS_MOUNT_H_ 36 37 #ifndef _KERNEL 38 #include <sys/featuretest.h> 39 #if defined(_NETBSD_SOURCE) 40 #include <sys/stat.h> 41 #endif /* _NETBSD_SOURCE */ 42 #endif 43 44 #ifndef _STANDALONE 45 #include <sys/param.h> /* precautionary upon removal from ucred.h */ 46 #include <sys/time.h> 47 #include <sys/uio.h> 48 #include <sys/ucred.h> 49 #include <sys/fstypes.h> 50 #include <sys/queue.h> 51 #include <sys/rwlock.h> 52 #include <sys/statvfs.h> 53 #include <sys/specificdata.h> 54 #include <sys/condvar.h> 55 #endif /* !_STANDALONE */ 56 57 /* 58 * file system statistics 59 */ 60 61 #define MNAMELEN 90 /* length of buffer for returned name */ 62 63 /* 64 * File system types. 65 */ 66 #define MOUNT_FFS "ffs" /* UNIX "Fast" Filesystem */ 67 #define MOUNT_UFS MOUNT_FFS /* for compatibility */ 68 #define MOUNT_NFS "nfs" /* Network Filesystem */ 69 #define MOUNT_MFS "mfs" /* Memory Filesystem */ 70 #define MOUNT_MSDOS "msdos" /* MSDOS Filesystem */ 71 #define MOUNT_LFS "lfs" /* Log-based Filesystem */ 72 #define MOUNT_FDESC "fdesc" /* File Descriptor Filesystem */ 73 #define MOUNT_NULL "null" /* Minimal Filesystem Layer */ 74 #define MOUNT_OVERLAY "overlay" /* Minimal Overlay Filesystem Layer */ 75 #define MOUNT_UMAP "umap" /* User/Group Identifier Remapping Filesystem */ 76 #define MOUNT_KERNFS "kernfs" /* Kernel Information Filesystem */ 77 #define MOUNT_PROCFS "procfs" /* /proc Filesystem */ 78 #define MOUNT_AFS "afs" /* Andrew Filesystem */ 79 #define MOUNT_CD9660 "cd9660" /* ISO9660 (aka CDROM) Filesystem */ 80 #define MOUNT_UNION "union" /* Union (translucent) Filesystem */ 81 #define MOUNT_ADOSFS "adosfs" /* AmigaDOS Filesystem */ 82 #define MOUNT_EXT2FS "ext2fs" /* Second Extended Filesystem */ 83 #define MOUNT_CFS "coda" /* Coda Filesystem */ 84 #define MOUNT_CODA MOUNT_CFS /* Coda Filesystem */ 85 #define MOUNT_FILECORE "filecore" /* Acorn Filecore Filesystem */ 86 #define MOUNT_NTFS "ntfs" /* Windows/NT Filesystem */ 87 #define MOUNT_SMBFS "smbfs" /* CIFS (SMB) */ 88 #define MOUNT_PTYFS "ptyfs" /* Pseudo tty filesystem */ 89 #define MOUNT_TMPFS "tmpfs" /* Efficient memory file-system */ 90 #define MOUNT_UDF "udf" /* UDF CD/DVD filesystem */ 91 #define MOUNT_SYSVBFS "sysvbfs" /* System V Boot Filesystem */ 92 #define MOUNT_PUFFS "puffs" /* Pass-to-Userspace filesystem */ 93 #define MOUNT_HFS "hfs" /* Apple HFS+ Filesystem */ 94 #define MOUNT_EFS "efs" /* SGI's Extent Filesystem */ 95 #define MOUNT_ZFS "zfs" /* Sun ZFS */ 96 #define MOUNT_NILFS "nilfs" /* NTT's NiLFS(2) logging file system */ 97 #define MOUNT_RUMPFS "rumpfs" /* rump virtual file system */ 98 #define MOUNT_V7FS "v7fs" /* 7th Edition of Unix Filesystem */ 99 100 #ifndef _STANDALONE 101 102 struct vnode; 103 104 /* 105 * Structure per mounted file system. Each mounted file system has an 106 * array of operations and an instance record. The file systems are 107 * put on a doubly linked list. 108 */ 109 struct mount { 110 TAILQ_ENTRY(mount) mnt_list; /* mount list */ 111 TAILQ_HEAD(, vnode) mnt_vnodelist; /* list of vnodes this mount */ 112 struct vfsops *mnt_op; /* operations on fs */ 113 struct vnode *mnt_vnodecovered; /* vnode we mounted on */ 114 struct vnode *mnt_syncer; /* syncer vnode */ 115 void *mnt_transinfo; /* for FS-internal use */ 116 void *mnt_data; /* private data */ 117 kmutex_t mnt_unmounting; /* to prevent new activity */ 118 kmutex_t mnt_renamelock; /* per-fs rename lock */ 119 int mnt_refcnt; /* ref count on this structure */ 120 unsigned int mnt_busynest; /* vfs_busy nestings */ 121 int mnt_flag; /* flags */ 122 int mnt_iflag; /* internal flags */ 123 int mnt_fs_bshift; /* offset shift for lblkno */ 124 int mnt_dev_bshift; /* shift for device sectors */ 125 struct statvfs mnt_stat; /* cache of filesystem stats */ 126 specificdata_reference 127 mnt_specdataref; /* subsystem specific data */ 128 kmutex_t mnt_updating; /* to serialize updates */ 129 struct wapbl_ops 130 *mnt_wapbl_op; /* logging ops */ 131 struct wapbl *mnt_wapbl; /* log info */ 132 struct wapbl_replay 133 *mnt_wapbl_replay; /* replay support XXX: what? */ 134 uint64_t mnt_gen; 135 }; 136 137 /* 138 * Sysctl CTL_VFS definitions. 139 * 140 * Second level identifier specifies which filesystem. Second level 141 * identifier VFS_GENERIC returns information about all filesystems. 142 * 143 * Note the slightly non-flat nature of these sysctl numbers. Oh for 144 * a better sysctl interface. 145 */ 146 #define VFS_GENERIC 0 /* generic filesystem information */ 147 #define VFS_MAXTYPENUM 1 /* int: highest defined fs type */ 148 #define VFS_CONF 2 /* struct: vfsconf for filesystem given 149 as next argument */ 150 #define VFS_USERMOUNT 3 /* enable/disable fs mnt by non-root */ 151 #define VFS_MAGICLINKS 4 /* expand 'magic' symlinks */ 152 #define VFSGEN_MAXID 5 /* number of valid vfs.generic ids */ 153 154 /* 155 * USE THE SAME NAMES AS MOUNT_*! 156 * 157 * Only need to add new entry here if the filesystem actually supports 158 * sysctl(2). 159 */ 160 #define CTL_VFS_NAMES { \ 161 { "generic", CTLTYPE_NODE }, \ 162 { MOUNT_FFS, CTLTYPE_NODE }, \ 163 { MOUNT_NFS, CTLTYPE_NODE }, \ 164 { MOUNT_MFS, CTLTYPE_NODE }, \ 165 { MOUNT_MSDOS, CTLTYPE_NODE }, \ 166 { MOUNT_LFS, CTLTYPE_NODE }, \ 167 { 0, 0 }, /* MOUNT_LOFS */ \ 168 { MOUNT_FDESC, CTLTYPE_NODE }, \ 169 { MOUNT_NULL, CTLTYPE_NODE }, \ 170 { MOUNT_UMAP, CTLTYPE_NODE }, \ 171 { MOUNT_KERNFS, CTLTYPE_NODE }, \ 172 { MOUNT_PROCFS, CTLTYPE_NODE }, \ 173 { MOUNT_AFS, CTLTYPE_NODE }, \ 174 { MOUNT_CD9660, CTLTYPE_NODE }, \ 175 { MOUNT_UNION, CTLTYPE_NODE }, \ 176 { MOUNT_ADOSFS, CTLTYPE_NODE }, \ 177 { MOUNT_EXT2FS, CTLTYPE_NODE }, \ 178 { MOUNT_CODA, CTLTYPE_NODE }, \ 179 { MOUNT_FILECORE, CTLTYPE_NODE }, \ 180 { MOUNT_NTFS, CTLTYPE_NODE }, \ 181 } 182 183 #define VFS_MAXID 20 /* number of valid vfs ids */ 184 185 #define CTL_VFSGENCTL_NAMES { \ 186 { 0, 0 }, \ 187 { "maxtypenum", CTLTYPE_INT }, \ 188 { "conf", CTLTYPE_NODE }, /* Special */ \ 189 { "usermount", CTLTYPE_INT }, \ 190 { "magiclinks", CTLTYPE_INT }, \ 191 } 192 193 #if defined(_KERNEL) 194 195 struct quotactl_args; /* in sys/quotactl.h */ 196 struct quotastat; /* in sys/quotactl.h */ 197 struct quotaidtypestat; /* in sys/quotactl.h */ 198 struct quotaobjtypestat; /* in sys/quotactl.h */ 199 struct quotakcursor; /* in sys/quotactl.h */ 200 struct quotakey; /* in sys/quota.h */ 201 struct quotaval; /* in sys/quota.h */ 202 203 #if __STDC__ 204 struct nameidata; 205 #endif 206 207 /* 208 * Operations supported on mounted file system. 209 */ 210 211 struct vfsops { 212 const char *vfs_name; 213 size_t vfs_min_mount_data; 214 int (*vfs_mount) (struct mount *, const char *, void *, 215 size_t *); 216 int (*vfs_start) (struct mount *, int); 217 int (*vfs_unmount) (struct mount *, int); 218 int (*vfs_root) (struct mount *, struct vnode **); 219 int (*vfs_quotactl) (struct mount *, struct quotactl_args *); 220 int (*vfs_statvfs) (struct mount *, struct statvfs *); 221 int (*vfs_sync) (struct mount *, int, struct kauth_cred *); 222 int (*vfs_vget) (struct mount *, ino_t, struct vnode **); 223 int (*vfs_fhtovp) (struct mount *, struct fid *, 224 struct vnode **); 225 int (*vfs_vptofh) (struct vnode *, struct fid *, size_t *); 226 void (*vfs_init) (void); 227 void (*vfs_reinit) (void); 228 void (*vfs_done) (void); 229 int (*vfs_mountroot)(void); 230 int (*vfs_snapshot) (struct mount *, struct vnode *, 231 struct timespec *); 232 int (*vfs_extattrctl) (struct mount *, int, 233 struct vnode *, int, const char *); 234 int (*vfs_suspendctl) (struct mount *, int); 235 int (*vfs_renamelock_enter)(struct mount *); 236 void (*vfs_renamelock_exit)(struct mount *); 237 int (*vfs_fsync) (struct vnode *, int); 238 const struct vnodeopv_desc * const *vfs_opv_descs; 239 int vfs_refcount; 240 LIST_ENTRY(vfsops) vfs_list; 241 }; 242 243 /* XXX vget is actually file system internal. */ 244 #define VFS_VGET(MP, INO, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, VPP) 245 246 #define VFS_RENAMELOCK_ENTER(MP) (*(MP)->mnt_op->vfs_renamelock_enter)(MP) 247 #define VFS_RENAMELOCK_EXIT(MP) (*(MP)->mnt_op->vfs_renamelock_exit)(MP) 248 #define VFS_FSYNC(MP, VP, FLG) (*(MP)->mnt_op->vfs_fsync)(VP, FLG) 249 250 int VFS_MOUNT(struct mount *, const char *, void *, size_t *); 251 int VFS_START(struct mount *, int); 252 int VFS_UNMOUNT(struct mount *, int); 253 int VFS_ROOT(struct mount *, struct vnode **); 254 int VFS_QUOTACTL(struct mount *, struct quotactl_args *); 255 int VFS_STATVFS(struct mount *, struct statvfs *); 256 int VFS_SYNC(struct mount *, int, struct kauth_cred *); 257 int VFS_FHTOVP(struct mount *, struct fid *, struct vnode **); 258 int VFS_VPTOFH(struct vnode *, struct fid *, size_t *); 259 int VFS_SNAPSHOT(struct mount *, struct vnode *, struct timespec *); 260 int VFS_EXTATTRCTL(struct mount *, int, struct vnode *, int, const char *); 261 int VFS_SUSPENDCTL(struct mount *, int); 262 263 #endif /* _KERNEL */ 264 265 #ifdef _KERNEL 266 #if __STDC__ 267 struct mbuf; 268 struct vnodeopv_desc; 269 struct kauth_cred; 270 #endif 271 272 #define VFS_MAX_MOUNT_DATA 8192 273 274 #define VFS_PROTOS(fsname) \ 275 int fsname##_mount(struct mount *, const char *, void *, \ 276 size_t *); \ 277 int fsname##_start(struct mount *, int); \ 278 int fsname##_unmount(struct mount *, int); \ 279 int fsname##_root(struct mount *, struct vnode **); \ 280 int fsname##_quotactl(struct mount *, struct quotactl_args *); \ 281 int fsname##_statvfs(struct mount *, struct statvfs *); \ 282 int fsname##_sync(struct mount *, int, struct kauth_cred *); \ 283 int fsname##_vget(struct mount *, ino_t, struct vnode **); \ 284 int fsname##_fhtovp(struct mount *, struct fid *, struct vnode **); \ 285 int fsname##_vptofh(struct vnode *, struct fid *, size_t *); \ 286 void fsname##_init(void); \ 287 void fsname##_reinit(void); \ 288 void fsname##_done(void); \ 289 int fsname##_mountroot(void); \ 290 int fsname##_snapshot(struct mount *, struct vnode *, \ 291 struct timespec *); \ 292 int fsname##_extattrctl(struct mount *, int, struct vnode *, int, \ 293 const char *); \ 294 int fsname##_suspendctl(struct mount *, int) 295 296 /* 297 * This operations vector is so wapbl can be wrapped into a filesystem lkm. 298 * XXX Eventually, we want to move this functionality 299 * down into the filesystems themselves so that this isn't needed. 300 */ 301 struct wapbl_ops { 302 void (*wo_wapbl_discard)(struct wapbl *); 303 int (*wo_wapbl_replay_isopen)(struct wapbl_replay *); 304 int (*wo_wapbl_replay_can_read)(struct wapbl_replay *, daddr_t, long); 305 int (*wo_wapbl_replay_read)(struct wapbl_replay *, void *, daddr_t, long); 306 void (*wo_wapbl_add_buf)(struct wapbl *, struct buf *); 307 void (*wo_wapbl_remove_buf)(struct wapbl *, struct buf *); 308 void (*wo_wapbl_resize_buf)(struct wapbl *, struct buf *, long, long); 309 int (*wo_wapbl_begin)(struct wapbl *, const char *, int); 310 void (*wo_wapbl_end)(struct wapbl *); 311 void (*wo_wapbl_junlock_assert)(struct wapbl *); 312 void (*wo_wapbl_biodone)(struct buf *); 313 }; 314 #define WAPBL_DISCARD(MP) \ 315 (*(MP)->mnt_wapbl_op->wo_wapbl_discard)((MP)->mnt_wapbl) 316 #define WAPBL_REPLAY_ISOPEN(MP) \ 317 (*(MP)->mnt_wapbl_op->wo_wapbl_replay_isopen)((MP)->mnt_wapbl_replay) 318 #define WAPBL_REPLAY_CAN_READ(MP, BLK, LEN) \ 319 (*(MP)->mnt_wapbl_op->wo_wapbl_replay_can_read)((MP)->mnt_wapbl_replay, \ 320 (BLK), (LEN)) 321 #define WAPBL_REPLAY_READ(MP, DATA, BLK, LEN) \ 322 (*(MP)->mnt_wapbl_op->wo_wapbl_replay_read)((MP)->mnt_wapbl_replay, \ 323 (DATA), (BLK), (LEN)) 324 #define WAPBL_ADD_BUF(MP, BP) \ 325 (*(MP)->mnt_wapbl_op->wo_wapbl_add_buf)((MP)->mnt_wapbl, (BP)) 326 #define WAPBL_REMOVE_BUF(MP, BP) \ 327 (*(MP)->mnt_wapbl_op->wo_wapbl_remove_buf)((MP)->mnt_wapbl, (BP)) 328 #define WAPBL_RESIZE_BUF(MP, BP, OLDSZ, OLDCNT) \ 329 (*(MP)->mnt_wapbl_op->wo_wapbl_resize_buf)((MP)->mnt_wapbl, (BP), \ 330 (OLDSZ), (OLDCNT)) 331 #define WAPBL_BEGIN(MP) \ 332 (*(MP)->mnt_wapbl_op->wo_wapbl_begin)((MP)->mnt_wapbl, \ 333 __FILE__, __LINE__) 334 #define WAPBL_END(MP) \ 335 (*(MP)->mnt_wapbl_op->wo_wapbl_end)((MP)->mnt_wapbl) 336 #define WAPBL_JUNLOCK_ASSERT(MP) \ 337 (*(MP)->mnt_wapbl_op->wo_wapbl_junlock_assert)((MP)->mnt_wapbl) 338 339 struct vfs_hooks { 340 LIST_ENTRY(vfs_hooks) vfs_hooks_list; 341 void (*vh_unmount)(struct mount *); 342 int (*vh_reexport)(struct mount *, const char *, void *); 343 void (*vh_future_expansion_1)(void); 344 void (*vh_future_expansion_2)(void); 345 void (*vh_future_expansion_3)(void); 346 void (*vh_future_expansion_4)(void); 347 void (*vh_future_expansion_5)(void); 348 }; 349 350 void vfs_hooks_init(void); 351 int vfs_hooks_attach(struct vfs_hooks *); 352 int vfs_hooks_detach(struct vfs_hooks *); 353 void vfs_hooks_unmount(struct mount *); 354 int vfs_hooks_reexport(struct mount *, const char *, void *); 355 356 #endif /* _KERNEL */ 357 358 /* 359 * Export arguments for local filesystem mount calls. 360 * 361 * This structure is deprecated and is only provided for compatibility 362 * reasons with old binary utilities; several file systems expose an 363 * instance of this structure in their mount arguments structure, thus 364 * needing a padding in place of the old values. This definition cannot 365 * change in the future due to this reason. 366 * XXX: This should be moved to the compat subtree but cannot be done 367 * until we can move the mount args structures themselves. 368 * 369 * The current export_args structure can be found in nfs/nfs.h. 370 */ 371 struct export_args30 { 372 int ex_flags; /* export related flags */ 373 uid_t ex_root; /* mapping for root uid */ 374 struct uucred ex_anon; /* mapping for anonymous user */ 375 struct sockaddr *ex_addr; /* net address to which exported */ 376 int ex_addrlen; /* and the net address length */ 377 struct sockaddr *ex_mask; /* mask of valid bits in saddr */ 378 int ex_masklen; /* and the smask length */ 379 char *ex_indexfile; /* index file for WebNFS URLs */ 380 }; 381 382 struct mnt_export_args30 { 383 const char *fspec; /* Always NULL */ 384 struct export_args30 eargs; 385 }; 386 387 #ifdef _KERNEL 388 389 /* 390 * exported VFS interface (see vfssubr(9)) 391 */ 392 struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */ 393 int vfs_composefh(struct vnode *, fhandle_t *, size_t *); 394 int vfs_composefh_alloc(struct vnode *, fhandle_t **); 395 void vfs_composefh_free(fhandle_t *); 396 int vfs_fhtovp(fhandle_t *, struct vnode **); 397 int vfs_mountedon(struct vnode *);/* is a vfs mounted on vp */ 398 int vfs_mountroot(void); 399 void vfs_shutdown(void); /* unmount and sync file systems */ 400 void vfs_sync_all(struct lwp *); 401 bool vfs_unmountall(struct lwp *); /* unmount file systems */ 402 bool vfs_unmountall1(struct lwp *, bool, bool); 403 bool vfs_unmount_forceone(struct lwp *); 404 int vfs_busy(struct mount *, struct mount **); 405 int vfs_rootmountalloc(const char *, const char *, struct mount **); 406 void vfs_unbusy(struct mount *, bool, struct mount **); 407 int vfs_attach(struct vfsops *); 408 int vfs_detach(struct vfsops *); 409 void vfs_reinit(void); 410 struct vfsops *vfs_getopsbyname(const char *); 411 void vfs_delref(struct vfsops *); 412 void vfs_destroy(struct mount *); 413 void vfs_scrubvnlist(struct mount *); 414 struct mount *vfs_mountalloc(struct vfsops *, struct vnode *); 415 int vfs_stdextattrctl(struct mount *, int, struct vnode *, 416 int, const char *); 417 void vfs_insmntque(struct vnode *, struct mount *); 418 int vfs_quotactl_stat(struct mount *, struct quotastat *); 419 int vfs_quotactl_idtypestat(struct mount *, int, struct quotaidtypestat *); 420 int vfs_quotactl_objtypestat(struct mount *,int,struct quotaobjtypestat *); 421 int vfs_quotactl_get(struct mount *, const struct quotakey *, 422 struct quotaval *); 423 int vfs_quotactl_put(struct mount *, const struct quotakey *, 424 const struct quotaval *); 425 int vfs_quotactl_delete(struct mount *, const struct quotakey *); 426 int vfs_quotactl_cursoropen(struct mount *, struct quotakcursor *); 427 int vfs_quotactl_cursorclose(struct mount *, struct quotakcursor *); 428 int vfs_quotactl_cursorskipidtype(struct mount *, struct quotakcursor *, 429 int); 430 int vfs_quotactl_cursorget(struct mount *, struct quotakcursor *, 431 struct quotakey *, struct quotaval *, unsigned, unsigned *); 432 int vfs_quotactl_cursoratend(struct mount *, struct quotakcursor *, int *); 433 int vfs_quotactl_cursorrewind(struct mount *, struct quotakcursor *); 434 int vfs_quotactl_quotaon(struct mount *, int, const char *); 435 int vfs_quotactl_quotaoff(struct mount *, int); 436 437 extern TAILQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */ 438 extern struct vfsops *vfssw[]; /* filesystem type table */ 439 extern int nvfssw; 440 extern kmutex_t mountlist_lock; 441 extern kmutex_t vfs_list_lock; 442 443 void vfs_mount_sysinit(void); 444 long makefstype(const char *); 445 int mount_domount(struct lwp *, struct vnode **, struct vfsops *, 446 const char *, int, void *, size_t *); 447 int dounmount(struct mount *, int, struct lwp *); 448 int do_sys_mount(struct lwp *, struct vfsops *, const char *, const char *, 449 int, void *, enum uio_seg, size_t, register_t *); 450 void vfsinit(void); 451 void vfs_opv_init(const struct vnodeopv_desc * const *); 452 void vfs_opv_free(const struct vnodeopv_desc * const *); 453 #ifdef DEBUG 454 void vfs_bufstats(void); 455 #endif 456 457 int mount_specific_key_create(specificdata_key_t *, specificdata_dtor_t); 458 void mount_specific_key_delete(specificdata_key_t); 459 void mount_initspecific(struct mount *); 460 void mount_finispecific(struct mount *); 461 void * mount_getspecific(struct mount *, specificdata_key_t); 462 void mount_setspecific(struct mount *, specificdata_key_t, void *); 463 464 int usermount_common_policy(struct mount *, u_long); 465 void mountlist_append(struct mount *); 466 467 LIST_HEAD(vfs_list_head, vfsops); 468 extern struct vfs_list_head vfs_list; 469 470 #else /* _KERNEL */ 471 472 #include <sys/cdefs.h> 473 474 __BEGIN_DECLS 475 #if !defined(__LIBC12_SOURCE__) && !defined(_STANDALONE) 476 int getfh(const char *, void *, size_t *) 477 __RENAME(__getfh30); 478 #endif 479 480 #if !defined(__minix) 481 int unmount(const char *, int); 482 #else 483 int umount(const char *_name, int srvflags); 484 #endif /* !defined(__minix) */ 485 486 #if defined(_NETBSD_SOURCE) 487 #ifndef __LIBC12_SOURCE__ 488 #if !defined(__minix) 489 int mount(const char *, const char *, int, void *, size_t) __RENAME(__mount50); 490 #else 491 int mount(char *_spec, char *_name, int _mountflags, int srvflags, char *type, 492 char *args); 493 #endif /* !defined(__minix) */ 494 int fhopen(const void *, size_t, int) __RENAME(__fhopen40); 495 int fhstat(const void *, size_t, struct stat *) __RENAME(__fhstat50); 496 #endif 497 #endif /* _NETBSD_SOURCE */ 498 __END_DECLS 499 500 #endif /* _KERNEL */ 501 #endif /* !_STANDALONE */ 502 503 #if defined(__minix) && !defined(_STANDALONE) 504 /* Service flags. These are not passed to VFS. */ 505 #define MS_REUSE 0x001 /* Tell RS to try reusing binary from memory */ 506 #define MS_EXISTING 0x002 /* Tell mount to use already running server */ 507 508 #define MNT_LABEL_LEN 16 /* Length of fs label including nul */ 509 510 /* Legacy definitions. */ 511 #define MNTNAMELEN 16 /* Length of fs type name including nul */ 512 #define MNTFLAGLEN 64 /* Length of flags string including nul */ 513 #endif /* defined(__minix) && !defined(_STANDALONE) */ 514 515 #endif /* !_SYS_MOUNT_H_ */ 516