]>
Commit | Line | Data |
---|---|---|
e2be04c7 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
e7fd4179 DT |
2 | /****************************************************************************** |
3 | ******************************************************************************* | |
4 | ** | |
5 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | |
d7db923e | 6 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. |
e7fd4179 DT |
7 | ** |
8 | ** This copyrighted material is made available to anyone wishing to use, | |
9 | ** modify, copy, or redistribute it subject to the terms and conditions | |
10 | ** of the GNU General Public License v.2. | |
11 | ** | |
12 | ******************************************************************************* | |
13 | ******************************************************************************/ | |
14 | ||
c1c76743 MF |
15 | #ifndef _LINUX_DLM_DEVICE_H |
16 | #define _LINUX_DLM_DEVICE_H | |
17 | ||
e7fd4179 DT |
18 | /* This is the device interface for dlm, most users will use a library |
19 | * interface. | |
20 | */ | |
21 | ||
c1c76743 MF |
22 | #include <linux/dlm.h> |
23 | #include <linux/types.h> | |
24 | ||
e7fd4179 DT |
25 | #define DLM_USER_LVB_LEN 32 |
26 | ||
27 | /* Version of the device interface */ | |
d7db923e DT |
28 | #define DLM_DEVICE_VERSION_MAJOR 6 |
29 | #define DLM_DEVICE_VERSION_MINOR 0 | |
b96f4650 | 30 | #define DLM_DEVICE_VERSION_PATCH 2 |
e7fd4179 DT |
31 | |
32 | /* struct passed to the lock write */ | |
33 | struct dlm_lock_params { | |
34 | __u8 mode; | |
22da645f | 35 | __u8 namelen; |
d7db923e DT |
36 | __u16 unused; |
37 | __u32 flags; | |
e7fd4179 DT |
38 | __u32 lkid; |
39 | __u32 parent; | |
d7db923e DT |
40 | __u64 xid; |
41 | __u64 timeout; | |
42 | void __user *castparam; | |
e7fd4179 DT |
43 | void __user *castaddr; |
44 | void __user *bastparam; | |
d7db923e | 45 | void __user *bastaddr; |
e7fd4179 DT |
46 | struct dlm_lksb __user *lksb; |
47 | char lvb[DLM_USER_LVB_LEN]; | |
22da645f | 48 | char name[0]; |
e7fd4179 DT |
49 | }; |
50 | ||
51 | struct dlm_lspace_params { | |
52 | __u32 flags; | |
53 | __u32 minor; | |
22da645f | 54 | char name[0]; |
e7fd4179 DT |
55 | }; |
56 | ||
72c2be77 DT |
57 | struct dlm_purge_params { |
58 | __u32 nodeid; | |
59 | __u32 pid; | |
60 | }; | |
61 | ||
e7fd4179 DT |
62 | struct dlm_write_request { |
63 | __u32 version[3]; | |
64 | __u8 cmd; | |
22da645f PC |
65 | __u8 is64bit; |
66 | __u8 unused[2]; | |
e7fd4179 DT |
67 | |
68 | union { | |
69 | struct dlm_lock_params lock; | |
70 | struct dlm_lspace_params lspace; | |
72c2be77 | 71 | struct dlm_purge_params purge; |
e7fd4179 DT |
72 | } i; |
73 | }; | |
74 | ||
d7db923e DT |
75 | struct dlm_device_version { |
76 | __u32 version[3]; | |
77 | }; | |
78 | ||
e7fd4179 DT |
79 | /* struct read from the "device" fd, |
80 | consists mainly of userspace pointers for the library to use */ | |
d7db923e | 81 | |
e7fd4179 | 82 | struct dlm_lock_result { |
d7db923e | 83 | __u32 version[3]; |
e7fd4179 DT |
84 | __u32 length; |
85 | void __user * user_astaddr; | |
86 | void __user * user_astparam; | |
87 | struct dlm_lksb __user * user_lksb; | |
88 | struct dlm_lksb lksb; | |
89 | __u8 bast_mode; | |
22da645f | 90 | __u8 unused[3]; |
e7fd4179 DT |
91 | /* Offsets may be zero if no data is present */ |
92 | __u32 lvb_offset; | |
93 | }; | |
94 | ||
95 | /* Commands passed to the device */ | |
96 | #define DLM_USER_LOCK 1 | |
97 | #define DLM_USER_UNLOCK 2 | |
98 | #define DLM_USER_QUERY 3 | |
99 | #define DLM_USER_CREATE_LOCKSPACE 4 | |
100 | #define DLM_USER_REMOVE_LOCKSPACE 5 | |
72c2be77 | 101 | #define DLM_USER_PURGE 6 |
8b4021fa | 102 | #define DLM_USER_DEADLOCK 7 |
e7fd4179 | 103 | |
e7fd4179 DT |
104 | /* Lockspace flags */ |
105 | #define DLM_USER_LSFLG_AUTOFREE 1 | |
106 | #define DLM_USER_LSFLG_FORCEFREE 2 | |
107 | ||
c1c76743 MF |
108 | #endif |
109 |