aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/stackglue.h
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2010-01-29 17:46:44 -0500
committerJoel Becker <joel.becker@oracle.com>2010-02-26 18:41:14 -0500
commitc0e4133851ed94c73ee3d34a2f2a245fcd0a60a1 (patch)
treefd2dd796c4f07d669f00196670bbba5e5a931614 /fs/ocfs2/stackglue.h
parenta796d2862aed8117acc9f470f3429a5ee852912e (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.h42
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 */
73union ocfs2_dlm_lksb { 73struct ocfs2_cluster_connection;
74 struct dlm_lockstatus lksb_o2dlm; 74struct 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 */
82struct ocfs2_locking_protocol { 86struct 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);
248struct ocfs2_lock_res; 252struct ocfs2_lock_res;
249int ocfs2_dlm_lock(struct ocfs2_cluster_connection *conn, 253int 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);
255int ocfs2_dlm_unlock(struct ocfs2_cluster_connection *conn, 259int 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
259int ocfs2_dlm_lock_status(union ocfs2_dlm_lksb *lksb); 263int ocfs2_dlm_lock_status(struct ocfs2_dlm_lksb *lksb);
260int ocfs2_dlm_lvb_valid(union ocfs2_dlm_lksb *lksb); 264int ocfs2_dlm_lvb_valid(struct ocfs2_dlm_lksb *lksb);
261void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb); 265void *ocfs2_dlm_lvb(struct ocfs2_dlm_lksb *lksb);
262void ocfs2_dlm_dump_lksb(union ocfs2_dlm_lksb *lksb); 266void ocfs2_dlm_dump_lksb(struct ocfs2_dlm_lksb *lksb);
263 267
264int ocfs2_stack_supports_plocks(void); 268int ocfs2_stack_supports_plocks(void);
265int ocfs2_plock(struct ocfs2_cluster_connection *conn, u64 ino, 269int ocfs2_plock(struct ocfs2_cluster_connection *conn, u64 ino,