Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
dlmapi.h File Reference

Go to the source code of this file.

Data Structures

struct  dlm_lockstatus
 
struct  dlm_protocol_version
 
struct  dlm_eviction_cb
 

Macros

#define dlm_error(st)
 
#define DLM_LKSB_UNUSED1   0x01
 
#define DLM_LKSB_PUT_LVB   0x02
 
#define DLM_LKSB_GET_LVB   0x04
 
#define DLM_LKSB_UNUSED2   0x08
 
#define DLM_LKSB_UNUSED3   0x10
 
#define DLM_LKSB_UNUSED4   0x20
 
#define DLM_LKSB_UNUSED5   0x40
 
#define DLM_LKSB_UNUSED6   0x80
 
#define DLM_LVB_LEN   64
 
#define LKM_IVMODE   (-1) /* invalid mode */
 
#define LKM_NLMODE   0 /* null lock */
 
#define LKM_CRMODE   1 /* concurrent read unsupported */
 
#define LKM_CWMODE   2 /* concurrent write unsupported */
 
#define LKM_PRMODE   3 /* protected read */
 
#define LKM_PWMODE   4 /* protected write unsupported */
 
#define LKM_EXMODE   5 /* exclusive */
 
#define LKM_MAXMODE   5
 
#define LKM_MODEMASK   0xff
 
#define LKM_ORPHAN   0x00000010 /* this lock is orphanable (U) */
 
#define LKM_PARENTABLE   0x00000020 /* this lock was orphaned (U) */
 
#define LKM_BLOCK   0x00000040 /* blocking lock request (U) */
 
#define LKM_LOCAL   0x00000080 /* local lock request */
 
#define LKM_VALBLK   0x00000100 /* lock value block request */
 
#define LKM_NOQUEUE   0x00000200 /* non blocking request */
 
#define LKM_CONVERT   0x00000400 /* conversion request */
 
#define LKM_NODLCKWT   0x00000800 /* this lock wont deadlock (U) */
 
#define LKM_UNLOCK   0x00001000 /* deallocate this lock */
 
#define LKM_CANCEL   0x00002000 /* cancel conversion request */
 
#define LKM_DEQALL   0x00004000 /* remove all locks held by proc (U) */
 
#define LKM_INVVALBLK   0x00008000 /* invalidate lock value block */
 
#define LKM_SYNCSTS   0x00010000 /* return synchronous status if poss (U) */
 
#define LKM_TIMEOUT   0x00020000 /* lock request contains timeout (U) */
 
#define LKM_SNGLDLCK   0x00040000 /* request can self-deadlock (U) */
 
#define LKM_FINDLOCAL   0x00080000 /* find local lock request (U) */
 
#define LKM_PROC_OWNED   0x00100000 /* owned by process, not group (U) */
 
#define LKM_XID   0x00200000 /* use transaction id for deadlock (U) */
 
#define LKM_XID_CONFLICT   0x00400000 /* do not allow lock inheritance (U) */
 
#define LKM_FORCE   0x00800000 /* force unlock flag */
 
#define LKM_REVVALBLK
 
#define LKM_UNUSED1   0x00000001 /* unused */
 
#define LKM_UNUSED2   0x00000002 /* unused */
 
#define LKM_UNUSED3   0x00000004 /* unused */
 
#define LKM_UNUSED4   0x00000008 /* unused */
 
#define LKM_UNUSED5   0x02000000 /* unused */
 
#define LKM_UNUSED6   0x04000000 /* unused */
 
#define LKM_UNUSED7   0x08000000 /* unused */
 
#define LKM_MIGRATION
 
#define LKM_PUT_LVB
 
#define LKM_GET_LVB
 
#define LKM_RECOVERY
 

Typedefs

typedef voiddlm_astlockfunc_t )(void *)
 
typedef voiddlm_bastlockfunc_t )(void *, int)
 
typedef voiddlm_astunlockfunc_t )(void *, enum dlm_status)
 
typedef voiddlm_eviction_func )(int, void *)
 

Enumerations

enum  dlm_status {
  DLM_NORMAL = 0, DLM_GRANTED, DLM_DENIED, DLM_DENIED_NOLOCKS,
  DLM_WORKING, DLM_BLOCKED, DLM_BLOCKED_ORPHAN, DLM_DENIED_GRACE_PERIOD,
  DLM_SYSERR, DLM_NOSUPPORT, DLM_CANCELGRANT, DLM_IVLOCKID,
  DLM_SYNC, DLM_BADTYPE, DLM_BADRESOURCE, DLM_MAXHANDLES,
  DLM_NOCLINFO, DLM_NOLOCKMGR, DLM_NOPURGED, DLM_BADARGS,
  DLM_VOID, DLM_NOTQUEUED, DLM_IVBUFLEN, DLM_CVTUNGRANT,
  DLM_BADPARAM, DLM_VALNOTVALID, DLM_REJECTED, DLM_ABORT,
  DLM_CANCEL, DLM_IVRESHANDLE, DLM_DEADLOCK, DLM_DENIED_NOASTS,
  DLM_FORWARD, DLM_TIMEOUT, DLM_IVGROUPID, DLM_VERS_CONFLICT,
  DLM_BAD_DEVICE_PATH, DLM_NO_DEVICE_PERMISSION, DLM_NO_CONTROL_DEVICE, DLM_RECOVERING,
  DLM_MIGRATING, DLM_MAXSTATS
}
 

Functions

const chardlm_errmsg (enum dlm_status err)
 
const chardlm_errname (enum dlm_status err)
 
enum dlm_status dlmlock (struct dlm_ctxt *dlm, int mode, struct dlm_lockstatus *lksb, int flags, const char *name, int namelen, dlm_astlockfunc_t *ast, void *data, dlm_bastlockfunc_t *bast)
 
enum dlm_status dlmunlock (struct dlm_ctxt *dlm, struct dlm_lockstatus *lksb, int flags, dlm_astunlockfunc_t *unlockast, void *data)
 
struct dlm_ctxtdlm_register_domain (const char *domain, u32 key, struct dlm_protocol_version *fs_proto)
 
void dlm_unregister_domain (struct dlm_ctxt *dlm)
 
void dlm_print_one_lock (struct dlm_lock *lockid)
 
void dlm_setup_eviction_cb (struct dlm_eviction_cb *cb, dlm_eviction_func *f, void *data)
 
void dlm_register_eviction_cb (struct dlm_ctxt *dlm, struct dlm_eviction_cb *cb)
 
void dlm_unregister_eviction_cb (struct dlm_eviction_cb *cb)
 

Macro Definition Documentation

#define dlm_error (   st)
Value:
do { \
if ((st) != DLM_RECOVERING && \
(st) != DLM_MIGRATING && \
(st) != DLM_FORWARD) \
mlog(ML_ERROR, "dlm status = %s\n", dlm_errname((st))); \
} while (0)

Definition at line 91 of file dlmapi.h.

#define DLM_LKSB_GET_LVB   0x04

Definition at line 100 of file dlmapi.h.

#define DLM_LKSB_PUT_LVB   0x02

Definition at line 99 of file dlmapi.h.

#define DLM_LKSB_UNUSED1   0x01

Definition at line 98 of file dlmapi.h.

#define DLM_LKSB_UNUSED2   0x08

Definition at line 101 of file dlmapi.h.

#define DLM_LKSB_UNUSED3   0x10

Definition at line 102 of file dlmapi.h.

#define DLM_LKSB_UNUSED4   0x20

Definition at line 103 of file dlmapi.h.

#define DLM_LKSB_UNUSED5   0x40

Definition at line 104 of file dlmapi.h.

#define DLM_LKSB_UNUSED6   0x80

Definition at line 105 of file dlmapi.h.

#define DLM_LVB_LEN   64

Definition at line 107 of file dlmapi.h.

#define LKM_BLOCK   0x00000040 /* blocking lock request (U) */

Definition at line 135 of file dlmapi.h.

#define LKM_CANCEL   0x00002000 /* cancel conversion request */

Definition at line 142 of file dlmapi.h.

#define LKM_CONVERT   0x00000400 /* conversion request */

Definition at line 139 of file dlmapi.h.

#define LKM_CRMODE   1 /* concurrent read unsupported */

Definition at line 121 of file dlmapi.h.

#define LKM_CWMODE   2 /* concurrent write unsupported */

Definition at line 122 of file dlmapi.h.

#define LKM_DEQALL   0x00004000 /* remove all locks held by proc (U) */

Definition at line 143 of file dlmapi.h.

#define LKM_EXMODE   5 /* exclusive */

Definition at line 125 of file dlmapi.h.

#define LKM_FINDLOCAL   0x00080000 /* find local lock request (U) */

Definition at line 148 of file dlmapi.h.

#define LKM_FORCE   0x00800000 /* force unlock flag */

Definition at line 152 of file dlmapi.h.

#define LKM_GET_LVB
Value:
0x40000000 /* extension: lvb should be copied
from lockres when lock is granted */

Definition at line 167 of file dlmapi.h.

#define LKM_INVVALBLK   0x00008000 /* invalidate lock value block */

Definition at line 144 of file dlmapi.h.

#define LKM_IVMODE   (-1) /* invalid mode */

Definition at line 119 of file dlmapi.h.

#define LKM_LOCAL   0x00000080 /* local lock request */

Definition at line 136 of file dlmapi.h.

#define LKM_MAXMODE   5

Definition at line 126 of file dlmapi.h.

#define LKM_MIGRATION
Value:
0x10000000 /* extension: lockres is to be migrated
to another node */

Definition at line 165 of file dlmapi.h.

#define LKM_MODEMASK   0xff

Definition at line 127 of file dlmapi.h.

#define LKM_NLMODE   0 /* null lock */

Definition at line 120 of file dlmapi.h.

#define LKM_NODLCKWT   0x00000800 /* this lock wont deadlock (U) */

Definition at line 140 of file dlmapi.h.

#define LKM_NOQUEUE   0x00000200 /* non blocking request */

Definition at line 138 of file dlmapi.h.

#define LKM_ORPHAN   0x00000010 /* this lock is orphanable (U) */

Definition at line 133 of file dlmapi.h.

#define LKM_PARENTABLE   0x00000020 /* this lock was orphaned (U) */

Definition at line 134 of file dlmapi.h.

#define LKM_PRMODE   3 /* protected read */

Definition at line 123 of file dlmapi.h.

#define LKM_PROC_OWNED   0x00100000 /* owned by process, not group (U) */

Definition at line 149 of file dlmapi.h.

#define LKM_PUT_LVB
Value:
0x20000000 /* extension: lvb is being passed
should be applied to lockres */

Definition at line 166 of file dlmapi.h.

#define LKM_PWMODE   4 /* protected write unsupported */

Definition at line 124 of file dlmapi.h.

#define LKM_RECOVERY
Value:
0x80000000 /* extension: flag for recovery lock
used to avoid recovery rwsem */

Definition at line 168 of file dlmapi.h.

#define LKM_REVVALBLK
Value:
0x01000000 /* temporary solution: re-validate
lock value block (U) */

Definition at line 153 of file dlmapi.h.

#define LKM_SNGLDLCK   0x00040000 /* request can self-deadlock (U) */

Definition at line 147 of file dlmapi.h.

#define LKM_SYNCSTS   0x00010000 /* return synchronous status if poss (U) */

Definition at line 145 of file dlmapi.h.

#define LKM_TIMEOUT   0x00020000 /* lock request contains timeout (U) */

Definition at line 146 of file dlmapi.h.

#define LKM_UNLOCK   0x00001000 /* deallocate this lock */

Definition at line 141 of file dlmapi.h.

#define LKM_UNUSED1   0x00000001 /* unused */

Definition at line 155 of file dlmapi.h.

#define LKM_UNUSED2   0x00000002 /* unused */

Definition at line 156 of file dlmapi.h.

#define LKM_UNUSED3   0x00000004 /* unused */

Definition at line 157 of file dlmapi.h.

#define LKM_UNUSED4   0x00000008 /* unused */

Definition at line 158 of file dlmapi.h.

#define LKM_UNUSED5   0x02000000 /* unused */

Definition at line 159 of file dlmapi.h.

#define LKM_UNUSED6   0x04000000 /* unused */

Definition at line 160 of file dlmapi.h.

#define LKM_UNUSED7   0x08000000 /* unused */

Definition at line 161 of file dlmapi.h.

#define LKM_VALBLK   0x00000100 /* lock value block request */

Definition at line 137 of file dlmapi.h.

#define LKM_XID   0x00200000 /* use transaction id for deadlock (U) */

Definition at line 150 of file dlmapi.h.

#define LKM_XID_CONFLICT   0x00400000 /* do not allow lock inheritance (U) */

Definition at line 151 of file dlmapi.h.

Typedef Documentation

typedef void( dlm_astlockfunc_t)(void *)

Definition at line 171 of file dlmapi.h.

typedef void( dlm_astunlockfunc_t)(void *, enum dlm_status)

Definition at line 173 of file dlmapi.h.

typedef void( dlm_bastlockfunc_t)(void *, int)

Definition at line 172 of file dlmapi.h.

typedef void( dlm_eviction_func)(int, void *)

Definition at line 202 of file dlmapi.h.

Enumeration Type Documentation

enum dlm_status
Enumerator:
DLM_NORMAL 
DLM_GRANTED 
DLM_DENIED 
DLM_DENIED_NOLOCKS 
DLM_WORKING 
DLM_BLOCKED 
DLM_BLOCKED_ORPHAN 
DLM_DENIED_GRACE_PERIOD 
DLM_SYSERR 
DLM_NOSUPPORT 
DLM_CANCELGRANT 
DLM_IVLOCKID 
DLM_SYNC 
DLM_BADTYPE 
DLM_BADRESOURCE 
DLM_MAXHANDLES 
DLM_NOCLINFO 
DLM_NOLOCKMGR 
DLM_NOPURGED 
DLM_BADARGS 
DLM_VOID 
DLM_NOTQUEUED 
DLM_IVBUFLEN 
DLM_CVTUNGRANT 
DLM_BADPARAM 
DLM_VALNOTVALID 
DLM_REJECTED 
DLM_ABORT 
DLM_CANCEL 
DLM_IVRESHANDLE 
DLM_DEADLOCK 
DLM_DENIED_NOASTS 
DLM_FORWARD 
DLM_TIMEOUT 
DLM_IVGROUPID 
DLM_VERS_CONFLICT 
DLM_BAD_DEVICE_PATH 
DLM_NO_DEVICE_PERMISSION 
DLM_NO_CONTROL_DEVICE 
DLM_RECOVERING 
DLM_MIGRATING 
DLM_MAXSTATS 

Definition at line 34 of file dlmapi.h.

Function Documentation

const char* dlm_errmsg ( enum dlm_status  err)

Definition at line 233 of file dlmdebug.c.

const char* dlm_errname ( enum dlm_status  err)

Definition at line 241 of file dlmdebug.c.

void dlm_print_one_lock ( struct dlm_lock lockid)

Definition at line 137 of file dlmdebug.c.

struct dlm_ctxt* dlm_register_domain ( const char domain,
u32  key,
struct dlm_protocol_version fs_proto 
)
read

Definition at line 2127 of file dlmdomain.c.

void dlm_register_eviction_cb ( struct dlm_ctxt dlm,
struct dlm_eviction_cb cb 
)

Definition at line 2323 of file dlmdomain.c.

void dlm_setup_eviction_cb ( struct dlm_eviction_cb cb,
dlm_eviction_func f,
void data 
)

Definition at line 2313 of file dlmdomain.c.

void dlm_unregister_domain ( struct dlm_ctxt dlm)

Definition at line 717 of file dlmdomain.c.

void dlm_unregister_eviction_cb ( struct dlm_eviction_cb cb)

Definition at line 2332 of file dlmdomain.c.

enum dlm_status dlmlock ( struct dlm_ctxt dlm,
int  mode,
struct dlm_lockstatus lksb,
int  flags,
const char name,
int  namelen,
dlm_astlockfunc_t ast,
void data,
dlm_bastlockfunc_t bast 
)

Definition at line 562 of file dlmlock.c.

enum dlm_status dlmunlock ( struct dlm_ctxt dlm,
struct dlm_lockstatus lksb,
int  flags,
dlm_astunlockfunc_t unlockast,
void data 
)

Definition at line 583 of file dlmunlock.c.