diff options
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/ast.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c index fbe840d09493..dc2ad6008b2d 100644 --- a/fs/dlm/ast.c +++ b/fs/dlm/ast.c | |||
@@ -61,30 +61,23 @@ static void process_asts(void) | |||
61 | struct dlm_lkb *lkb; | 61 | struct dlm_lkb *lkb; |
62 | void (*cast) (void *astparam); | 62 | void (*cast) (void *astparam); |
63 | void (*bast) (void *astparam, int mode); | 63 | void (*bast) (void *astparam, int mode); |
64 | int type = 0, found, bastmode; | 64 | int type = 0, bastmode; |
65 | 65 | ||
66 | for (;;) { | 66 | repeat: |
67 | found = 0; | 67 | spin_lock(&ast_queue_lock); |
68 | spin_lock(&ast_queue_lock); | 68 | list_for_each_entry(lkb, &ast_queue, lkb_astqueue) { |
69 | list_for_each_entry(lkb, &ast_queue, lkb_astqueue) { | 69 | r = lkb->lkb_resource; |
70 | r = lkb->lkb_resource; | 70 | ls = r->res_ls; |
71 | ls = r->res_ls; | ||
72 | |||
73 | if (dlm_locking_stopped(ls)) | ||
74 | continue; | ||
75 | |||
76 | list_del(&lkb->lkb_astqueue); | ||
77 | type = lkb->lkb_ast_type; | ||
78 | lkb->lkb_ast_type = 0; | ||
79 | bastmode = lkb->lkb_bastmode; | ||
80 | found = 1; | ||
81 | break; | ||
82 | } | ||
83 | spin_unlock(&ast_queue_lock); | ||
84 | 71 | ||
85 | if (!found) | 72 | if (dlm_locking_stopped(ls)) |
86 | break; | 73 | continue; |
87 | 74 | ||
75 | list_del(&lkb->lkb_astqueue); | ||
76 | type = lkb->lkb_ast_type; | ||
77 | lkb->lkb_ast_type = 0; | ||
78 | bastmode = lkb->lkb_bastmode; | ||
79 | |||
80 | spin_unlock(&ast_queue_lock); | ||
88 | cast = lkb->lkb_astfn; | 81 | cast = lkb->lkb_astfn; |
89 | bast = lkb->lkb_bastfn; | 82 | bast = lkb->lkb_bastfn; |
90 | 83 | ||
@@ -99,7 +92,9 @@ static void process_asts(void) | |||
99 | dlm_put_lkb(lkb); | 92 | dlm_put_lkb(lkb); |
100 | 93 | ||
101 | cond_resched(); | 94 | cond_resched(); |
95 | goto repeat; | ||
102 | } | 96 | } |
97 | spin_unlock(&ast_queue_lock); | ||
103 | } | 98 | } |
104 | 99 | ||
105 | static inline int no_asts(void) | 100 | static inline int no_asts(void) |