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/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, return
ing a flag
indicating whether Giant was set, which may later be passed
to
VFS_UNLOCK_GIANT(). The value of mp will typically be de
rived 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 ar
gument will be
derived from the return values of 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
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout