diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-01-29 17:46:44 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-02-26 18:41:14 -0500 |
commit | c0e4133851ed94c73ee3d34a2f2a245fcd0a60a1 (patch) | |
tree | fd2dd796c4f07d669f00196670bbba5e5a931614 /fs/ocfs2/stackglue.h | |
parent | a796d2862aed8117acc9f470f3429a5ee852912e (diff) |
ocfs2: Attach the connection to the lksb
We're going to want it in the ast functions, so we convert union
ocfs2_dlm_lksb to struct ocfs2_dlm_lksb and let it carry the connection.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/stackglue.h')
-rw-r--r-- | fs/ocfs2/stackglue.h | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/fs/ocfs2/stackglue.h b/fs/ocfs2/stackglue.h index d699117fb851..bb32926912ba 100644 --- a/fs/ocfs2/stackglue.h +++ b/fs/ocfs2/stackglue.h | |||
@@ -70,10 +70,14 @@ struct fsdlm_lksb_plus_lvb { | |||
70 | * size of the union is known. Lock status structures are embedded in | 70 | * size of the union is known. Lock status structures are embedded in |
71 | * ocfs2 inodes. | 71 | * ocfs2 inodes. |
72 | */ | 72 | */ |
73 | union ocfs2_dlm_lksb { | 73 | struct ocfs2_cluster_connection; |
74 | struct dlm_lockstatus lksb_o2dlm; | 74 | struct ocfs2_dlm_lksb { |
75 | struct dlm_lksb lksb_fsdlm; | 75 | union { |
76 | struct fsdlm_lksb_plus_lvb padding; | 76 | struct dlm_lockstatus lksb_o2dlm; |
77 | struct dlm_lksb lksb_fsdlm; | ||
78 | struct fsdlm_lksb_plus_lvb padding; | ||
79 | }; | ||
80 | struct ocfs2_cluster_connection *lksb_conn; | ||
77 | }; | 81 | }; |
78 | 82 | ||
79 | /* | 83 | /* |
@@ -81,9 +85,9 @@ union ocfs2_dlm_lksb { | |||
81 | */ | 85 | */ |
82 | struct ocfs2_locking_protocol { | 86 | struct ocfs2_locking_protocol { |
83 | struct ocfs2_protocol_version lp_max_version; | 87 | struct ocfs2_protocol_version lp_max_version; |
84 | void (*lp_lock_ast)(union ocfs2_dlm_lksb *lksb); | 88 | void (*lp_lock_ast)(struct ocfs2_dlm_lksb *lksb); |
85 | void (*lp_blocking_ast)(union ocfs2_dlm_lksb *lksb, int level); | 89 | void (*lp_blocking_ast)(struct ocfs2_dlm_lksb *lksb, int level); |
86 | void (*lp_unlock_ast)(union ocfs2_dlm_lksb *lksb, int error); | 90 | void (*lp_unlock_ast)(struct ocfs2_dlm_lksb *lksb, int error); |
87 | }; | 91 | }; |
88 | 92 | ||
89 | 93 | ||
@@ -161,7 +165,7 @@ struct ocfs2_stack_operations { | |||
161 | */ | 165 | */ |
162 | int (*dlm_lock)(struct ocfs2_cluster_connection *conn, | 166 | int (*dlm_lock)(struct ocfs2_cluster_connection *conn, |
163 | int mode, | 167 | int mode, |
164 | union ocfs2_dlm_lksb *lksb, | 168 | struct ocfs2_dlm_lksb *lksb, |
165 | u32 flags, | 169 | u32 flags, |
166 | void *name, | 170 | void *name, |
167 | unsigned int namelen); | 171 | unsigned int namelen); |
@@ -176,7 +180,7 @@ struct ocfs2_stack_operations { | |||
176 | * function. The caller can use this to find their object. | 180 | * function. The caller can use this to find their object. |
177 | */ | 181 | */ |
178 | int (*dlm_unlock)(struct ocfs2_cluster_connection *conn, | 182 | int (*dlm_unlock)(struct ocfs2_cluster_connection *conn, |
179 | union ocfs2_dlm_lksb *lksb, | 183 | struct ocfs2_dlm_lksb *lksb, |
180 | u32 flags); | 184 | u32 flags); |
181 | 185 | ||
182 | /* | 186 | /* |
@@ -185,17 +189,17 @@ struct ocfs2_stack_operations { | |||
185 | * callback pulls out the stack-specific lksb, converts the status | 189 | * callback pulls out the stack-specific lksb, converts the status |
186 | * to a proper errno, and returns it. | 190 | * to a proper errno, and returns it. |
187 | */ | 191 | */ |
188 | int (*lock_status)(union ocfs2_dlm_lksb *lksb); | 192 | int (*lock_status)(struct ocfs2_dlm_lksb *lksb); |
189 | 193 | ||
190 | /* | 194 | /* |
191 | * Return non-zero if the LVB is valid. | 195 | * Return non-zero if the LVB is valid. |
192 | */ | 196 | */ |
193 | int (*lvb_valid)(union ocfs2_dlm_lksb *lksb); | 197 | int (*lvb_valid)(struct ocfs2_dlm_lksb *lksb); |
194 | 198 | ||
195 | /* | 199 | /* |
196 | * Pull the lvb pointer off of the stack-specific lksb. | 200 | * Pull the lvb pointer off of the stack-specific lksb. |
197 | */ | 201 | */ |
198 | void *(*lock_lvb)(union ocfs2_dlm_lksb *lksb); | 202 | void *(*lock_lvb)(struct ocfs2_dlm_lksb *lksb); |
199 | 203 | ||
200 | /* | 204 | /* |
201 | * Cluster-aware posix locks | 205 | * Cluster-aware posix locks |
@@ -212,7 +216,7 @@ struct ocfs2_stack_operations { | |||
212 | * This is an optoinal debugging hook. If provided, the | 216 | * This is an optoinal debugging hook. If provided, the |
213 | * stack can dump debugging information about this lock. | 217 | * stack can dump debugging information about this lock. |
214 | */ | 218 | */ |
215 | void (*dump_lksb)(union ocfs2_dlm_lksb *lksb); | 219 | void (*dump_lksb)(struct ocfs2_dlm_lksb *lksb); |
216 | }; | 220 | }; |
217 | 221 | ||
218 | /* | 222 | /* |
@@ -248,18 +252,18 @@ int ocfs2_cluster_this_node(unsigned int *node); | |||
248 | struct ocfs2_lock_res; | 252 | struct ocfs2_lock_res; |
249 | int ocfs2_dlm_lock(struct ocfs2_cluster_connection *conn, | 253 | int ocfs2_dlm_lock(struct ocfs2_cluster_connection *conn, |
250 | int mode, | 254 | int mode, |
251 | union ocfs2_dlm_lksb *lksb, | 255 | struct ocfs2_dlm_lksb *lksb, |
252 | u32 flags, | 256 | u32 flags, |
253 | void *name, | 257 | void *name, |
254 | unsigned int namelen); | 258 | unsigned int namelen); |
255 | int ocfs2_dlm_unlock(struct ocfs2_cluster_connection *conn, | 259 | int ocfs2_dlm_unlock(struct ocfs2_cluster_connection *conn, |
256 | union ocfs2_dlm_lksb *lksb, | 260 | struct ocfs2_dlm_lksb *lksb, |
257 | u32 flags); | 261 | u32 flags); |
258 | 262 | ||
259 | int ocfs2_dlm_lock_status(union ocfs2_dlm_lksb *lksb); | 263 | int ocfs2_dlm_lock_status(struct ocfs2_dlm_lksb *lksb); |
260 | int ocfs2_dlm_lvb_valid(union ocfs2_dlm_lksb *lksb); | 264 | int ocfs2_dlm_lvb_valid(struct ocfs2_dlm_lksb *lksb); |
261 | void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb); | 265 | void *ocfs2_dlm_lvb(struct ocfs2_dlm_lksb *lksb); |
262 | void ocfs2_dlm_dump_lksb(union ocfs2_dlm_lksb *lksb); | 266 | void ocfs2_dlm_dump_lksb(struct ocfs2_dlm_lksb *lksb); |
263 | 267 | ||
264 | int ocfs2_stack_supports_plocks(void); | 268 | int ocfs2_stack_supports_plocks(void); |
265 | int ocfs2_plock(struct ocfs2_cluster_connection *conn, u64 ino, | 269 | int ocfs2_plock(struct ocfs2_cluster_connection *conn, u64 ino, |