table of contents
|VOP_LOCK(9)||Kernel Developer's Manual||VOP_LOCK(9)|
NAME¶VOP_LOCK, VOP_UNLOCK, VOP_ISLOCKED, vn_lock — serialize access to a vnode
#include <sys/vnode.h> int
VOP_LOCK(struct vnode *vp, int flags); int
VOP_UNLOCK(struct vnode *vp, int flags); int
VOP_ISLOCKED(struct vnode *vp); int
vn_lock(struct vnode *vp, int flags);
DESCRIPTION¶These calls are used to serialize access to the file system, such as to prevent two writes to the same file from happening at the same time. The arguments are:
- The vnode being locked or unlocked.
- One of the lock request types:
- Shared lock.
- Exclusive lock.
- Shared-to-exclusive upgrade.
- Exclusive-to-shared downgrade.
- Release any type of lock.
- Wait for all lock activity to end.
- Do not sleep to wait for lock.
- Sleep, then return failure.
- Allow recursive exclusive lock.
- Instruct witness(4) to ignore this instance.
- Specify when the caller already has a simple lock (VOP_LOCK will unlock the simple lock after getting the lock).
- Retry until locked.
RETURN VALUES¶Zero is returned on success, otherwise an error is returned.
AUTHORS¶This manual page was written by Doug Rabson.
|February 25, 2008||Debian|