Skip to content

Commit df12ee9

Browse files
committed
dm: rearrange dm_wq_work
Refactor dm_wq_work() to make later patch more readable. Signed-off-by: Alasdair G Kergon <[email protected]>
1 parent 692d0eb commit df12ee9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/md/dm.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,18 +1437,19 @@ static void dm_wq_work(struct work_struct *work)
14371437

14381438
down_write(&md->io_lock);
14391439

1440-
next_bio:
1441-
spin_lock_irq(&md->deferred_lock);
1442-
c = bio_list_pop(&md->deferred);
1443-
spin_unlock_irq(&md->deferred_lock);
1440+
while (1) {
1441+
spin_lock_irq(&md->deferred_lock);
1442+
c = bio_list_pop(&md->deferred);
1443+
spin_unlock_irq(&md->deferred_lock);
1444+
1445+
if (!c) {
1446+
clear_bit(DMF_BLOCK_IO, &md->flags);
1447+
break;
1448+
}
14441449

1445-
if (c) {
14461450
__split_and_process_bio(md, c);
1447-
goto next_bio;
14481451
}
14491452

1450-
clear_bit(DMF_BLOCK_IO, &md->flags);
1451-
14521453
up_write(&md->io_lock);
14531454
}
14541455

0 commit comments

Comments
 (0)