VFS_UNLOCK_GIANT(9freebsd)

VFS_UNLOCK_GIANT9freebsd

Conditionally lock and unlock giant around entry into vfs

Usage

#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);

Overview

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.

Releases

3 releases since Debian 5.0 (Lenny); the text changed 2 times.

  1. 5.0
  2. 6.0
  3. 7

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.

From freebsd-manpages 8.2-1 in Debian 7 (Wheezy). Parsed by carta from the page's mdoc source.