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