June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /****************************************************************************** 002: ******************************************************************************* 003: ** 004: ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 005: ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 006: ** 007: ** This copyrighted material is made available to anyone wishing to use, 008: ** modify, copy, or redistribute it subject to the terms and conditions 009: ** of the GNU General Public License v.2. 010: ** 011: ******************************************************************************* 012: ******************************************************************************/ 013: 014: #ifndef __DLMCONSTANTS_DOT_H__ 015: #define __DLMCONSTANTS_DOT_H__ 016: 017: /* 018: * Constants used by DLM interface. 019: */ 020: 021: #define DLM_LOCKSPACE_LEN 64 022: #define DLM_RESNAME_MAXLEN 64 023: 024: 025: /* 026: * Lock Modes 027: */ 028: 029: #define DLM_LOCK_IV (-1) /* invalid */ 030: #define DLM_LOCK_NL 0 /* null */ 031: #define DLM_LOCK_CR 1 /* concurrent read */ 032: #define DLM_LOCK_CW 2 /* concurrent write */ 033: #define DLM_LOCK_PR 3 /* protected read */ 034: #define DLM_LOCK_PW 4 /* protected write */ 035: #define DLM_LOCK_EX 5 /* exclusive */ 036: 037: 038: /* 039: * Flags to dlm_lock 040: * 041: * DLM_LKF_NOQUEUE 042: * 043: * Do not queue the lock request on the wait queue if it cannot be granted 044: * immediately. If the lock cannot be granted because of this flag, DLM will 045: * either return -EAGAIN from the dlm_lock call or will return 0 from 046: * dlm_lock and -EAGAIN in the lock status block when the AST is executed. 047: * 048: * DLM_LKF_CANCEL 049: * 050: * Used to cancel a pending lock request or conversion. A converting lock is 051: * returned to its previously granted mode. 052: * 053: * DLM_LKF_CONVERT 054: * 055: * Indicates a lock conversion request. For conversions the name and namelen 056: * are ignored and the lock ID in the LKSB is used to identify the lock. 057: * 058: * DLM_LKF_VALBLK 059: * 060: * Requests DLM to return the current contents of the lock value block in the 061: * lock status block. When this flag is set in a lock conversion from PW or EX 062: * modes, DLM assigns the value specified in the lock status block to the lock 063: * value block of the lock resource. The LVB is a DLM_LVB_LEN size array 064: * containing application-specific information. 065: * 066: * DLM_LKF_QUECVT 067: * 068: * Force a conversion request to be queued, even if it is compatible with 069: * the granted modes of other locks on the same resource. 070: * 071: * DLM_LKF_IVVALBLK 072: * 073: * Invalidate the lock value block. 074: * 075: * DLM_LKF_CONVDEADLK 076: * 077: * Allows the dlm to resolve conversion deadlocks internally by demoting the 078: * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is 079: * returned for a conversion that's been effected by this. 080: * 081: * DLM_LKF_PERSISTENT 082: * 083: * Only relevant to locks originating in userspace. A persistent lock will not 084: * be removed if the process holding the lock exits. 085: * 086: * DLM_LKF_NODLCKWT 087: * 088: * Do not cancel the lock if it gets into conversion deadlock. 089: * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN. 090: * 091: * DLM_LKF_NODLCKBLK 092: * 093: * net yet implemented 094: * 095: * DLM_LKF_EXPEDITE 096: * 097: * Used only with new requests for NL mode locks. Tells the lock manager 098: * to grant the lock, ignoring other locks in convert and wait queues. 099: * 100: * DLM_LKF_NOQUEUEBAST 101: * 102: * Send blocking AST's before returning -EAGAIN to the caller. It is only 103: * used along with the NOQUEUE flag. Blocking AST's are not sent for failed 104: * NOQUEUE requests otherwise. 105: * 106: * DLM_LKF_HEADQUE 107: * 108: * Add a lock to the head of the convert or wait queue rather than the tail. 109: * 110: * DLM_LKF_NOORDER 111: * 112: * Disregard the standard grant order rules and grant a lock as soon as it 113: * is compatible with other granted locks. 114: * 115: * DLM_LKF_ORPHAN 116: * 117: * not yet implemented 118: * 119: * DLM_LKF_ALTPR 120: * 121: * If the requested mode cannot be granted immediately, try to grant the lock 122: * in PR mode instead. If this alternate mode is granted instead of the 123: * requested mode, DLM_SBF_ALTMODE is returned in the lksb. 124: * 125: * DLM_LKF_ALTCW 126: * 127: * The same as ALTPR, but the alternate mode is CW. 128: * 129: * DLM_LKF_FORCEUNLOCK 130: * 131: * Unlock the lock even if it is converting or waiting or has sublocks. 132: * Only really for use by the userland device.c code. 133: * 134: */ 135: 136: #define DLM_LKF_NOQUEUE 0x00000001 137: #define DLM_LKF_CANCEL 0x00000002 138: #define DLM_LKF_CONVERT 0x00000004 139: #define DLM_LKF_VALBLK 0x00000008 140: #define DLM_LKF_QUECVT 0x00000010 141: #define DLM_LKF_IVVALBLK 0x00000020 142: #define DLM_LKF_CONVDEADLK 0x00000040 143: #define DLM_LKF_PERSISTENT 0x00000080 144: #define DLM_LKF_NODLCKWT 0x00000100 145: #define DLM_LKF_NODLCKBLK 0x00000200 146: #define DLM_LKF_EXPEDITE 0x00000400 147: #define DLM_LKF_NOQUEUEBAST 0x00000800 148: #define DLM_LKF_HEADQUE 0x00001000 149: #define DLM_LKF_NOORDER 0x00002000 150: #define DLM_LKF_ORPHAN 0x00004000 151: #define DLM_LKF_ALTPR 0x00008000 152: #define DLM_LKF_ALTCW 0x00010000 153: #define DLM_LKF_FORCEUNLOCK 0x00020000 154: #define DLM_LKF_TIMEOUT 0x00040000 155: 156: /* 157: * Some return codes that are not in errno.h 158: */ 159: 160: #define DLM_ECANCEL 0x10001 161: #define DLM_EUNLOCK 0x10002 162: 163: #endif /* __DLMCONSTANTS_DOT_H__ */ 164: