aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/ast.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2008-12-23 11:22:56 -0500
committerDavid Teigland <teigland@redhat.com>2008-12-23 11:22:56 -0500
commit722d74219ea21223c74e5e894b0afcc5e4ca75a7 (patch)
tree6a35db4b6e750cf1e1eabe7e15a0ba858baafe26 /fs/dlm/ast.c
parentd022509d1c54be4918e7fc8f1195ee8c392e9a57 (diff)
dlm: fs/dlm/ast.c: fix warning
fs/dlm/ast.c: In function 'dlm_astd': fs/dlm/ast.c:64: warning: 'bastmode' may be used uninitialized in this function Cleans code up. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/ast.c')
-rw-r--r--fs/dlm/ast.c39
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 (;;) { 66repeat:
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
105static inline int no_asts(void) 100static inline int no_asts(void)