diff options
author | David Teigland <teigland@redhat.com> | 2008-12-09 12:55:46 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2008-12-23 11:16:46 -0500 |
commit | fd22a51bcc0b7b76fc729b02316214fd979f9fe1 (patch) | |
tree | e23326bb9df7cf0ee76b3b6b61c82364ff0aed78 /fs/dlm/user.c | |
parent | 03339696314fffb95dafb349b84243358e945ce6 (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/user.c')
-rw-r--r-- | fs/dlm/user.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c index b3832c67194a..065149e84f42 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c | |||
@@ -175,7 +175,7 @@ static int lkb_is_endoflife(struct dlm_lkb *lkb, int sb_status, int type) | |||
175 | /* we could possibly check if the cancel of an orphan has resulted in the lkb | 175 | /* we could possibly check if the cancel of an orphan has resulted in the lkb |
176 | being removed and then remove that lkb from the orphans list and free it */ | 176 | being removed and then remove that lkb from the orphans list and free it */ |
177 | 177 | ||
178 | void dlm_user_add_ast(struct dlm_lkb *lkb, int type) | 178 | void dlm_user_add_ast(struct dlm_lkb *lkb, int type, int bastmode) |
179 | { | 179 | { |
180 | struct dlm_ls *ls; | 180 | struct dlm_ls *ls; |
181 | struct dlm_user_args *ua; | 181 | struct dlm_user_args *ua; |
@@ -208,6 +208,8 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, int type) | |||
208 | 208 | ||
209 | ast_type = lkb->lkb_ast_type; | 209 | ast_type = lkb->lkb_ast_type; |
210 | lkb->lkb_ast_type |= type; | 210 | lkb->lkb_ast_type |= type; |
211 | if (bastmode) | ||
212 | lkb->lkb_bastmode = bastmode; | ||
211 | 213 | ||
212 | if (!ast_type) { | 214 | if (!ast_type) { |
213 | kref_get(&lkb->lkb_ref); | 215 | kref_get(&lkb->lkb_ref); |