]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.suse/dlm-fsdlm-ast.c-fix-warning.patch
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / dlm-fsdlm-ast.c-fix-warning.patch
1 From: Andrew Morton <akpm@linux-foundation.org>
2 commit 722d74219ea21223c74e5e894b0afcc5e4ca75a7
3 Author: Andrew Morton <akpm@linux-foundation.org>
4 Date: Tue Dec 23 10:22:56 2008 -0600
5 Subject: dlm: fs/dlm/ast.c: fix warning
6
7 fs/dlm/ast.c: In function 'dlm_astd':
8 fs/dlm/ast.c:64: warning: 'bastmode' may be used uninitialized in this function
9
10 Cleans code up.
11
12 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13 Signed-off-by: David Teigland <teigland@redhat.com>
14 Signed-off-by: Coly Li <coly.li@suse.de>
15
16 diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
17 index fbe840d..dc2ad60 100644
18 --- a/fs/dlm/ast.c
19 +++ b/fs/dlm/ast.c
20 @@ -61,30 +61,23 @@ static void process_asts(void)
21 struct dlm_lkb *lkb;
22 void (*cast) (void *astparam);
23 void (*bast) (void *astparam, int mode);
24 - int type = 0, found, bastmode;
25 -
26 - for (;;) {
27 - found = 0;
28 - spin_lock(&ast_queue_lock);
29 - list_for_each_entry(lkb, &ast_queue, lkb_astqueue) {
30 - r = lkb->lkb_resource;
31 - ls = r->res_ls;
32 -
33 - if (dlm_locking_stopped(ls))
34 - continue;
35 -
36 - list_del(&lkb->lkb_astqueue);
37 - type = lkb->lkb_ast_type;
38 - lkb->lkb_ast_type = 0;
39 - bastmode = lkb->lkb_bastmode;
40 - found = 1;
41 - break;
42 - }
43 - spin_unlock(&ast_queue_lock);
44 + int type = 0, bastmode;
45 +
46 +repeat:
47 + spin_lock(&ast_queue_lock);
48 + list_for_each_entry(lkb, &ast_queue, lkb_astqueue) {
49 + r = lkb->lkb_resource;
50 + ls = r->res_ls;
51
52 - if (!found)
53 - break;
54 + if (dlm_locking_stopped(ls))
55 + continue;
56
57 + list_del(&lkb->lkb_astqueue);
58 + type = lkb->lkb_ast_type;
59 + lkb->lkb_ast_type = 0;
60 + bastmode = lkb->lkb_bastmode;
61 +
62 + spin_unlock(&ast_queue_lock);
63 cast = lkb->lkb_astfn;
64 bast = lkb->lkb_bastfn;
65
66 @@ -99,7 +92,9 @@ static void process_asts(void)
67 dlm_put_lkb(lkb);
68
69 cond_resched();
70 + goto repeat;
71 }
72 + spin_unlock(&ast_queue_lock);
73 }
74
75 static inline int no_asts(void)