diff options
author | Alasdair G Kergon <agk@redhat.com> | 2009-04-08 19:27:13 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-08 19:27:13 -0400 |
commit | df12ee996378a5917e9555169fe278ecca0612d4 (patch) | |
tree | ea6200205c68aab575b078e3a9e22d9b3466718f | |
parent | 692d0eb9e02cf81fb387ff891f53840db2f3110a (diff) |
dm: rearrange dm_wq_work
Refactor dm_wq_work() to make later patch more readable.
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r-- | drivers/md/dm.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ab3b5d84df65..020a9e1993a7 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1437,18 +1437,19 @@ static void dm_wq_work(struct work_struct *work) | |||
1437 | 1437 | ||
1438 | down_write(&md->io_lock); | 1438 | down_write(&md->io_lock); |
1439 | 1439 | ||
1440 | next_bio: | 1440 | while (1) { |
1441 | spin_lock_irq(&md->deferred_lock); | 1441 | spin_lock_irq(&md->deferred_lock); |
1442 | c = bio_list_pop(&md->deferred); | 1442 | c = bio_list_pop(&md->deferred); |
1443 | spin_unlock_irq(&md->deferred_lock); | 1443 | spin_unlock_irq(&md->deferred_lock); |
1444 | |||
1445 | if (!c) { | ||
1446 | clear_bit(DMF_BLOCK_IO, &md->flags); | ||
1447 | break; | ||
1448 | } | ||
1444 | 1449 | ||
1445 | if (c) { | ||
1446 | __split_and_process_bio(md, c); | 1450 | __split_and_process_bio(md, c); |
1447 | goto next_bio; | ||
1448 | } | 1451 | } |
1449 | 1452 | ||
1450 | clear_bit(DMF_BLOCK_IO, &md->flags); | ||
1451 | |||
1452 | up_write(&md->io_lock); | 1453 | up_write(&md->io_lock); |
1453 | } | 1454 | } |
1454 | 1455 | ||