 |
Index for Section 3 |
|
 |
Alphabetical listing for D |
|
 |
Bottom of page |
|
dlm_unlock(3)
NAME
dlm_unlock - Releases a lock
LIBRARY
Distributed Lock Manager Library (libdlm.a)
SYNOPSIS
#include <sys/dlm.h>
dlm_status_t dlm_unlock (
dlm_lkid_t *lkid_p,
dlm_valb_t *valb_p,
dlm_flags_t flags );
PARAMETERS
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
blocks.
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
becomes valid.
When you specify the DLM_DEQALL flag, you cannot use this
parameter.
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:
DLM_DEQALL
Causes dlm_unlock() to dequeue multiple locks,
depending on the value of the lkid_p parameter.
DLM_INVVALBLK
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.
DLM_NOCPLNOTIF
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.
DESCRIPTION
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.
RETURN VALUES
Upon completion, the dlm_unlock() function returns one of the following
values:
DLM_SUCCESS
The lock was successfully released.
DLM_BADPARAM
You specified the DLM_VALBLK flag but did not specify the valb_p
parameter, or you specified an illegal combination of flags.
DLM_EFAULT
An error occurred in the copy operation to or from the DLM
database.
DLM_ENOSYS
The DLM is not enabled.
DLM_IVLOCKID
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.
DLM_NOACCESS
The process is trying to manipulate a group lock and it is not
attached to the group lock container that holds the lock.
DLM_SUBLOCKS
The lock has sublocks and cannot be dequeued.
FILES
/usr/include/sys/dlm.h
DLM library header file.
/usr/examples/cluster/api_ex_master.c|api_ex_client.c
Source files for an example showing lock conversion and value
block usage.
RELATED INFORMATION
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),
dlm_rd_validate(3), dlm_set_signal(3)
File: dlm(4)
TruCluster Server Cluster Highly Available Applications
 |
Index for Section 3 |
|
 |
Alphabetical listing for D |
|
 |
Top of page |
|