Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

vfs_mount(9) [debian man page]

VFS_MOUNT(9)						   BSD Kernel Developer's Manual					      VFS_MOUNT(9)

NAME
vfs_mount -- generic file system mount function SYNOPSIS
#include <sys/param.h> #include <sys/mount.h> int vfs_mount(struct thread *td, const char *fstype, char *fspath, int fsflags, void *fsdata); DESCRIPTION
The vfs_mount() function handles the generic portion of mounting a file system, and calls the file system specific mount function after veri- fying its parameters and setting up the structures expected by the underlying mount code. vfs_mount() is called directly by the mount(2) system call. Its arguments are: td The thread responsible for this call. fstype The type of file system being mounted. fspath The path to the mount point of the file system. fsflags Flags controlling the mount. See mount(2) for details. MNT_EXPORTED, MNT_NOSUID, MNT_UPDATE, MNT_RELOAD, MNT_FORCE, MNT_ASYNC, MNT_SYNCHRONOUS, MNT_UNION, MNT_NOATIME, MNT_SNAPSHOT, MNT_NOCLUSTERR, MNT_NOCLUSTERW, MNT_IGNORE, MNT_UNION, MNT_NOSYMFOLLOW fsdata File system specific data structure. It is in userspace when passed to vfs_mount() and is left untouched when passed to file sys- tem's mount(). RETURN VALUES
A 0 value is returned on success. ERRORS
[ENAMETOOLONG] The fs type or the mount point path is too long or any individual path component is too long. [EPERM] Permission denied. There are a number of reason this can occur ranging from the user not having permission to mount a file system to the securelevel being to high to load the fstype module. [EINVAL] Invalid operation (ex: trying to update a non mount-point). [ENOENT] The mount point does not exist (from namei()). [ELOOP] The mount point is a muddle of links (from namei()). [EOPNOTSUPP] The operation is not supported (ex: reloading a r/w file system). [EBUSY] The mount point is busy or is not really a mount point (on update). [ENOTDIR] The mount point is not a directory. [ENODEV] The kernel linker was unable to load the specified fstype or was unable to find the specified fstype module. Other errors can be returned by the file system's mount() and you should check the specific file system for details. Also this call relies on a large number of other kernel services whose errors it returns so this list may not be exhaustive. SEE ALSO
mount(2), mount(8) vfs.usermount AUTHORS
This manual page was written by Chad David <davidc@acns.ab.ca>. BSD
November 26, 2004 BSD

Check Out this Related Man Page

VFSCONF(9)						   BSD Kernel Developer's Manual						VFSCONF(9)

NAME
vfsconf -- vfs configuration information SYNOPSIS
#include <sys/param.h> #include <sys/mount.h> int vfs_register(struct vfsconf *vfc); int vfs_unregister(struct vfsconf *vfc); int vfs_modevent(module_t mod, int type, void *data); DESCRIPTION
Each file system type known to the kernel has a vfsconf structure that contains the information required to create a new mount of that file systems type. struct vfsconf { struct vfsops *vfc_vfsops; /* file system operations vector */ char vfc_name[MFSNAMELEN]; /* file system type name */ int vfc_typenum; /* historic file system type number */ int vfc_refcount; /* number mounted of this type */ int vfc_flags; /* permanent flags */ struct vfsconf *vfc_next; /* next in list */ }; When a new file system is mounted, vfs_mount(9) does a lookup of the vfsconf structure by its name, and if it is not already registered, attempts to load a kernel module for it. The file system operations for the new mount point are taken from vfc_vfsops, and mnt_vfc in the mount structure is made to point directly at the vfsconf structure for the file system type. The file system type number is taken from vfc_typenum which was assigned in vfs_register(), and the mount flags are taken from a mask of vfc_flags. Each time a file system of a given type is mounted, vfc_refcount is incremented. vfs_register() takes a new vfsconf structure and adds it to the list of existing file systems. If the type has not already been registered, it is initialized by calling the vfs_init() function in the file system operations vector. vfs_register() also updates the oid's of any sysctl nodes for this file system type to be the same as the newly assigned type number. vfs_unregister() unlinks vfc from the list of registered file system types if there are currently no mounted instances. If the vfs_uninit() function in the file systems initialization vector is defined, it is called. vfs_modevent() is registered by VFS_SET() to handle the loading and unloading of file system kernel modules. In the case of MOD_LOAD, vfs_register() is called. In the case of MOD_UNLOAD, vfs_unregister() is called. RETURN VALUES
vfs_register() returns 0 if successful; otherwise, EEXIST is returned indicating that the file system type has already been registered. vfs_unregister() returns 0 if successful. If no vfsconf entry can be found matching the name in vfc, EINVAL is returned. If the reference count of mounted instances of the file system type is not zero, EBUSY is returned. If vfs_uninit() is called, any errors it returns will be returned by vfs_unregister(). vfs_modevent() returns the result of the call to vfs_register() or vfs_unregister(), whatever the case. SEE ALSO
vfs_mount(9), vfs_rootmountalloc(9), VFS_SET(9) AUTHORS
This manual page was written by Chad David <davidc@acns.ab.ca>. BSD
November 21, 2001 BSD
Man Page