diff options
author | Alasdair G Kergon <agk@redhat.com> | 2009-04-09 00:27:13 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-09 00:27:13 +0100 |
commit | df12ee996378a5917e9555169fe278ecca0612d4 (patch) | |
tree | ea6200205c68aab575b078e3a9e22d9b3466718f /drivers/md/dm.c | |
parent | 692d0eb9e02cf81fb387ff891f53840db2f3110a (diff) | |
download | linux-df12ee996378a5917e9555169fe278ecca0612d4.tar.gz linux-df12ee996378a5917e9555169fe278ecca0612d4.tar.bz2 linux-df12ee996378a5917e9555169fe278ecca0612d4.zip |
dm: rearrange dm_wq_work
Refactor dm_wq_work() to make later patch more readable.
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-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) 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); } |