The lock message. This is used for both debugging output and msleep(9).
The timeout value passed to msleep(9).
The flags the lock is to be initialized with.
Do not sleep while acquiring the lock.
Fail after a sleep.
Allow recursive exclusive locks.
Re-enable the lock after a drain.
Disable the spinlock while acquiring the lock.
Use timo during a sleep; otherwise, 0 is used.
The lockdestroy function is used to destroy a lock, and while it is called in a number of places in the kernel, it currently does nothing.
The lockcount function returns a count of the number of exclusive locks and shared locks held against the lock lkp.
The lockmgr function handles general locking functionality within the kernel, including support for shared and exclusive locks, and recursion. lockmgr is also able to upgrade and downgrade locks.
Its arguments are:
A pointer to the lock to manipulate.
Flags indicating what action is to be taken.
Acquire a shared lock. If an exclusive lock is currently held, it will be downgraded.
Acquire an exclusive lock. If an exclusive lock is already held, and LK_CANRECURSE is not set, the system will panic(9).
Downgrade exclusive lock to a shared lock. Downgrading a shared lock is not permitted. If an exclusive lock has been recursed, all references will be downgraded.
Upgrade a shared lock to an exclusive lock. Fails with EBUSY if there is someone ahead of you in line waiting for an upgrade. If this call fails, the shared lock is lost. Attempts to upgrade an exclusive lock will cause a panic(9).
Upgrade a shared lock to an exclusive lock. If this call fails, the shared lock is lost. Attempts to upgrade an exclusive lock will cause a panic(9).
Release the lock. Releasing a lock that is not held can cause a panic(9).
Wait for all activity on the lock to end, then mark it decommissioned. This is used before freeing a lock that is part of a piece of memory that is about to be freed. (As documented in .In sys/lockmgr.h . )
Fail if operation has slept.
Do not allow the call to sleep. This can be used to test the lock.
Allow recursion on an exclusive lock. For every lock there must be a release.
Unlock the interlock (which should be locked already).
An interlock mutex for controlling group access to the lock. If LK_INTERLOCK is specified, lockmgr assumes interlkp is currently owned and not recursed, and will return it unlocked. See mtx_assert(9).
A thread responsible for this call. NULL becomes LK_KERNPROC.
The lockstatus function returns the status of the lock in relation to the .Vt thread passed to it. Note that if td is NULL and an exclusive lock is held, LK_EXCLUSIVE will be returned.
The lockmgr_printinfo function prints debugging information about the lock. It is used primarily by VOP_PRINT(9) functions.