aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/lock.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2008-12-09 12:55:46 -0500
committerDavid Teigland <teigland@redhat.com>2008-12-23 11:16:46 -0500
commitfd22a51bcc0b7b76fc729b02316214fd979f9fe1 (patch)
treee23326bb9df7cf0ee76b3b6b61c82364ff0aed78 /fs/dlm/lock.c
parent03339696314fffb95dafb349b84243358e945ce6 (diff)
dlm: improve how bast mode handling
The lkb bastmode value is set in the context of processing the lock, and read by the dlm_astd thread. Because it's accessed in these two separate contexts, the writing/reading ought to be done under a lock. This is simple to do by setting it and reading it when the lkb is added to and removed from dlm_astd's callback list which is properly locked. Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/lock.c')
-rw-r--r--fs/dlm/lock.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 724ddac91538..7b758dadbdd6 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -307,7 +307,7 @@ static void queue_cast(struct dlm_rsb *r, struct dlm_lkb *lkb, int rv)
307 lkb->lkb_lksb->sb_status = rv; 307 lkb->lkb_lksb->sb_status = rv;
308 lkb->lkb_lksb->sb_flags = lkb->lkb_sbflags; 308 lkb->lkb_lksb->sb_flags = lkb->lkb_sbflags;
309 309
310 dlm_add_ast(lkb, AST_COMP); 310 dlm_add_ast(lkb, AST_COMP, 0);
311} 311}
312 312
313static inline void queue_cast_overlap(struct dlm_rsb *r, struct dlm_lkb *lkb) 313static inline void queue_cast_overlap(struct dlm_rsb *r, struct dlm_lkb *lkb)
@@ -320,10 +320,8 @@ static void queue_bast(struct dlm_rsb *r, struct dlm_lkb *lkb, int rqmode)
320{ 320{
321 if (is_master_copy(lkb)) 321 if (is_master_copy(lkb))
322 send_bast(r, lkb, rqmode); 322 send_bast(r, lkb, rqmode);
323 else { 323 else
324 lkb->lkb_bastmode = rqmode; 324 dlm_add_ast(lkb, AST_BAST, rqmode);
325 dlm_add_ast(lkb, AST_BAST);
326 }
327} 325}
328 326
329/* 327/*