I would appreciate any donations. Wishlist or send e-mail type donations to maekawa AT daemon-systems.org.

Thank you.

VFSSUBR(9) Kernel Developer's Manual VFSSUBR(9)
NAMEvfssubr, vfs_getnewfsid, vfs_getvfs, vfs_export, vfs_showexport,
vfs_export_lookup, vfs_setpublicfs, vfs_mountedon, vfs_mountroot,
vfs_unmountall, vfs_busy, vfs_unbusy, vfs_mountalloc, vfs_rootmountalloc,
vfs_shutdown, vfs_attach, vfs_detach, vfs_reinit, vfs_getopsbyname,
vfs_suspend, vfs_resume, vfs_vnode_iterator_init,
vfs_vnode_iterator_destroy, vfs_vnode_iterator_next - high-level
interface to kernel file system interface
SYNOPSIS#include<sys/param.h>#include<sys/mount.h>#include<sys/vnode.h>voidvfs_getnewfsid(structmount*mp);
structmount*vfs_getvfs(fsid_t*fsid);
intvfs_export_lookup(structmount*mp, structnetexport*nep,
structexport_args*argp);
intvfs_setpublicfs(structmount*mp, structnetexport*nep,
structexport_args*argp);
intvfs_mountedon(structvnode*vp);
intvfs_mountroot(void);
voidvfs_unmountall(structlwp*l);
intvfs_busy(structmount*mp);
voidvfs_unbusy(structmount*mp);
structmount*vfs_mountalloc(structvfsops*vfs, structvnode*vp);
intvfs_rootmountalloc(char*fstypename, char*devname, structmount**mpp);
voidvfs_shutdown(void);
intvfs_attach(structvfsops*vfs);
intvfs_detach(structvfsops*vfs);
voidvfs_reinit(void);
structvfsops*vfs_getopsbyname(constchar*name);
intvfs_suspend(structmount*mp, intnowait);
voidvfs_resume(structmount*mp);
voidvfs_vnode_iterator_init(structmount*mp, structvnode_iterator**vip);
voidvfs_vnode_iterator_destroy(structvnode_iterator*vi);
structvnode*vfs_vnode_iterator_next(structvnode_iterator*vi,
bool(*selector)(void*context,structvnode*vpp), void*context);
DESCRIPTION
The high-level functions described in this page are the interface to the
kernel file system interface (VFS).
FUNCTIONSvfs_getnewfsid(mp)
Get a new unique file system id type for the file system
specified by the mount structure mp. The file system id type is
stored in mp->mnt_stat.f_fsidx.
vfs_getvfs(fsid)
Lookup a mount point with the file system identifier fsid.
vfs_export_lookup(mp, nep, argp)
Check client permission on the exportable file system specified
by the mount structure mp. The argument nam is the address of
the networked client. This function is used by file system type
specific functions to verify that the client can access the file
system.
vfs_setpublicfs(mp, nep, argp)
Set the publicly exported file system specified by the mount
structure mp.
vfs_mountedon(vp)
Check to see if a file system is mounted on a block device
specified by the vnode vp.
vfs_mountroot(void)
Mount the root file system.
vfs_unmountall(l)
Unmount all file systems.
vfs_busy(mp)
Mark the mount point specified by mp as busy and get a reference
to it. This function is used to synchronize access and to delay
unmounting. The caller must hold a pre-existing reference to
the mount.
vfs_unbusy(mp)
Undo a vfs_busy() on the mount point specified by mp.
vfs_mountalloc(vfsops, vp)
Allocate and initialise a mount structure, setting
mnt_vnodecovered to vp and mnt_op to vfsops. On success return
the address of the mount structure. Otherwise, return NULL.
vfs_rootmountalloc(fstypename, devname, mpp)
Lookup a file system type specified by the name fstypename and
if found allocate and initialise a mount structure for it. The
allocated mount structure is marked as busy and returned in the
address specified by mpp. The device the root file system was
mounted from is specified by the argument devname and is
recorded in the new mount structure.
vfs_shutdown()
Sync and unmount all file systems before shutting down. Invoked
by cpu_reboot(9).
vfs_attach(vfs)
Establish file system vfs and initialise it.
vfs_detach(vfs)
Remove file system vfs from the kernel.
vfs_reinit(void)
Reinitialises all file systems within the kernel through file
system-specific vfs operation (see vfsops(9)).
vfs_getopsbyname(name)
Given a file system name specified by name, look up the vfs
operations for that file system (see vfsops(9)), or return NULL
if file system isn't present in the kernel.
vfs_suspend(mp, nowait)
Request a mounted file system to suspend all operations. All
new operations to the file system are stopped. After all
operations in progress have completed, the file system is synced
to disk and the function returns. If a file system suspension
is currently in progress and nowait is set EWOULDBLOCK is
returned. If the operation is successful, zero is returned,
otherwise an appropriate error code is returned.
vfs_resume(mp)
Request a mounted file system to resume operations.
vfs_vnode_iterator_init(mp, vip)
Allocate and initialize an iterator vip over all vnodes attached
to mount point mp.
vfs_vnode_iterator_destroy(vi)
Free all resources associated with an iterator vi.
vfs_vnode_iterator_next(vi, selector, context)
Return the next vnode from iterator vi. If the operation is
successful the vnode has a reference added to it and it is
returned. If the iterator is exhausted the function returns
NULL. If an optional selector function is provided, then this
function is called with the context provided and the candidate
vnode to be returned. If the selector returns false, then the
vnode is skipped; if it returns true, the vnode is referenced
and then returned.
CODEREFERENCES
The vfs interface functions are implemented within the files
sys/kern/vfs_mount.c, sys/kern/vfs_subr.c and sys/kern/vfs_init.c.
SEEALSOintro(9), namei(9), vfs(9), vfsops(9), vnode(9), vnodeops(9)
NetBSD 8.0 April 17, 2017 NetBSD 8.0