Unix/Linux Go Back    

NetBSD 6.1.5 - man page for vfs_hooks (netbsd section 9)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

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

     vfs_hooks, vfs_hooks_unmount -- VFS hooks interface

     #include <sys/param.h>
     #include <sys/mount.h>

     vfs_hooks_unmount(struct mount *mp);

     The VFS hooks interface provides a way for different kernel subsystems to attach custom
     functions to specific VFS operations.  This enforces code separation by keeping the VFS's
     core sources uncluttered and makes all subsystem functionality reside in a single place.  As
     an example, this interface is used by the NFS server code to automatically handle the
     exports list for each mount point.

     Hooks are described by a struct vfs_hooks object, as seen below:

     struct vfs_hooks {
	     int     (*vh_unmount)(struct mount *);

     For simplicity, each field is named after the VFS operation it refers to.	The purpose of
     each member function, alongside some important notes, is shown below:

	     This hook is executed during the unmount process of a file system.

     For more information about the purpose of each operation, see vfsops(9).  Note that any of
     these fields may be a null pointer.

     After the definition of a struct vfs_hooks object, the kernel has to add it to the vfs_hooks
     link set using the VFS_HOOKS_ATTACH(struct vfs_hooks *) macro.

     Please note that this interface is incomplete on purpose to keep it in its smallest possible
     size (i.e., do not provide a hook that is not used).  If you feel the need to hook a routine
     to a VFS operation that is not yet supported by this interface, just add it to the files
     described in CODE REFERENCES.

     The following functions are provided to the VFS code to run the hooked functions:

	      Runs all hooks for the VFS unmount operation.  Given that these operations shall
	      not fail, it returns void.

     The VFS hooks interface is implemented within the files sys/kern/vfs_hooks.c and

     intro(9), vfs(9), vfsops(9)

     The VFS hooks interface appeared in NetBSD 4.0.

BSD					September 23, 2005				      BSD
Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 05:14 PM.