FreeBSD/Linux Kernel Cross Reference
sys/sys/mount.h
1 /* $NetBSD: mount.h,v 1.240 2022/11/04 11:20:40 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 #define VFS_TIMESTAMP_PRECISION 5 /* file timestamp precision */
119
120 /* vfsquery flags for kqueue(2) */
121 #define VQ_MOUNT 0x0001 /* new filesystem arrived */
122 #define VQ_UNMOUNT 0x0002 /* filesystem has left */
123
124 #ifndef _STANDALONE
125
126 #if defined(_KERNEL) || defined(__EXPOSE_MOUNT)
127
128 struct vnode;
129 struct vnode_impl;
130 struct vattr;
131
132 /*
133 * Structure per mounted file system. Each mounted file system has an
134 * array of operations and an instance record.
135 */
136 struct mount {
137 /*
138 * Mostly stable data.
139 */
140 kmutex_t *mnt_vnodelock; /* lock on mnt_vnodelist */
141 struct vfsops *mnt_op; /* operations on fs */
142 struct vnode *mnt_vnodecovered; /* vnode we mounted on */
143 struct mount *mnt_lower; /* fs mounted on */
144 void *mnt_transinfo; /* for FS-internal use */
145 void *mnt_data; /* private data */
146 kmutex_t *mnt_renamelock; /* per-fs rename lock */
147 int mnt_flag; /* flags */
148 int mnt_iflag; /* internal flags */
149 int mnt_fs_bshift; /* offset shift for lblkno */
150 int mnt_dev_bshift; /* shift for device sectors */
151 specificdata_reference
152 mnt_specdataref; /* subsystem specific data */
153 kmutex_t *mnt_updating; /* to serialize updates */
154 const struct wapbl_ops
155 *mnt_wapbl_op; /* logging ops */
156 struct wapbl *mnt_wapbl; /* log info */
157 struct wapbl_replay
158 *mnt_wapbl_replay; /* replay support XXX: what? */
159 uint64_t mnt_gen;
160
161 /*
162 * Volatile data: pad to keep away from the stable items.
163 */
164 int mnt_refcnt /* ref count on this structure */
165 __aligned(COHERENCY_UNIT);
166 int mnt_synclist_slot; /* synclist slot index */
167 TAILQ_HEAD(, vnode_impl) mnt_vnodelist; /* list of vnodes this mount */
168 struct statvfs mnt_stat; /* cache of filesystem stats */
169 };
170
171 #endif /* defined(_KERNEL) || defined(__EXPOSE_MOUNT) */
172
173 #ifdef _KERNEL
174
175 struct quotactl_args; /* in sys/quotactl.h */
176 struct quotastat; /* in sys/quotactl.h */
177 struct quotaidtypestat; /* in sys/quotactl.h */
178 struct quotaobjtypestat; /* in sys/quotactl.h */
179 struct quotakcursor; /* in sys/quotactl.h */
180 struct quotakey; /* in sys/quota.h */
181 struct quotaval; /* in sys/quota.h */
182
183 /*
184 * Operations supported on mounted file system.
185 */
186
187 struct vfsops {
188 const char *vfs_name;
189 size_t vfs_min_mount_data;
190 int (*vfs_mount) (struct mount *, const char *, void *,
191 size_t *);
192 int (*vfs_start) (struct mount *, int);
193 int (*vfs_unmount) (struct mount *, int);
194 int (*vfs_root) (struct mount *, int, struct vnode **);
195 int (*vfs_quotactl) (struct mount *, struct quotactl_args *);
196 int (*vfs_statvfs) (struct mount *, struct statvfs *);
197 int (*vfs_sync) (struct mount *, int, struct kauth_cred *);
198 int (*vfs_vget) (struct mount *, ino_t, int, struct vnode **);
199 int (*vfs_loadvnode) (struct mount *, struct vnode *,
200 const void *, size_t, const void **);
201 int (*vfs_newvnode) (struct mount *, struct vnode *, struct vnode *,
202 struct vattr *, kauth_cred_t, void *,
203 size_t *, const void **);
204 int (*vfs_fhtovp) (struct mount *, struct fid *, int,
205 struct vnode **);
206 int (*vfs_vptofh) (struct vnode *, struct fid *, size_t *);
207 void (*vfs_init) (void);
208 void (*vfs_reinit) (void);
209 void (*vfs_done) (void);
210 int (*vfs_mountroot)(void);
211 int (*vfs_snapshot) (struct mount *, struct vnode *,
212 struct timespec *);
213 int (*vfs_extattrctl) (struct mount *, int,
214 struct vnode *, int, const char *);
215 int (*vfs_suspendctl) (struct mount *, int);
216 int (*vfs_renamelock_enter)(struct mount *);
217 void (*vfs_renamelock_exit)(struct mount *);
218 int (*vfs_fsync) (struct vnode *, int);
219 const struct vnodeopv_desc * const *vfs_opv_descs;
220 int vfs_refcount;
221 LIST_ENTRY(vfsops) vfs_list;
222 };
223
224 /* XXX vget is actually file system internal. */
225 #define VFS_VGET(MP, INO, LK, VPP) (*(MP)->mnt_op->vfs_vget)(MP, INO, LK, VPP)
226 #define VFS_LOADVNODE(MP, VP, KEY, KEY_LEN, NEW_KEY) \
227 (*(MP)->mnt_op->vfs_loadvnode)(MP, VP, KEY, KEY_LEN, NEW_KEY)
228 #define VFS_NEWVNODE(MP, DVP, VP, VAP, CRED, EXTRA, NEW_LEN, NEW_KEY) \
229 (*(MP)->mnt_op->vfs_newvnode)(MP, DVP, VP, VAP, CRED, EXTRA, \
230 NEW_LEN, NEW_KEY)
231
232 #define VFS_RENAMELOCK_ENTER(MP) (*(MP)->mnt_op->vfs_renamelock_enter)(MP)
233 #define VFS_RENAMELOCK_EXIT(MP) (*(MP)->mnt_op->vfs_renamelock_exit)(MP)
234 #define VFS_FSYNC(MP, VP, FLG) (*(MP)->mnt_op->vfs_fsync)(VP, FLG)
235
236 int VFS_MOUNT(struct mount *, const char *, void *, size_t *);
237 int VFS_START(struct mount *, int);
238 int VFS_UNMOUNT(struct mount *, int);
239 int VFS_ROOT(struct mount *, int, struct vnode **);
240 int VFS_QUOTACTL(struct mount *, struct quotactl_args *);
241 int VFS_STATVFS(struct mount *, struct statvfs *);
242 int VFS_SYNC(struct mount *, int, struct kauth_cred *);
243 int VFS_FHTOVP(struct mount *, struct fid *, int, struct vnode **);
244 int VFS_VPTOFH(struct vnode *, struct fid *, size_t *);
245 int VFS_SNAPSHOT(struct mount *, struct vnode *, struct timespec *);
246 int VFS_EXTATTRCTL(struct mount *, int, struct vnode *, int, const char *);
247 int VFS_SUSPENDCTL(struct mount *, int);
248
249 struct vnodeopv_desc;
250 struct kauth_cred;
251
252 #define VFS_MAX_MOUNT_DATA 8192
253
254 #define VFS_PROTOS(fsname) \
255 int fsname##_mount(struct mount *, const char *, void *, \
256 size_t *); \
257 int fsname##_start(struct mount *, int); \
258 int fsname##_unmount(struct mount *, int); \
259 int fsname##_root(struct mount *, int, struct vnode **); \
260 int fsname##_quotactl(struct mount *, struct quotactl_args *); \
261 int fsname##_statvfs(struct mount *, struct statvfs *); \
262 int fsname##_sync(struct mount *, int, struct kauth_cred *); \
263 int fsname##_vget(struct mount *, ino_t, int, struct vnode **); \
264 int fsname##_loadvnode(struct mount *, struct vnode *, \
265 const void *, size_t, const void **); \
266 int fsname##_newvnode(struct mount *, struct vnode *, \
267 struct vnode *, struct vattr *, kauth_cred_t, void *, \
268 size_t *, const void **); \
269 int fsname##_fhtovp(struct mount *, struct fid *, int, struct vnode **);\
270 int fsname##_vptofh(struct vnode *, struct fid *, size_t *); \
271 void fsname##_init(void); \
272 void fsname##_reinit(void); \
273 void fsname##_done(void); \
274 int fsname##_mountroot(void); \
275 int fsname##_snapshot(struct mount *, struct vnode *, \
276 struct timespec *); \
277 int fsname##_extattrctl(struct mount *, int, struct vnode *, int, \
278 const char *); \
279 int fsname##_suspendctl(struct mount *, int)
280
281 /*
282 * This operations vector is so wapbl can be wrapped into a filesystem lkm.
283 * XXX Eventually, we want to move this functionality
284 * down into the filesystems themselves so that this isn't needed.
285 */
286 struct wapbl_ops {
287 void (*wo_wapbl_discard)(struct wapbl *);
288 int (*wo_wapbl_replay_isopen)(struct wapbl_replay *);
289 int (*wo_wapbl_replay_can_read)(struct wapbl_replay *, daddr_t, long);
290 int (*wo_wapbl_replay_read)(struct wapbl_replay *, void *, daddr_t, long);
291 void (*wo_wapbl_add_buf)(struct wapbl *, struct buf *);
292 void (*wo_wapbl_remove_buf)(struct wapbl *, struct buf *);
293 void (*wo_wapbl_resize_buf)(struct wapbl *, struct buf *, long, long);
294 int (*wo_wapbl_begin)(struct wapbl *, const char *, int);
295 void (*wo_wapbl_end)(struct wapbl *);
296 void (*wo_wapbl_junlock_assert)(struct wapbl *);
297 void (*wo_wapbl_jlock_assert)(struct wapbl *);
298 void (*wo_wapbl_biodone)(struct buf *);
299 };
300 #define WAPBL_DISCARD(MP) \
301 (*(MP)->mnt_wapbl_op->wo_wapbl_discard)((MP)->mnt_wapbl)
302 #define WAPBL_REPLAY_ISOPEN(MP) \
303 (*(MP)->mnt_wapbl_op->wo_wapbl_replay_isopen)((MP)->mnt_wapbl_replay)
304 #define WAPBL_REPLAY_CAN_READ(MP, BLK, LEN) \
305 (*(MP)->mnt_wapbl_op->wo_wapbl_replay_can_read)((MP)->mnt_wapbl_replay, \
306 (BLK), (LEN))
307 #define WAPBL_REPLAY_READ(MP, DATA, BLK, LEN) \
308 (*(MP)->mnt_wapbl_op->wo_wapbl_replay_read)((MP)->mnt_wapbl_replay, \
309 (DATA), (BLK), (LEN))
310 #define WAPBL_ADD_BUF(MP, BP) \
311 (*(MP)->mnt_wapbl_op->wo_wapbl_add_buf)((MP)->mnt_wapbl, (BP))
312 #define WAPBL_REMOVE_BUF(MP, BP) \
313 (*(MP)->mnt_wapbl_op->wo_wapbl_remove_buf)((MP)->mnt_wapbl, (BP))
314 #define WAPBL_RESIZE_BUF(MP, BP, OLDSZ, OLDCNT) \
315 (*(MP)->mnt_wapbl_op->wo_wapbl_resize_buf)((MP)->mnt_wapbl, (BP), \
316 (OLDSZ), (OLDCNT))
317 #define WAPBL_BEGIN(MP) \
318 (*(MP)->mnt_wapbl_op->wo_wapbl_begin)((MP)->mnt_wapbl, \
319 __FILE__, __LINE__)
320 #define WAPBL_END(MP) \
321 (*(MP)->mnt_wapbl_op->wo_wapbl_end)((MP)->mnt_wapbl)
322 #define WAPBL_JUNLOCK_ASSERT(MP) \
323 (*(MP)->mnt_wapbl_op->wo_wapbl_junlock_assert)((MP)->mnt_wapbl)
324 #define WAPBL_JLOCK_ASSERT(MP) \
325 (*(MP)->mnt_wapbl_op->wo_wapbl_jlock_assert)((MP)->mnt_wapbl)
326
327 struct vfs_hooks {
328 LIST_ENTRY(vfs_hooks) vfs_hooks_list;
329 void (*vh_unmount)(struct mount *);
330 int (*vh_reexport)(struct mount *, const char *, void *);
331 void (*vh_future_expansion_1)(void);
332 void (*vh_future_expansion_2)(void);
333 void (*vh_future_expansion_3)(void);
334 void (*vh_future_expansion_4)(void);
335 void (*vh_future_expansion_5)(void);
336 };
337
338 void vfs_hooks_init(void);
339 int vfs_hooks_attach(struct vfs_hooks *);
340 int vfs_hooks_detach(struct vfs_hooks *);
341 void vfs_hooks_unmount(struct mount *);
342 int vfs_hooks_reexport(struct mount *, const char *, void *);
343
344 #endif /* _KERNEL */
345
346 /*
347 * Export arguments for local filesystem mount calls.
348 *
349 * This structure is deprecated and is only provided for compatibility
350 * reasons with old binary utilities; several file systems expose an
351 * instance of this structure in their mount arguments structure, thus
352 * needing a padding in place of the old values. This definition cannot
353 * change in the future due to this reason.
354 * XXX: This should be moved to the compat subtree but cannot be done
355 * until we can move the mount args structures themselves.
356 *
357 * The current export_args structure can be found in nfs/nfs.h.
358 */
359 struct export_args30 {
360 int ex_flags; /* export related flags */
361 uid_t ex_root; /* mapping for root uid */
362 struct uucred ex_anon; /* mapping for anonymous user */
363 struct sockaddr *ex_addr; /* net address to which exported */
364 int ex_addrlen; /* and the net address length */
365 struct sockaddr *ex_mask; /* mask of valid bits in saddr */
366 int ex_masklen; /* and the smask length */
367 char *ex_indexfile; /* index file for WebNFS URLs */
368 };
369
370 struct mnt_export_args30 {
371 const char *fspec; /* Always NULL */
372 struct export_args30 eargs;
373 };
374
375 #ifdef _KERNEL
376
377 /*
378 * exported VFS interface (see vfssubr(9))
379 */
380 struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */
381 int vfs_composefh(struct vnode *, fhandle_t *, size_t *);
382 int vfs_composefh_alloc(struct vnode *, fhandle_t **);
383 void vfs_composefh_free(fhandle_t *);
384 int vfs_fhtovp(fhandle_t *, struct vnode **);
385 int vfs_mountedon(struct vnode *);/* is a vfs mounted on vp */
386 int vfs_mountroot(void);
387 void vfs_shutdown(void); /* unmount and sync file systems */
388 void vfs_sync_all(struct lwp *);
389 bool vfs_unmountall(struct lwp *); /* unmount file systems */
390 bool vfs_unmountall1(struct lwp *, bool, bool);
391 bool vfs_unmount_forceone(struct lwp *);
392 int vfs_busy(struct mount *);
393 int vfs_trybusy(struct mount *);
394 int vfs_rootmountalloc(const char *, const char *, struct mount **);
395 void vfs_unbusy(struct mount *);
396 int vfs_set_lowermount(struct mount *, struct mount *);
397 int vfs_attach(struct vfsops *);
398 int vfs_detach(struct vfsops *);
399 void vfs_reinit(void);
400 struct vfsops *vfs_getopsbyname(const char *);
401 void vfs_delref(struct vfsops *);
402 void vfs_ref(struct mount *);
403 void vfs_rele(struct mount *);
404 struct mount *vfs_mountalloc(struct vfsops *, struct vnode *);
405 int vfs_stdextattrctl(struct mount *, int, struct vnode *,
406 int, const char *);
407 void vfs_insmntque(struct vnode *, struct mount *);
408 int vfs_quotactl_stat(struct mount *, struct quotastat *);
409 int vfs_quotactl_idtypestat(struct mount *, int, struct quotaidtypestat *);
410 int vfs_quotactl_objtypestat(struct mount *,int,struct quotaobjtypestat *);
411 int vfs_quotactl_get(struct mount *, const struct quotakey *,
412 struct quotaval *);
413 int vfs_quotactl_put(struct mount *, const struct quotakey *,
414 const struct quotaval *);
415 int vfs_quotactl_del(struct mount *, const struct quotakey *);
416 int vfs_quotactl_cursoropen(struct mount *, struct quotakcursor *);
417 int vfs_quotactl_cursorclose(struct mount *, struct quotakcursor *);
418 int vfs_quotactl_cursorskipidtype(struct mount *, struct quotakcursor *,
419 int);
420 int vfs_quotactl_cursorget(struct mount *, struct quotakcursor *,
421 struct quotakey *, struct quotaval *, unsigned, unsigned *);
422 int vfs_quotactl_cursoratend(struct mount *, struct quotakcursor *, int *);
423 int vfs_quotactl_cursorrewind(struct mount *, struct quotakcursor *);
424 int vfs_quotactl_quotaon(struct mount *, int, const char *);
425 int vfs_quotactl_quotaoff(struct mount *, int);
426
427 struct vnode_iterator; /* Opaque. */
428 void vfs_vnode_iterator_init(struct mount *, struct vnode_iterator **);
429 void vfs_vnode_iterator_destroy(struct vnode_iterator *);
430 struct vnode *vfs_vnode_iterator_next(struct vnode_iterator *,
431 bool (*)(void *, struct vnode *), void *);
432
433 /* Syncer */
434 extern int syncer_maxdelay;
435 extern time_t syncdelay;
436 extern time_t filedelay;
437 extern time_t dirdelay;
438 extern time_t metadelay;
439 void vfs_syncer_add_to_worklist(struct mount *);
440 void vfs_syncer_remove_from_worklist(struct mount *);
441
442 extern int vfs_magiclinks;
443 extern int vfs_timestamp_precision;
444
445 extern struct vfsops *vfssw[]; /* filesystem type table */
446 extern int nvfssw;
447 extern kmutex_t vfs_list_lock;
448
449 void vfs_mount_sysinit(void);
450 long makefstype(const char *);
451 int mount_domount(struct lwp *, struct vnode **, struct vfsops *,
452 const char *, int, void *, size_t *);
453 int dounmount(struct mount *, int, struct lwp *);
454 int do_sys_mount(struct lwp *, const char *, enum uio_seg, const char *,
455 int, void *, enum uio_seg, size_t, register_t *);
456 void vfsinit(void);
457 void vfs_evfilt_fs_init(void);
458 void vfs_opv_init(const struct vnodeopv_desc * const *);
459 void vfs_opv_free(const struct vnodeopv_desc * const *);
460 #ifdef DEBUG
461 void vfs_bufstats(void);
462 #endif
463
464 int mount_specific_key_create(specificdata_key_t *, specificdata_dtor_t);
465 void mount_specific_key_delete(specificdata_key_t);
466 void mount_initspecific(struct mount *);
467 void mount_finispecific(struct mount *);
468 void * mount_getspecific(struct mount *, specificdata_key_t);
469 void mount_setspecific(struct mount *, specificdata_key_t, void *);
470
471 int usermount_common_policy(struct mount *, u_long);
472
473 typedef struct mount_iterator mount_iterator_t; /* Opaque. */
474 void mountlist_iterator_init(mount_iterator_t **);
475 void mountlist_iterator_destroy(mount_iterator_t *);
476 struct mount *mountlist_iterator_next(mount_iterator_t *);
477 struct mount *mountlist_iterator_trynext(mount_iterator_t *);
478 struct mount *_mountlist_next(struct mount *);
479 void mountlist_append(struct mount *);
480 void mountlist_remove(struct mount *);
481
482 LIST_HEAD(vfs_list_head, vfsops);
483 extern struct vfs_list_head vfs_list;
484
485 #else /* _KERNEL */
486
487 #include <sys/cdefs.h>
488
489 __BEGIN_DECLS
490 #if !defined(__LIBC12_SOURCE__) && !defined(_STANDALONE)
491 int getfh(const char *, void *, size_t *)
492 __RENAME(__getfh30);
493 #endif
494
495 int unmount(const char *, int);
496 #if defined(_NETBSD_SOURCE)
497 #ifndef __LIBC12_SOURCE__
498 int mount(const char *, const char *, int, void *, size_t) __RENAME(__mount50);
499 int fhopen(const void *, size_t, int) __RENAME(__fhopen40);
500 int fhstat(const void *, size_t, struct stat *) __RENAME(__fhstat50);
501 #endif
502 #endif /* _NETBSD_SOURCE */
503 __END_DECLS
504
505 #endif /* _KERNEL */
506 #endif /* !_STANDALONE */
507
508 #endif /* !_SYS_MOUNT_H_ */
Cache object: 832f5fd9e158cf0d564b202ed8829ac7
|