listing for D
dlm_unlock - Releases a lock
Distributed Lock Manager Library (libdlm.a)
dlm_status_t dlm_unlock (
dlm_flags_t flags );
lkid_p Specifies the address of the lock ID of the lock to be dequeued.
If this parameter is nonzero and the DLM_DEQALL flag is clear,
only this lock is released.
If this parameter is nonzero and the DLM_DEQALL flag is set, all
sublocks of the indicated lock are released. (A sublock is a lock
that was created when the parid parameter in the call to the
dlm_lock(), dlm_quelock(), dlm_locktp(), or dlm_quelocktp()
function was specified, where parid is the lock ID of the parent
lock.) The lock specified by lkid_p is not released.
If this parameter is zero (0) and the DLM_DEQALL flag is set, all
locks held by the process are released.
If you do not specify the lkid_p parameter, you must specify the
DLM_DEQALL flag in the flags parameter.
valb_p When provided, specifies the address of a lock value block that
contains the number of longwords defined by the DLM_VALBLKSIZE
symbol in the dlm.h file. The lock value block contains
information about the resource that is interpreted only by the
user program. If you specify the DLM_VALB flag, you must specify
the valb_p parameter. See dlm(4) for a discussion of lock value
When a Protected Write (PW) or Exclusive (EX) mode lock is being
dequeued and you specify a lock value block in the valb_p
parameter, the contents of that lock value block are written to
the resource's lock value block in the distributed lock manager
(DLM) database. Further, if the resource's lock value block is
marked as invalid, that condition is cleared and the block
When you specify the DLM_DEQALL flag, you cannot use this
flags When provided, specifies flags that modify the operation. The
flags parameter is a bit mask that is the logical OR of each bit
set, where each bit corresponds to an option.
The dlm_flags_t structure defines a symbolic name for each flag
bit. The following list describes each flag:
Causes dlm_unlock() to dequeue multiple locks,
depending on the value of the lkid_p parameter.
Causes the dlm_unlock() function to invalidate the
resource's lock value block if the lock being released
is a PW or EX mode lock. The lock value block remains
marked as invalid until it is written to again. See
dlm(4) for additional discussion of lock value blocks.
Causes the DLM not to call the lock request's
completion routine to inform it of the unlock
operation. You can use this flag only in conjunction
with the DLM_DEQALL flag when a process releases all of
its locks at one time.
DLM_VALB Causes the DLM to update the resource's lock value
block from the contents of the lock value block
specified by the valb_p parameter, if the lock to be
dequeued is currently granted in PW or EX mode. When
you specify the DLM_VALB flag, you must specify the
valb_p parameter. You cannot specify the DLM_VALB flag
in combination with any other flag. See dlm(4) for a
discussion of lock value blocks.
The dlm_unlock() function releases locks waiting in the granted, waiting,
or conversion queues. It also can dequeue the sublocks of a lock.
If the dlm_unlock() function releases a lock in the waiting or conversion
queue, and that lock is associated with a completion routine, the DLM calls
the completion routine with a completion status of DLM_ABORT. It does not
deliver any blocking notifications that are pending against the lock.
Upon completion, the dlm_unlock() function returns one of the following
The lock was successfully released.
You specified the DLM_VALBLK flag but did not specify the valb_p
parameter, or you specified an illegal combination of flags.
An error occurred in the copy operation to or from the DLM
The DLM is not enabled.
An invalid or nonexistent lock ID was specified; or neither the
lkid_p parameter nor the DLM_DEQALL flag were specified; or an
attempt was made to release a lock that was not on the granted,
waiting, or conversion queues.
The process is trying to manipulate a group lock and it is not
attached to the group lock container that holds the lock.
The lock has sublocks and cannot be dequeued.
DLM library header file.
Source files for an example showing lock conversion and value
Functions: dlm_cancel(3), dlm_cvt(3), dlm_detach(3), dlm_get_lkinfo(3),
dlm_get_rsbinfo(3), dlm_glc_attach(3), dlm_glc_create(3),
dlm_glc_detach(3), dlm_glc_destroy(3), dlm_lock(3), dlm_notify(3),
dlm_nsjoin(3), dlm_nsleave(3), dlm_perrno(3), dlm_quecvt(3),
dlm_quelock(3), dlm_rd_attach(3), dlm_rd_collect(3), dlm_rd_detach(3),
TruCluster Server Cluster Highly Available Applications
listing for D