1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 /********************************************* 2 /****************************************************************************** 3 ********************************************** 3 ******************************************************************************* 4 ** 4 ** 5 ** Copyright (C) Sistina Software, Inc. 1997 5 ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 6 ** Copyright (C) 2004-2007 Red Hat, Inc. All 6 ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 7 ** 7 ** 8 ** This copyrighted material is made availabl 8 ** This copyrighted material is made available to anyone wishing to use, 9 ** modify, copy, or redistribute it subject t 9 ** modify, copy, or redistribute it subject to the terms and conditions 10 ** of the GNU General Public License v.2. 10 ** of the GNU General Public License v.2. 11 ** 11 ** 12 ********************************************** 12 ******************************************************************************* 13 ********************************************** 13 ******************************************************************************/ 14 14 15 #ifndef __DLMCONSTANTS_DOT_H__ 15 #ifndef __DLMCONSTANTS_DOT_H__ 16 #define __DLMCONSTANTS_DOT_H__ 16 #define __DLMCONSTANTS_DOT_H__ 17 17 18 /* 18 /* 19 * Constants used by DLM interface. 19 * Constants used by DLM interface. 20 */ 20 */ 21 21 22 #define DLM_LOCKSPACE_LEN 64 22 #define DLM_LOCKSPACE_LEN 64 23 #define DLM_RESNAME_MAXLEN 64 23 #define DLM_RESNAME_MAXLEN 64 24 24 25 25 26 /* 26 /* 27 * Lock Modes 27 * Lock Modes 28 */ 28 */ 29 29 30 #define DLM_LOCK_IV (-1) /* inv 30 #define DLM_LOCK_IV (-1) /* invalid */ 31 #define DLM_LOCK_NL 0 /* nul 31 #define DLM_LOCK_NL 0 /* null */ 32 #define DLM_LOCK_CR 1 /* con 32 #define DLM_LOCK_CR 1 /* concurrent read */ 33 #define DLM_LOCK_CW 2 /* con 33 #define DLM_LOCK_CW 2 /* concurrent write */ 34 #define DLM_LOCK_PR 3 /* pro 34 #define DLM_LOCK_PR 3 /* protected read */ 35 #define DLM_LOCK_PW 4 /* pro 35 #define DLM_LOCK_PW 4 /* protected write */ 36 #define DLM_LOCK_EX 5 /* exc 36 #define DLM_LOCK_EX 5 /* exclusive */ 37 37 38 38 39 /* 39 /* 40 * Flags to dlm_lock 40 * Flags to dlm_lock 41 * 41 * 42 * DLM_LKF_NOQUEUE 42 * DLM_LKF_NOQUEUE 43 * 43 * 44 * Do not queue the lock request on the wait q 44 * Do not queue the lock request on the wait queue if it cannot be granted 45 * immediately. If the lock cannot be granted 45 * immediately. If the lock cannot be granted because of this flag, DLM will 46 * either return -EAGAIN from the dlm_lock cal 46 * either return -EAGAIN from the dlm_lock call or will return 0 from 47 * dlm_lock and -EAGAIN in the lock status blo 47 * dlm_lock and -EAGAIN in the lock status block when the AST is executed. 48 * 48 * 49 * DLM_LKF_CANCEL 49 * DLM_LKF_CANCEL 50 * 50 * 51 * Used to cancel a pending lock request or co 51 * Used to cancel a pending lock request or conversion. A converting lock is 52 * returned to its previously granted mode. 52 * returned to its previously granted mode. 53 * 53 * 54 * DLM_LKF_CONVERT 54 * DLM_LKF_CONVERT 55 * 55 * 56 * Indicates a lock conversion request. For c 56 * Indicates a lock conversion request. For conversions the name and namelen 57 * are ignored and the lock ID in the LKSB is 57 * are ignored and the lock ID in the LKSB is used to identify the lock. 58 * 58 * 59 * DLM_LKF_VALBLK 59 * DLM_LKF_VALBLK 60 * 60 * 61 * Requests DLM to return the current contents 61 * Requests DLM to return the current contents of the lock value block in the 62 * lock status block. When this flag is set i 62 * lock status block. When this flag is set in a lock conversion from PW or EX 63 * modes, DLM assigns the value specified in t 63 * modes, DLM assigns the value specified in the lock status block to the lock 64 * value block of the lock resource. The LVB 64 * value block of the lock resource. The LVB is a DLM_LVB_LEN size array 65 * containing application-specific information 65 * containing application-specific information. 66 * 66 * 67 * DLM_LKF_QUECVT 67 * DLM_LKF_QUECVT 68 * 68 * 69 * Force a conversion request to be queued, ev 69 * Force a conversion request to be queued, even if it is compatible with 70 * the granted modes of other locks on the sam 70 * the granted modes of other locks on the same resource. 71 * 71 * 72 * DLM_LKF_IVVALBLK 72 * DLM_LKF_IVVALBLK 73 * 73 * 74 * Invalidate the lock value block. 74 * Invalidate the lock value block. 75 * 75 * 76 * DLM_LKF_CONVDEADLK 76 * DLM_LKF_CONVDEADLK 77 * 77 * 78 * Allows the dlm to resolve conversion deadlo 78 * Allows the dlm to resolve conversion deadlocks internally by demoting the 79 * granted mode of a converting lock to NL. T 79 * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is 80 * returned for a conversion that's been effec 80 * returned for a conversion that's been effected by this. 81 * 81 * 82 * DLM_LKF_PERSISTENT 82 * DLM_LKF_PERSISTENT 83 * 83 * 84 * Only relevant to locks originating in users 84 * Only relevant to locks originating in userspace. A persistent lock will not 85 * be removed if the process holding the lock 85 * be removed if the process holding the lock exits. 86 * 86 * 87 * DLM_LKF_NODLCKWT 87 * DLM_LKF_NODLCKWT 88 * 88 * 89 * Do not cancel the lock if it gets into conv 89 * Do not cancel the lock if it gets into conversion deadlock. 90 * 90 * 91 * DLM_LKF_NODLCKBLK 91 * DLM_LKF_NODLCKBLK 92 * 92 * 93 * net yet implemented 93 * net yet implemented 94 * 94 * 95 * DLM_LKF_EXPEDITE 95 * DLM_LKF_EXPEDITE 96 * 96 * 97 * Used only with new requests for NL mode loc 97 * Used only with new requests for NL mode locks. Tells the lock manager 98 * to grant the lock, ignoring other locks in 98 * to grant the lock, ignoring other locks in convert and wait queues. 99 * 99 * 100 * DLM_LKF_NOQUEUEBAST 100 * DLM_LKF_NOQUEUEBAST 101 * 101 * 102 * Send blocking AST's before returning -EAGAI 102 * Send blocking AST's before returning -EAGAIN to the caller. It is only 103 * used along with the NOQUEUE flag. Blocking 103 * used along with the NOQUEUE flag. Blocking AST's are not sent for failed 104 * NOQUEUE requests otherwise. 104 * NOQUEUE requests otherwise. 105 * 105 * 106 * DLM_LKF_HEADQUE 106 * DLM_LKF_HEADQUE 107 * 107 * 108 * Add a lock to the head of the convert or wa 108 * Add a lock to the head of the convert or wait queue rather than the tail. 109 * 109 * 110 * DLM_LKF_NOORDER 110 * DLM_LKF_NOORDER 111 * 111 * 112 * Disregard the standard grant order rules an 112 * Disregard the standard grant order rules and grant a lock as soon as it 113 * is compatible with other granted locks. 113 * is compatible with other granted locks. 114 * 114 * 115 * DLM_LKF_ORPHAN 115 * DLM_LKF_ORPHAN 116 * 116 * 117 * Acquire an orphan lock. 117 * Acquire an orphan lock. 118 * 118 * 119 * DLM_LKF_ALTPR 119 * DLM_LKF_ALTPR 120 * 120 * 121 * If the requested mode cannot be granted imm 121 * If the requested mode cannot be granted immediately, try to grant the lock 122 * in PR mode instead. If this alternate mode 122 * in PR mode instead. If this alternate mode is granted instead of the 123 * requested mode, DLM_SBF_ALTMODE is returned 123 * requested mode, DLM_SBF_ALTMODE is returned in the lksb. 124 * 124 * 125 * DLM_LKF_ALTCW 125 * DLM_LKF_ALTCW 126 * 126 * 127 * The same as ALTPR, but the alternate mode i 127 * The same as ALTPR, but the alternate mode is CW. 128 * 128 * 129 * DLM_LKF_FORCEUNLOCK 129 * DLM_LKF_FORCEUNLOCK 130 * 130 * 131 * Unlock the lock even if it is converting or 131 * Unlock the lock even if it is converting or waiting or has sublocks. 132 * Only really for use by the userland device. 132 * Only really for use by the userland device.c code. 133 * 133 * 134 * DLM_LKF_TIMEOUT 134 * DLM_LKF_TIMEOUT 135 * 135 * 136 * This value is deprecated and reserved. DO N 136 * This value is deprecated and reserved. DO NOT USE! 137 * 137 * 138 */ 138 */ 139 139 140 #define DLM_LKF_NOQUEUE 0x00000001 140 #define DLM_LKF_NOQUEUE 0x00000001 141 #define DLM_LKF_CANCEL 0x00000002 141 #define DLM_LKF_CANCEL 0x00000002 142 #define DLM_LKF_CONVERT 0x00000004 142 #define DLM_LKF_CONVERT 0x00000004 143 #define DLM_LKF_VALBLK 0x00000008 143 #define DLM_LKF_VALBLK 0x00000008 144 #define DLM_LKF_QUECVT 0x00000010 144 #define DLM_LKF_QUECVT 0x00000010 145 #define DLM_LKF_IVVALBLK 0x00000020 145 #define DLM_LKF_IVVALBLK 0x00000020 146 #define DLM_LKF_CONVDEADLK 0x00000040 146 #define DLM_LKF_CONVDEADLK 0x00000040 147 #define DLM_LKF_PERSISTENT 0x00000080 147 #define DLM_LKF_PERSISTENT 0x00000080 148 #define DLM_LKF_NODLCKWT 0x00000100 148 #define DLM_LKF_NODLCKWT 0x00000100 149 #define DLM_LKF_NODLCKBLK 0x00000200 149 #define DLM_LKF_NODLCKBLK 0x00000200 150 #define DLM_LKF_EXPEDITE 0x00000400 150 #define DLM_LKF_EXPEDITE 0x00000400 151 #define DLM_LKF_NOQUEUEBAST 0x00000800 151 #define DLM_LKF_NOQUEUEBAST 0x00000800 152 #define DLM_LKF_HEADQUE 0x00001000 152 #define DLM_LKF_HEADQUE 0x00001000 153 #define DLM_LKF_NOORDER 0x00002000 153 #define DLM_LKF_NOORDER 0x00002000 154 #define DLM_LKF_ORPHAN 0x00004000 154 #define DLM_LKF_ORPHAN 0x00004000 155 #define DLM_LKF_ALTPR 0x00008000 155 #define DLM_LKF_ALTPR 0x00008000 156 #define DLM_LKF_ALTCW 0x00010000 156 #define DLM_LKF_ALTCW 0x00010000 157 #define DLM_LKF_FORCEUNLOCK 0x00020000 157 #define DLM_LKF_FORCEUNLOCK 0x00020000 158 #define DLM_LKF_TIMEOUT 0x00040000 158 #define DLM_LKF_TIMEOUT 0x00040000 159 159 160 /* 160 /* 161 * Some return codes that are not in errno.h 161 * Some return codes that are not in errno.h 162 */ 162 */ 163 163 164 #define DLM_ECANCEL 0x10001 164 #define DLM_ECANCEL 0x10001 165 #define DLM_EUNLOCK 0x10002 165 #define DLM_EUNLOCK 0x10002 166 166 167 #endif /* __DLMCONSTANTS_DOT_H__ */ 167 #endif /* __DLMCONSTANTS_DOT_H__ */ 168 168
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.