Skip to content

Commit

Permalink
dlm: fs/dlm/ast.c: fix warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
akpm00 authored and teigland committed Dec 23, 2008
1 parent d022509 commit 722d742
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions fs/dlm/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,23 @@ static void process_asts(void)
struct dlm_lkb *lkb;
void (*cast) (void *astparam);
void (*bast) (void *astparam, int mode);
int type = 0, found, bastmode;

for (;;) {
found = 0;
spin_lock(&ast_queue_lock);
list_for_each_entry(lkb, &ast_queue, lkb_astqueue) {
r = lkb->lkb_resource;
ls = r->res_ls;

if (dlm_locking_stopped(ls))
continue;

list_del(&lkb->lkb_astqueue);
type = lkb->lkb_ast_type;
lkb->lkb_ast_type = 0;
bastmode = lkb->lkb_bastmode;
found = 1;
break;
}
spin_unlock(&ast_queue_lock);
int type = 0, bastmode;

repeat:
spin_lock(&ast_queue_lock);
list_for_each_entry(lkb, &ast_queue, lkb_astqueue) {
r = lkb->lkb_resource;
ls = r->res_ls;

if (!found)
break;
if (dlm_locking_stopped(ls))
continue;

list_del(&lkb->lkb_astqueue);
type = lkb->lkb_ast_type;
lkb->lkb_ast_type = 0;
bastmode = lkb->lkb_bastmode;

spin_unlock(&ast_queue_lock);
cast = lkb->lkb_astfn;
bast = lkb->lkb_bastfn;

Expand All @@ -99,7 +92,9 @@ static void process_asts(void)
dlm_put_lkb(lkb);

cond_resched();
goto repeat;
}
spin_unlock(&ast_queue_lock);
}

static inline int no_asts(void)
Expand Down

0 comments on commit 722d742

Please sign in to comment.