Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

vfs_lock_giant(9) [debian man page]

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

NAME
VFS_LOCK_GIANT, VFS_UNLOCK_GIANT -- conditionally lock and unlock Giant around entry into VFS SYNOPSIS
#include <sys/param.h> #include <sys/mount.h> #include <sys/vnode.h> int VFS_LOCK_GIANT(struct mount *mp); void VFS_UNLOCK_GIANT(int vfslocked); DESCRIPTION
VFS_LOCK_GIANT() will conditionally acquire the Giant lock if the file system referenced by mp is marked as MPSAFE or not, returning a flag indicating whether Giant was set, which may later be passed to VFS_UNLOCK_GIANT(). The value of mp will typically be derived from the mount pointer in a vnode on which a VFS operation will be performed. VFS_UNLOCK_GIANT() conditionally releases the Giant lock if the passed vfslocked argument is non-zero. It is expected that the argument will be derived from the return values of VFS_LOCK_GIANT() or NDHASGIANT(9). RETURN VALUES
VFS_LOCK_GIANT() returns a boolean indicating whether or not Giant was acquired. SEE ALSO
mutex(9), NDHASGIANT(9), vnode(9) AUTHORS
MPSAFE VFS support for FreeBSD was implemented by Jeff Roberson. This manual page was written by Robert Watson. BUGS
Non-MPSAFE file systems exist, requiring callers conditional locking and unlocking of Giant. BSD
September 21, 2005 BSD

Check Out this Related Man Page

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

NAME
vput, vrele, vunref -- decrement the use count for a vnode SYNOPSIS
#include <sys/param.h> #include <sys/vnode.h> void vput(struct vnode *vp); void vrele(struct vnode *vp); void vunref(struct vnode *vp); DESCRIPTION
Decrement the v_usecount field of a vnode. vp the vnode to decrement The vrele() function takes an unlocked vnode and returns with the vnode unlocked. The vput() function should be given a locked vnode as argument, the vnode is unlocked after the function returned. The vput() is opera- tionally equivalent to calling VOP_UNLOCK(9) followed by vrele(9), with less overhead. The vunref() function takes a locked vnode as argument, and returns with the vnode locked. Any code in the system which signified its use of a vnode by usecount should call one of the listed function to decrement use counter. If the v_usecount field of the non-doomed vnode reaches zero, then it will be inactivated and placed on the free list. Since the functions might need to call VOPs for the vnode, the Giant mutex should be conditionally locked around the call. The hold count for the vnode is always greater or equal to the usecount. Non-forced unmount fails when mount point owns a vnode that has non-zero usecount, see vflush(9). SEE ALSO
vget(9), vnode(9), vref(9), vrefcnt(9) AUTHORS
This manual page was written by Doug Rabson and Konstantin Belousov. BSD
November 20, 2010 BSD
Man Page