Skip to content

Commit

Permalink
dm: rearrange dm_wq_work
Browse files Browse the repository at this point in the history
Refactor dm_wq_work() to make later patch more readable.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
kergon committed Apr 8, 2009
1 parent 692d0eb commit df12ee9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/md/dm.c
Expand Up @@ -1437,18 +1437,19 @@ static void dm_wq_work(struct work_struct *work)

down_write(&md->io_lock);

next_bio:
spin_lock_irq(&md->deferred_lock);
c = bio_list_pop(&md->deferred);
spin_unlock_irq(&md->deferred_lock);
while (1) {
spin_lock_irq(&md->deferred_lock);
c = bio_list_pop(&md->deferred);
spin_unlock_irq(&md->deferred_lock);

if (!c) {
clear_bit(DMF_BLOCK_IO, &md->flags);
break;
}

if (c) {
__split_and_process_bio(md, c);
goto next_bio;
}

clear_bit(DMF_BLOCK_IO, &md->flags);

up_write(&md->io_lock);
}

Expand Down

0 comments on commit df12ee9

Please sign in to comment.