Main index | Section 9 | 日本語 | Options |
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/vnode.h>
The arguments are:
vp | |
The vnode being locked or unlocked. | |
flags | |
One of the lock request types:
| |
LK_SHARED | Shared lock. |
LK_EXCLUSIVE | Exclusive lock. |
LK_UPGRADE | Shared-to-exclusive upgrade. |
LK_DOWNGRADE | Exclusive-to-shared downgrade. |
LK_RELEASE | Release any type of lock. |
LK_DRAIN | Wait for all lock activity to end. |
The lock type may be or'ed with these lock flags:
LK_NOWAIT | Do not sleep to wait for lock. |
LK_SLEEPFAIL | Sleep, then return failure. |
LK_CANRECURSE | |
Allow recursive exclusive lock. | |
LK_NOWITNESS | Instruct witness(4) to ignore this instance. |
The lock type may be or'ed with these control flags:
LK_INTERLOCK | Specify when the caller already has a simple lock (VOP_LOCK() will unlock the simple lock after getting the lock ). |
LK_RETRY | Retry until locked. |
Kernel code should use vn_lock() to lock a vnode rather than calling VOP_LOCK() directly. vn_lock() also does not want a thread specified as argument but it assumes curthread to be used.
VOP_LOCK (9) | February 25, 2008 |
Main index | Section 9 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | A typical Unix /bin or /usr/bin directory contains a hundred different kinds of programs, written by dozens of egotistical programmers, each with its own syntax, operating paradigm, rules of use ... strategies for specifying options, and different sets of constraints. | ” |
— The Unix Haters' handbook |