aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dlm_device.h
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-01-18 04:30:29 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-01-18 04:30:29 -0500
commite7fd41792fc0ee52a05fcaac87511f118328d147 (patch)
treeeee5227088ba97daef795e385b7548d2a1cc4cb6 /include/linux/dlm_device.h
parente47314207032cfd1157b8c377df162839b32ea6f (diff)
[DLM] The core of the DLM for GFS2/CLVM
This is the core of the distributed lock manager which is required to use GFS2 as a cluster filesystem. It is also used by CLVM and can be used as a standalone lock manager independantly of either of these two projects. It implements VAX-style locking modes. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steve Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'include/linux/dlm_device.h')
-rw-r--r--include/linux/dlm_device.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h
new file mode 100644
index 000000000000..5e17d295544b
--- /dev/null
+++ b/include/linux/dlm_device.h
@@ -0,0 +1,84 @@
1/******************************************************************************
2*******************************************************************************
3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
6**
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.
10**
11*******************************************************************************
12******************************************************************************/
13
14/* This is the device interface for dlm, most users will use a library
15 * interface.
16 */
17
18#define DLM_USER_LVB_LEN 32
19
20/* Version of the device interface */
21#define DLM_DEVICE_VERSION_MAJOR 3
22#define DLM_DEVICE_VERSION_MINOR 0
23#define DLM_DEVICE_VERSION_PATCH 0
24
25/* struct passed to the lock write */
26struct dlm_lock_params {
27 __u8 mode;
28 __u16 flags;
29 __u32 lkid;
30 __u32 parent;
31 struct dlm_range range;
32 __u8 namelen;
33 void __user *castparam;
34 void __user *castaddr;
35 void __user *bastparam;
36 void __user *bastaddr;
37 struct dlm_lksb __user *lksb;
38 char lvb[DLM_USER_LVB_LEN];
39 char name[1];
40};
41
42struct dlm_lspace_params {
43 __u32 flags;
44 __u32 minor;
45 char name[1];
46};
47
48struct dlm_write_request {
49 __u32 version[3];
50 __u8 cmd;
51
52 union {
53 struct dlm_lock_params lock;
54 struct dlm_lspace_params lspace;
55 } i;
56};
57
58/* struct read from the "device" fd,
59 consists mainly of userspace pointers for the library to use */
60struct dlm_lock_result {
61 __u32 length;
62 void __user * user_astaddr;
63 void __user * user_astparam;
64 struct dlm_lksb __user * user_lksb;
65 struct dlm_lksb lksb;
66 __u8 bast_mode;
67 /* Offsets may be zero if no data is present */
68 __u32 lvb_offset;
69};
70
71/* Commands passed to the device */
72#define DLM_USER_LOCK 1
73#define DLM_USER_UNLOCK 2
74#define DLM_USER_QUERY 3
75#define DLM_USER_CREATE_LOCKSPACE 4
76#define DLM_USER_REMOVE_LOCKSPACE 5
77
78/* Arbitrary length restriction */
79#define MAX_LS_NAME_LEN 64
80
81/* Lockspace flags */
82#define DLM_USER_LSFLG_AUTOFREE 1
83#define DLM_USER_LSFLG_FORCEFREE 2
84