1 /******************************************************************************
2 *******************************************************************************
4 ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5 ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
7 ** This copyrighted material is made available to anyone wishing to use,
8 ** modify, copy, or redistribute it subject to the terms and conditions
9 ** of the GNU General Public License v.2.
11 *******************************************************************************
12 ******************************************************************************/
14 #ifndef __DLMCONSTANTS_DOT_H__
15 #define __DLMCONSTANTS_DOT_H__
18 * Constants used by DLM interface.
25 #define DLM_LOCK_IV (-1) /* invalid */
26 #define DLM_LOCK_NL 0 /* null */
27 #define DLM_LOCK_CR 1 /* concurrent read */
28 #define DLM_LOCK_CW 2 /* concurrent write */
29 #define DLM_LOCK_PR 3 /* protected read */
30 #define DLM_LOCK_PW 4 /* protected write */
31 #define DLM_LOCK_EX 5 /* exclusive */
39 * Do not queue the lock request on the wait queue if it cannot be granted
40 * immediately. If the lock cannot be granted because of this flag, DLM will
41 * either return -EAGAIN from the dlm_lock call or will return 0 from
42 * dlm_lock and -EAGAIN in the lock status block when the AST is executed.
46 * Used to cancel a pending lock request or conversion. A converting lock is
47 * returned to its previously granted mode.
51 * Indicates a lock conversion request. For conversions the name and namelen
52 * are ignored and the lock ID in the LKSB is used to identify the lock.
56 * Requests DLM to return the current contents of the lock value block in the
57 * lock status block. When this flag is set in a lock conversion from PW or EX
58 * modes, DLM assigns the value specified in the lock status block to the lock
59 * value block of the lock resource. The LVB is a DLM_LVB_LEN size array
60 * containing application-specific information.
64 * Force a conversion request to be queued, even if it is compatible with
65 * the granted modes of other locks on the same resource.
69 * Invalidate the lock value block.
73 * Allows the dlm to resolve conversion deadlocks internally by demoting the
74 * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is
75 * returned for a conversion that's been effected by this.
79 * Only relevant to locks originating in userspace. A persistent lock will not
80 * be removed if the process holding the lock exits.
84 * Do not cancel the lock if it gets into conversion deadlock.
85 * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
93 * Used only with new requests for NL mode locks. Tells the lock manager
94 * to grant the lock, ignoring other locks in convert and wait queues.
98 * Send blocking AST's before returning -EAGAIN to the caller. It is only
99 * used along with the NOQUEUE flag. Blocking AST's are not sent for failed
100 * NOQUEUE requests otherwise.
104 * Add a lock to the head of the convert or wait queue rather than the tail.
108 * Disregard the standard grant order rules and grant a lock as soon as it
109 * is compatible with other granted locks.
113 * not yet implemented
117 * If the requested mode cannot be granted immediately, try to grant the lock
118 * in PR mode instead. If this alternate mode is granted instead of the
119 * requested mode, DLM_SBF_ALTMODE is returned in the lksb.
123 * The same as ALTPR, but the alternate mode is CW.
125 * DLM_LKF_FORCEUNLOCK
127 * Unlock the lock even if it is converting or waiting or has sublocks.
128 * Only really for use by the userland device.c code.
132 #define DLM_LKF_NOQUEUE 0x00000001
133 #define DLM_LKF_CANCEL 0x00000002
134 #define DLM_LKF_CONVERT 0x00000004
135 #define DLM_LKF_VALBLK 0x00000008
136 #define DLM_LKF_QUECVT 0x00000010
137 #define DLM_LKF_IVVALBLK 0x00000020
138 #define DLM_LKF_CONVDEADLK 0x00000040
139 #define DLM_LKF_PERSISTENT 0x00000080
140 #define DLM_LKF_NODLCKWT 0x00000100
141 #define DLM_LKF_NODLCKBLK 0x00000200
142 #define DLM_LKF_EXPEDITE 0x00000400
143 #define DLM_LKF_NOQUEUEBAST 0x00000800
144 #define DLM_LKF_HEADQUE 0x00001000
145 #define DLM_LKF_NOORDER 0x00002000
146 #define DLM_LKF_ORPHAN 0x00004000
147 #define DLM_LKF_ALTPR 0x00008000
148 #define DLM_LKF_ALTCW 0x00010000
149 #define DLM_LKF_FORCEUNLOCK 0x00020000
150 #define DLM_LKF_TIMEOUT 0x00040000
153 * Some return codes that are not in errno.h
156 #define DLM_ECANCEL 0x10001
157 #define DLM_EUNLOCK 0x10002
159 #endif /* __DLMCONSTANTS_DOT_H__ */