diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-04-02 14:55:38 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-02 14:55:38 -0400 |
commit | ef2085870ea448b3c19160d899cf4f948da6a384 (patch) | |
tree | f8e6e4bdeecc41d1b0cd8608a7460b0d130f43a8 /drivers/md/dm.c | |
parent | f0b9a4502baa18f8a255a2866bb4e0655fb35974 (diff) |
dm: merge __flush_deferred_io into caller
Merge __flush_deferred_io() into the only caller, dm_wq_work().
There's no need to have a function that has only one caller.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 385c2e8f90c8..4ba0811f28c5 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1401,14 +1401,20 @@ static int dm_wait_for_completion(struct mapped_device *md) | |||
1401 | /* | 1401 | /* |
1402 | * Process the deferred bios | 1402 | * Process the deferred bios |
1403 | */ | 1403 | */ |
1404 | static void __flush_deferred_io(struct mapped_device *md) | 1404 | static void dm_wq_work(struct work_struct *work) |
1405 | { | 1405 | { |
1406 | struct mapped_device *md = container_of(work, struct mapped_device, | ||
1407 | work); | ||
1406 | struct bio *c; | 1408 | struct bio *c; |
1407 | 1409 | ||
1410 | down_write(&md->io_lock); | ||
1411 | |||
1408 | while ((c = bio_list_pop(&md->deferred))) | 1412 | while ((c = bio_list_pop(&md->deferred))) |
1409 | __split_and_process_bio(md, c); | 1413 | __split_and_process_bio(md, c); |
1410 | 1414 | ||
1411 | clear_bit(DMF_BLOCK_IO, &md->flags); | 1415 | clear_bit(DMF_BLOCK_IO, &md->flags); |
1416 | |||
1417 | up_write(&md->io_lock); | ||
1412 | } | 1418 | } |
1413 | 1419 | ||
1414 | static void __merge_pushback_list(struct mapped_device *md) | 1420 | static void __merge_pushback_list(struct mapped_device *md) |
@@ -1422,16 +1428,6 @@ static void __merge_pushback_list(struct mapped_device *md) | |||
1422 | spin_unlock_irqrestore(&md->pushback_lock, flags); | 1428 | spin_unlock_irqrestore(&md->pushback_lock, flags); |
1423 | } | 1429 | } |
1424 | 1430 | ||
1425 | static void dm_wq_work(struct work_struct *work) | ||
1426 | { | ||
1427 | struct mapped_device *md = container_of(work, struct mapped_device, | ||
1428 | work); | ||
1429 | |||
1430 | down_write(&md->io_lock); | ||
1431 | __flush_deferred_io(md); | ||
1432 | up_write(&md->io_lock); | ||
1433 | } | ||
1434 | |||
1435 | static void dm_queue_flush(struct mapped_device *md) | 1431 | static void dm_queue_flush(struct mapped_device *md) |
1436 | { | 1432 | { |
1437 | queue_work(md->wq, &md->work); | 1433 | queue_work(md->wq, &md->work); |