DLM_CREATE_LOCKSPACE - Online Linux Manual PageSection : 3
Updated : July 5, 2007
Source : libdlm functions
NAMEdlm_create_lockspace, dlm_open_lockspace, dlm_close_lockspace, dlm_release_lockspace − manipulate DLM lockspaces
SYNOPSIS #include <libdlm.h>
dlm_lshandle_t dlm_create_lockspace(const char *name, mode_t mode);
dlm_lshandle_t dlm_new_lockspace(const char *name, mode_t mode,
uint32_t flags);
dlm_lshandle_t dlm_open_lockspace(const char *name);
int dlm_close_lockspace(dlm_lshandle_t ls);
int dlm_release_lockspace(const char *name, dlm_lshandle_t ls,
int force);
DESCRIPTIONThe DLM allows locks to be partitioned into "lockspaces", and these can be manipulated by userspace calls. It is possible (though not recommended) for an application to have multiple lockspaces open at one time. Many of the DLM calls work on the "default" lockspace, which should be fine for most users. The calls with _ls_ in them allow you to isolate your application from all others running in the cluster. Remember, lockspaces are a cluster-wide resource, so if you create a lockspace called "myls" it will share locks with a lockspace called "myls" on all nodes. These calls allow users to create & remove lockspaces, and users to connect to existing lockspace to store their locks there.
dlm_lshandle_t dlm_create_lockspace(const char *name, mode_t mode);
This creates a lockspace called <name> and the mode of the file user to access it will be <mode> (subject to umask as usual). The lockspace must not already exist on this node, if it does -1 will be returned and errno will be set to EEXIST. If you really want to use this lockspace you can then use dlm_open_lockspace() below. The name is the name of a misc device that will be created in /dev/misc.
On success a handle to the lockspace is returned, which can be used to pass into subsequent dlm_ls_lock/unlock calls. Make no assumptions as to the content of this handle as it's content may change in future.
The caller must have CAP_SYSADMIN privileges to do this operation. Return codes: 0 is returned if the call completed successfully. If not, -1 is returned and errno is set to one of the following: EINVAL An invalid parameter was passed to the call
ENOMEM A (kernel) memory allocation failed
EEXIST The lockspace already exists
EPERM Process does not have capability to create lockspaces
ENOSYS A fatal error occurred initializing the DLM
Any error returned by the open() system call
int dlm_new_lockspace(const char *name, mode_t mode, uint32_t flags) Performs the same function as dlm_create_lockspace() above, but passes some creation flags to the call that affect the lockspace being created. Currently supported flags are: DLM_LSFL_NODIR the lockspace should not use a resource directory
DLM_LSFL_TIMEWARN the dlm should emit warnings over netlink when locks
have been waiting too long; required for deadlock
detection
int dlm_release_lockspace(const char *name, dlm_lshandle_t ls, int force) Deletes a lockspace. If the lockspace still has active locks then -1 will be returned and errno set to EBUSY. Both the lockspace handle /and/ the name must be specified. This call also closes the lockspace and stops the thread associated with the lockspace, if any.
Note that other nodes in the cluster may still have locks open on this lockspace. This call only removes the lockspace from the current node. If the force flag is set then the lockspace will be removed even if another user on this node has active locks in it. Existing users will NOT be notified if you do this, so be careful.
The caller must have CAP_SYSADMIN privileges to do this operation. Return codes: 0 is returned if the call completed successfully. If not, -1 is returned and errno is set to one of the following: EINVAL An invalid parameter was passed to the call
EPERM Process does not have capability to release lockspaces
EBUSY The lockspace could not be freed because it still
contains locks and force was not set.
dlm_lshandle_t dlm_open_lockspace(const char *name) Opens an already existing lockspace and returns a handle to it. Return codes: 0 is returned if the call completed successfully. If not, -1 is returned and errno is set to an error returned by the open() system call
int dlm_close_lockspace(dlm_lshandle_t ls)
Close the lockspace. Any locks held by this process will be freed. If a thread is associated with this lockspace then it will be stopped. Return codes: 0 is returned if the call completed successfully. If not, -1 is returned and errno is set to one of the following: EINVAL lockspace was not a valid lockspace handle
SEE ALSOlibdlm(3), dlm_unlock(3), dlm_lock(3), 0
Johanes Gumabo
Data Size : 10,620 byte
man-dlm_release_lockspace.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 201,516
Visitor ID : :
Visitor IP : 18.221.248.140 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.