diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-01-28 22:22:39 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-02-26 18:41:14 -0500 |
commit | a796d2862aed8117acc9f470f3429a5ee852912e (patch) | |
tree | 71b837ae91effcdb4283e8c0bbf5c3162e7e21e1 /fs/ocfs2/stackglue.c | |
parent | 34a9dd7e29e9129fec40c645a03f1bbbe810e771 (diff) |
ocfs2: Pass lksbs back from stackglue ast/bast functions.
The stackglue ast and bast functions tried to maintain the fiction that
their arguments were void pointers. In reality, stack_user.c had to
know that the argument was an ocfs2_lock_res in order to get the status
off of the lksb. That's ugly.
This changes stackglue to always pass the lksb as the argument to ast
and bast functions. The caller can always use container_of() to get the
ocfs2_lock_res or user_dlm_lock_res. The net effect to the caller is
zero. They still get back the lockres in their ast. stackglue gets
cleaner, and now can use the lksb itself.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/stackglue.c')
-rw-r--r-- | fs/ocfs2/stackglue.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index f3df0baa9a48..3500d9839d76 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c | |||
@@ -233,35 +233,32 @@ EXPORT_SYMBOL_GPL(ocfs2_stack_glue_set_locking_protocol); | |||
233 | 233 | ||
234 | 234 | ||
235 | /* | 235 | /* |
236 | * The ocfs2_dlm_lock() and ocfs2_dlm_unlock() functions take | 236 | * The ocfs2_dlm_lock() and ocfs2_dlm_unlock() functions take no argument |
237 | * "struct ocfs2_lock_res *astarg" instead of "void *astarg" because the | 237 | * for the ast and bast functions. They will pass the lksb to the ast |
238 | * underlying stack plugins need to pilfer the lksb off of the lock_res. | 238 | * and bast. The caller can wrap the lksb with their own structure to |
239 | * If some other structure needs to be passed as an astarg, the plugins | 239 | * get more information. |
240 | * will need to be given a different avenue to the lksb. | ||
241 | */ | 240 | */ |
242 | int ocfs2_dlm_lock(struct ocfs2_cluster_connection *conn, | 241 | int ocfs2_dlm_lock(struct ocfs2_cluster_connection *conn, |
243 | int mode, | 242 | int mode, |
244 | union ocfs2_dlm_lksb *lksb, | 243 | union ocfs2_dlm_lksb *lksb, |
245 | u32 flags, | 244 | u32 flags, |
246 | void *name, | 245 | void *name, |
247 | unsigned int namelen, | 246 | unsigned int namelen) |
248 | struct ocfs2_lock_res *astarg) | ||
249 | { | 247 | { |
250 | BUG_ON(lproto == NULL); | 248 | BUG_ON(lproto == NULL); |
251 | 249 | ||
252 | return active_stack->sp_ops->dlm_lock(conn, mode, lksb, flags, | 250 | return active_stack->sp_ops->dlm_lock(conn, mode, lksb, flags, |
253 | name, namelen, astarg); | 251 | name, namelen); |
254 | } | 252 | } |
255 | EXPORT_SYMBOL_GPL(ocfs2_dlm_lock); | 253 | EXPORT_SYMBOL_GPL(ocfs2_dlm_lock); |
256 | 254 | ||
257 | int ocfs2_dlm_unlock(struct ocfs2_cluster_connection *conn, | 255 | int ocfs2_dlm_unlock(struct ocfs2_cluster_connection *conn, |
258 | union ocfs2_dlm_lksb *lksb, | 256 | union ocfs2_dlm_lksb *lksb, |
259 | u32 flags, | 257 | u32 flags) |
260 | struct ocfs2_lock_res *astarg) | ||
261 | { | 258 | { |
262 | BUG_ON(lproto == NULL); | 259 | BUG_ON(lproto == NULL); |
263 | 260 | ||
264 | return active_stack->sp_ops->dlm_unlock(conn, lksb, flags, astarg); | 261 | return active_stack->sp_ops->dlm_unlock(conn, lksb, flags); |
265 | } | 262 | } |
266 | EXPORT_SYMBOL_GPL(ocfs2_dlm_unlock); | 263 | EXPORT_SYMBOL_GPL(ocfs2_dlm_unlock); |
267 | 264 | ||