Index Index for
Section 3
Index Alphabetical
listing for D
Bottom of page Bottom of
page

dlm_glc_create(3)

NAME

dlm_glc_create - Creates a group lock container

LIBRARY

Distributed Lock Manager Library (libdlm.a)

SYNOPSIS

#include <sys/dlm.h> dlm_status_t dlm_glc_create ( dlm_glc_id_t *idp, dlm_glc_flags_t flags, dlm_nsp_t *ns_listp, int ns_num );

PARAMETERS

idp Specifies a pointer to a location to which dlm_glc_create returns a handle for the created group lock container. The returned group lock container ID is valid only on the local cluster member. 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_glc_flags structure defines a symbolic name for each flag bit. The following list describes each flag: DLM_GLC_OWNED Causes the distributed lock manager (DLM) to destroy the group lock container, all group locks in it, and all processes attached to it when the process that created the container exits. DLM_GLC_PERM Marks the group lock container as permanent. It will persist even after the last associated process detaches from it. The DLM_GLC_PERM and DLM_GLC_OWNED flags are mutually exclusive. ns_listp Specifies a pointer to an array of namespace IDs. The dlm_glc_create function assumes that the valid namespace IDs in the array begin at the first element and are contiguous. ns_num Specifies the number of elements (up to DLM_NSPROCMAX) in the ns_listp array.

DESCRIPTION

The dlm_glc_create() function creates a group lock container and attaches the calling process to it. Because the group lock container is attached to all namespaces specified by the ns_listp parameter, its caller must have previously attached to those namespaces. Any namespaces the calling process joins after creating the group lock container do not become part of the existing container's namespace. Use the dlm_locktp() or dlm_quelocktp() function with the DLM_GROUP_LOCK flag to create new group locks in the container. By default, the container exists as long as at least one process is attached to it. You can change this behavior by specifying either the DLM_GLC_OWNED or DLM_GLC_PERM flag. When a process attaches to a group lock container, it becomes a member of the process lock group and obtains the right to manipulate any lock associated with that container. A group lock can be manipulated by only one group member at a time, although one member can cancel or dequeue another member's request for group locks in that container. A process can attach to only one group lock container at a time.

RETURN VALUES

Upon completion, the dlm_glc_create() function call returns one of the following values: DLM_SUCCESS The operation was completed successfully. DLM_ATTACHED The process is already attached to a group lock container. DLM_BADPARAM Illegal flags were supplied, an illegal namespace ID was provided in the ns_listp parameter, or both DLM_GLC_OWNED and DLM_GLC_PERM were specified. DLM_EFAULT The DLM could not copy the namespace list or the group ID. DLM_ENOSYS The DLM is not enabled. DLM_INSFMEM Insufficient resources were available to perform the requested operation. DLM_NOTATTACHED The process is not attached to the DLM or to one of the specified namespaces.

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_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), dlm_unlock(3) File: dlm(4) TruCluster Server Cluster Highly Available Applications

Index Index for
Section 3
Index Alphabetical
listing for D
Top of page Top of
page