12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VFSOPS (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> VFSOPS (9)int (∗vfs_unmount)() VFS_UMOUNT Unmount a file systemint (∗vfs_root)() VFS_ROOT Get the file system root vnodeint (∗vfs_quotactl)() VFS_QUOTA CTL Query/modify space quotasint (∗vfs_statvfs)() VFS_STATVFS Get file system statisticsint (∗vfs_sync)() VFS_SYNC Flush file system buffersint (∗vfs_vget)() VFS_VGET Get vnode from file idint (∗vfs_fhtovp)() VFS_FHTOVP NFS file handle to vnode lookupint (∗vfs_vptofh)() VFS_VPTOFH Vnode to NFS file handle lookupvoid (∗vfs_init)() - Initialize file systemvoid (∗vfs_reinit)() - Reinitialize file systemvoid (∗vfs_done)() - Cleanup unmounted file systemint (∗vfs_mountroot)() -Mount the root file systemint (∗vfs_snapshot)() VFS_SNAPSHOT Take asnapshotint (∗vfs_suspendctl)() VFS_SUSPENDCTLSuspend or resumeSome additional non-function members of the vfsops structure are the file system name vfs_name and a referencecount vfs_refcount. Itisnot mandatory for a file system type to support a particular operation, but itmust assign each member function pointer to a suitable function to do the minimum required of it. In mostcases, such functions either do nothing or return an error value to the effect that it is not supported.vfs_reinit, vfs_mountroot, vfs_fhtovp, and vfs_vptofh may be NULL.At system boot, each file system with an entry in vfs_list_initial is established and initialized. Each initializedfile system is recorded by the kernel in the list vfs_list and the file system specific initialization functionvfs_init in its vfsops vector is invoked. When the file system is no longer needed vfs_done is invoked torunfile system specific cleanups and the file system is removed from the kernel list.At system boot, the root file system is mounted by invoking the file system type specific vfs_mountroot functionin the vfsops vector. All file systems that can be mounted as a root file system must define this function.It is responsible for initializing to list of mount structures for all future mounted file systems.<strong>Kernel</strong> state which affects a specific file system type can be queried and modified using the sysctl(8) interface.FUNCTIONSVFS_MOUNT(mp , path , data , dlen)Mount a file system specified by the mount structure mp on the mount point described by path.The argument data contains file system type specific data, while the argument dlen points to alocation specifying the length of the data.VFS_MOUNT() initializes the mount structure for the mounted file system. This structure recordsmount-specific information for the file system and records the list of vnodes associated with thefile system. This function is invoked both to mount new file systems and to change the attributesof an existing file system. If the flag MNT_UPDATEisset in mp->mnt_flag, the file systemshould update its state. This can be used, for instance, to convert a read-only file system to readwrite.The current attributes for a mounted file system can be fetched by specifyingMNT_GETARGS. Ifneither MNT_UPDATE or MNT_GETARGS are specified, a new file systemwill attempted to be mounted.VFS_START(mp , flags)Make the file system specified by the mount structure mp operational. The argument flags is aset of flags for controlling the operation of VFS_START(). This function is invoked afterVFS_MOUNT() and before the first access to the file system.<strong>NetBSD</strong> 3.0 January 24, 2008 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!