Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
dlm_internal.h File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/spinlock.h>
#include <linux/vmalloc.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/random.h>
#include <linux/delay.h>
#include <linux/socket.h>
#include <linux/kthread.h>
#include <linux/kobject.h>
#include <linux/kref.h>
#include <linux/kernel.h>
#include <linux/jhash.h>
#include <linux/miscdevice.h>
#include <linux/mutex.h>
#include <linux/idr.h>
#include <linux/ratelimit.h>
#include <asm/uaccess.h>
#include <linux/dlm.h>
#include "config.h"

Go to the source code of this file.

Data Structures

struct  dlm_rsbtable
 
struct  dlm_member
 
struct  dlm_recover
 
struct  dlm_args
 
struct  dlm_callback
 
struct  dlm_lkb
 
struct  dlm_rsb
 
struct  dlm_header
 
struct  dlm_message
 
struct  dlm_rcom
 
union  dlm_packet
 
struct  rcom_status
 
struct  rcom_config
 
struct  rcom_slot
 
struct  rcom_lock
 
struct  dlm_ls
 
struct  dlm_user_args
 
struct  dlm_user_proc
 

Macros

#define DLM_INBUF_LEN   148
 
#define log_print(fmt, args...)   printk(KERN_ERR "dlm: "fmt"\n" , ##args)
 
#define log_error(ls, fmt, args...)   printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args)
 
#define log_debug(ls, fmt, args...)
 
#define log_limit(ls, fmt, args...)
 
#define DLM_ASSERT(x, do)
 
#define DLM_LKSTS_WAITING   1
 
#define DLM_LKSTS_GRANTED   2
 
#define DLM_LKSTS_CONVERT   3
 
#define DLM_IFL_MSTCPY   0x00010000
 
#define DLM_IFL_RESEND   0x00020000
 
#define DLM_IFL_DEAD   0x00040000
 
#define DLM_IFL_OVERLAP_UNLOCK   0x00080000
 
#define DLM_IFL_OVERLAP_CANCEL   0x00100000
 
#define DLM_IFL_ENDOFLIFE   0x00200000
 
#define DLM_IFL_WATCH_TIMEWARN   0x00400000
 
#define DLM_IFL_TIMEOUT_CANCEL   0x00800000
 
#define DLM_IFL_DEADLOCK_CANCEL   0x01000000
 
#define DLM_IFL_STUB_MS   0x02000000 /* magic number for m_flags */
 
#define DLM_IFL_USER   0x00000001
 
#define DLM_IFL_ORPHAN   0x00000002
 
#define DLM_CALLBACKS_SIZE   6
 
#define DLM_CB_CAST   0x00000001
 
#define DLM_CB_BAST   0x00000002
 
#define DLM_CB_SKIP   0x00000004
 
#define DLM_LU_RECOVER_DIR   1
 
#define DLM_LU_RECOVER_MASTER   2
 
#define DLM_LU_MATCH   1
 
#define DLM_LU_ADD   2
 
#define R_REQUEST   0x00000001
 
#define R_RECEIVE_REQUEST   0x00000002
 
#define R_RECEIVE_RECOVER   0x00000004
 
#define DLM_HEADER_MAJOR   0x00030000
 
#define DLM_HEADER_MINOR   0x00000001
 
#define DLM_HEADER_SLOTS   0x00000001
 
#define DLM_MSG   1
 
#define DLM_RCOM   2
 
#define DLM_MSG_REQUEST   1
 
#define DLM_MSG_CONVERT   2
 
#define DLM_MSG_UNLOCK   3
 
#define DLM_MSG_CANCEL   4
 
#define DLM_MSG_REQUEST_REPLY   5
 
#define DLM_MSG_CONVERT_REPLY   6
 
#define DLM_MSG_UNLOCK_REPLY   7
 
#define DLM_MSG_CANCEL_REPLY   8
 
#define DLM_MSG_GRANT   9
 
#define DLM_MSG_BAST   10
 
#define DLM_MSG_LOOKUP   11
 
#define DLM_MSG_REMOVE   12
 
#define DLM_MSG_LOOKUP_REPLY   13
 
#define DLM_MSG_PURGE   14
 
#define DLM_RS_NODES   0x00000001
 
#define DLM_RS_NODES_ALL   0x00000002
 
#define DLM_RS_DIR   0x00000004
 
#define DLM_RS_DIR_ALL   0x00000008
 
#define DLM_RS_LOCKS   0x00000010
 
#define DLM_RS_LOCKS_ALL   0x00000020
 
#define DLM_RS_DONE   0x00000040
 
#define DLM_RS_DONE_ALL   0x00000080
 
#define DLM_RCOM_STATUS   1
 
#define DLM_RCOM_NAMES   2
 
#define DLM_RCOM_LOOKUP   3
 
#define DLM_RCOM_LOCK   4
 
#define DLM_RCOM_STATUS_REPLY   5
 
#define DLM_RCOM_NAMES_REPLY   6
 
#define DLM_RCOM_LOOKUP_REPLY   7
 
#define DLM_RCOM_LOCK_REPLY   8
 
#define DLM_RSF_NEED_SLOTS   0x00000001
 
#define DLM_REMOVE_NAMES_MAX   8
 
#define LSFL_RECOVER_STOP   0
 
#define LSFL_RECOVER_DOWN   1
 
#define LSFL_RECOVER_LOCK   2
 
#define LSFL_RECOVER_WORK   3
 
#define LSFL_RUNNING   4
 
#define LSFL_RCOM_READY   5
 
#define LSFL_RCOM_WAIT   6
 
#define LSFL_UEVENT_WAIT   7
 
#define LSFL_TIMEWARN   8
 
#define LSFL_CB_DELAY   9
 
#define LSFL_NODIR   10
 
#define DLM_PROC_FLAGS_CLOSING   1
 
#define DLM_PROC_FLAGS_COMPAT   2
 

Enumerations

enum  rsb_flags {
  RSB_MASTER_UNCERTAIN, RSB_VALNOTVALID, RSB_VALNOTVALID_PREV, RSB_NEW_MASTER,
  RSB_NEW_MASTER2, RSB_RECOVER_CONVERT, RSB_RECOVER_GRANT
}
 

Functions

int dlm_netlink_init (void)
 
void dlm_netlink_exit (void)
 
void dlm_timeout_warn (struct dlm_lkb *lkb)
 
int dlm_plock_init (void)
 
void dlm_plock_exit (void)
 

Macro Definition Documentation

#define DLM_ASSERT (   x,
  do 
)
Value:
{ \
if (!(x)) \
{ \
printk(KERN_ERR "\nDLM: Assertion failed on line %d of file %s\n" \
"DLM: assertion: \"%s\"\n" \
"DLM: time = %lu\n", \
__LINE__, __FILE__, #x, jiffies); \
{do} \
printk("\n"); \
BUG(); \
panic("DLM: Record message above and reboot.\n"); \
} \
}

Definition at line 83 of file dlm_internal.h.

#define DLM_CALLBACKS_SIZE   6

Definition at line 207 of file dlm_internal.h.

#define DLM_CB_BAST   0x00000002

Definition at line 210 of file dlm_internal.h.

#define DLM_CB_CAST   0x00000001

Definition at line 209 of file dlm_internal.h.

#define DLM_CB_SKIP   0x00000004

Definition at line 211 of file dlm_internal.h.

#define DLM_HEADER_MAJOR   0x00030000

Definition at line 360 of file dlm_internal.h.

#define DLM_HEADER_MINOR   0x00000001

Definition at line 361 of file dlm_internal.h.

#define DLM_HEADER_SLOTS   0x00000001

Definition at line 363 of file dlm_internal.h.

#define DLM_IFL_DEAD   0x00040000

Definition at line 196 of file dlm_internal.h.

#define DLM_IFL_DEADLOCK_CANCEL   0x01000000

Definition at line 202 of file dlm_internal.h.

#define DLM_IFL_ENDOFLIFE   0x00200000

Definition at line 199 of file dlm_internal.h.

#define DLM_IFL_MSTCPY   0x00010000

Definition at line 194 of file dlm_internal.h.

#define DLM_IFL_ORPHAN   0x00000002

Definition at line 205 of file dlm_internal.h.

#define DLM_IFL_OVERLAP_CANCEL   0x00100000

Definition at line 198 of file dlm_internal.h.

#define DLM_IFL_OVERLAP_UNLOCK   0x00080000

Definition at line 197 of file dlm_internal.h.

#define DLM_IFL_RESEND   0x00020000

Definition at line 195 of file dlm_internal.h.

#define DLM_IFL_STUB_MS   0x02000000 /* magic number for m_flags */

Definition at line 203 of file dlm_internal.h.

#define DLM_IFL_TIMEOUT_CANCEL   0x00800000

Definition at line 201 of file dlm_internal.h.

#define DLM_IFL_USER   0x00000001

Definition at line 204 of file dlm_internal.h.

#define DLM_IFL_WATCH_TIMEWARN   0x00400000

Definition at line 200 of file dlm_internal.h.

#define DLM_INBUF_LEN   148

Definition at line 51 of file dlm_internal.h.

#define DLM_LKSTS_CONVERT   3

Definition at line 190 of file dlm_internal.h.

#define DLM_LKSTS_GRANTED   2

Definition at line 189 of file dlm_internal.h.

#define DLM_LKSTS_WAITING   1

Definition at line 188 of file dlm_internal.h.

#define DLM_LU_ADD   2

Definition at line 322 of file dlm_internal.h.

#define DLM_LU_MATCH   1

Definition at line 321 of file dlm_internal.h.

#define DLM_LU_RECOVER_DIR   1

Definition at line 316 of file dlm_internal.h.

#define DLM_LU_RECOVER_MASTER   2

Definition at line 317 of file dlm_internal.h.

#define DLM_MSG   1

Definition at line 365 of file dlm_internal.h.

#define DLM_MSG_BAST   10

Definition at line 387 of file dlm_internal.h.

#define DLM_MSG_CANCEL   4

Definition at line 381 of file dlm_internal.h.

#define DLM_MSG_CANCEL_REPLY   8

Definition at line 385 of file dlm_internal.h.

#define DLM_MSG_CONVERT   2

Definition at line 379 of file dlm_internal.h.

#define DLM_MSG_CONVERT_REPLY   6

Definition at line 383 of file dlm_internal.h.

#define DLM_MSG_GRANT   9

Definition at line 386 of file dlm_internal.h.

#define DLM_MSG_LOOKUP   11

Definition at line 388 of file dlm_internal.h.

#define DLM_MSG_LOOKUP_REPLY   13

Definition at line 390 of file dlm_internal.h.

#define DLM_MSG_PURGE   14

Definition at line 391 of file dlm_internal.h.

#define DLM_MSG_REMOVE   12

Definition at line 389 of file dlm_internal.h.

#define DLM_MSG_REQUEST   1

Definition at line 378 of file dlm_internal.h.

#define DLM_MSG_REQUEST_REPLY   5

Definition at line 382 of file dlm_internal.h.

#define DLM_MSG_UNLOCK   3

Definition at line 380 of file dlm_internal.h.

#define DLM_MSG_UNLOCK_REPLY   7

Definition at line 384 of file dlm_internal.h.

#define DLM_PROC_FLAGS_CLOSING   1

Definition at line 672 of file dlm_internal.h.

#define DLM_PROC_FLAGS_COMPAT   2

Definition at line 673 of file dlm_internal.h.

#define DLM_RCOM   2

Definition at line 366 of file dlm_internal.h.

#define DLM_RCOM_LOCK   4

Definition at line 429 of file dlm_internal.h.

#define DLM_RCOM_LOCK_REPLY   8

Definition at line 433 of file dlm_internal.h.

#define DLM_RCOM_LOOKUP   3

Definition at line 428 of file dlm_internal.h.

#define DLM_RCOM_LOOKUP_REPLY   7

Definition at line 432 of file dlm_internal.h.

#define DLM_RCOM_NAMES   2

Definition at line 427 of file dlm_internal.h.

#define DLM_RCOM_NAMES_REPLY   6

Definition at line 431 of file dlm_internal.h.

#define DLM_RCOM_STATUS   1

Definition at line 426 of file dlm_internal.h.

#define DLM_RCOM_STATUS_REPLY   5

Definition at line 430 of file dlm_internal.h.

#define DLM_REMOVE_NAMES_MAX   8

Definition at line 506 of file dlm_internal.h.

#define DLM_RS_DIR   0x00000004

Definition at line 419 of file dlm_internal.h.

#define DLM_RS_DIR_ALL   0x00000008

Definition at line 420 of file dlm_internal.h.

#define DLM_RS_DONE   0x00000040

Definition at line 423 of file dlm_internal.h.

#define DLM_RS_DONE_ALL   0x00000080

Definition at line 424 of file dlm_internal.h.

#define DLM_RS_LOCKS   0x00000010

Definition at line 421 of file dlm_internal.h.

#define DLM_RS_LOCKS_ALL   0x00000020

Definition at line 422 of file dlm_internal.h.

#define DLM_RS_NODES   0x00000001

Definition at line 417 of file dlm_internal.h.

#define DLM_RS_NODES_ALL   0x00000002

Definition at line 418 of file dlm_internal.h.

#define DLM_RSF_NEED_SLOTS   0x00000001

Definition at line 451 of file dlm_internal.h.

#define log_debug (   ls,
  fmt,
  args... 
)
Value:
do { \
if (dlm_config.ci_log_debug) \
printk(KERN_DEBUG "dlm: %s: " fmt "\n", \
(ls)->ls_name , ##args); \
} while (0)

Definition at line 69 of file dlm_internal.h.

#define log_error (   ls,
  fmt,
  args... 
)    printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args)

Definition at line 66 of file dlm_internal.h.

#define log_limit (   ls,
  fmt,
  args... 
)
Value:
do { \
if (dlm_config.ci_log_debug) \
printk_ratelimited(KERN_DEBUG "dlm: %s: " fmt "\n", \
(ls)->ls_name , ##args); \
} while (0)

Definition at line 76 of file dlm_internal.h.

#define log_print (   fmt,
  args... 
)    printk(KERN_ERR "dlm: "fmt"\n" , ##args)

Definition at line 64 of file dlm_internal.h.

#define LSFL_CB_DELAY   9

Definition at line 652 of file dlm_internal.h.

#define LSFL_NODIR   10

Definition at line 653 of file dlm_internal.h.

#define LSFL_RCOM_READY   5

Definition at line 648 of file dlm_internal.h.

#define LSFL_RCOM_WAIT   6

Definition at line 649 of file dlm_internal.h.

#define LSFL_RECOVER_DOWN   1

Definition at line 643 of file dlm_internal.h.

#define LSFL_RECOVER_LOCK   2

Definition at line 644 of file dlm_internal.h.

#define LSFL_RECOVER_STOP   0

Definition at line 642 of file dlm_internal.h.

#define LSFL_RECOVER_WORK   3

Definition at line 645 of file dlm_internal.h.

#define LSFL_RUNNING   4

Definition at line 646 of file dlm_internal.h.

#define LSFL_TIMEWARN   8

Definition at line 651 of file dlm_internal.h.

#define LSFL_UEVENT_WAIT   7

Definition at line 650 of file dlm_internal.h.

#define R_RECEIVE_RECOVER   0x00000004

Definition at line 328 of file dlm_internal.h.

#define R_RECEIVE_REQUEST   0x00000002

Definition at line 327 of file dlm_internal.h.

#define R_REQUEST   0x00000001

Definition at line 326 of file dlm_internal.h.

Enumeration Type Documentation

enum rsb_flags
Enumerator:
RSB_MASTER_UNCERTAIN 
RSB_VALNOTVALID 
RSB_VALNOTVALID_PREV 
RSB_NEW_MASTER 
RSB_NEW_MASTER2 
RSB_RECOVER_CONVERT 
RSB_RECOVER_GRANT 

Definition at line 332 of file dlm_internal.h.

Function Documentation

void dlm_netlink_exit ( void  )

Definition at line 87 of file netlink.c.

int dlm_netlink_init ( void  )

Definition at line 82 of file netlink.c.

void dlm_plock_exit ( void  )

Definition at line 498 of file plock.c.

int dlm_plock_init ( void  )

Definition at line 482 of file plock.c.

void dlm_timeout_warn ( struct dlm_lkb lkb)

Definition at line 115 of file netlink.c.