dm: rearrange dm_wq_work
Refactor dm_wq_work() to make later patch more readable.
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index ab3b5d8..020a9e1 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1437,18 +1437,19 @@
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) {
+ if (!c) {
+ clear_bit(DMF_BLOCK_IO, &md->flags);
+ break;
+ }
+
__split_and_process_bio(md, c);
- goto next_bio;
}
- clear_bit(DMF_BLOCK_IO, &md->flags);
-
up_write(&md->io_lock);
}