diff options
author | Joe Thornber <ejt@redhat.com> | 2012-12-21 15:23:33 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-12-21 15:23:33 -0500 |
commit | 2aab38502d0e1bf6cf98183769e35a9ff999dcb1 (patch) | |
tree | 3836c52183eaee1601060f1ead3c175b4be85ac3 /drivers | |
parent | f286ba0eede3d8f211e6029c2b52f2dbee7d7d35 (diff) |
dm thin: cleanup dead code
Remove unused @data_block parameter from cell_defer.
Change thin_bio_map to use many returns rather than setting a variable.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-thin.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 2cb81bf3a8e3..6b9322e63651 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -510,8 +510,7 @@ static void overwrite_endio(struct bio *bio, int err) | |||
510 | /* | 510 | /* |
511 | * This sends the bios in the cell back to the deferred_bios list. | 511 | * This sends the bios in the cell back to the deferred_bios list. |
512 | */ | 512 | */ |
513 | static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell, | 513 | static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell) |
514 | dm_block_t data_block) | ||
515 | { | 514 | { |
516 | struct pool *pool = tc->pool; | 515 | struct pool *pool = tc->pool; |
517 | unsigned long flags; | 516 | unsigned long flags; |
@@ -528,12 +527,9 @@ static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell, | |||
528 | */ | 527 | */ |
529 | static void cell_defer_no_holder(struct thin_c *tc, struct dm_bio_prison_cell *cell) | 528 | static void cell_defer_no_holder(struct thin_c *tc, struct dm_bio_prison_cell *cell) |
530 | { | 529 | { |
531 | struct bio_list bios; | ||
532 | struct pool *pool = tc->pool; | 530 | struct pool *pool = tc->pool; |
533 | unsigned long flags; | 531 | unsigned long flags; |
534 | 532 | ||
535 | bio_list_init(&bios); | ||
536 | |||
537 | spin_lock_irqsave(&pool->lock, flags); | 533 | spin_lock_irqsave(&pool->lock, flags); |
538 | dm_cell_release_no_holder(cell, &pool->deferred_bios); | 534 | dm_cell_release_no_holder(cell, &pool->deferred_bios); |
539 | spin_unlock_irqrestore(&pool->lock, flags); | 535 | spin_unlock_irqrestore(&pool->lock, flags); |
@@ -586,7 +582,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m) | |||
586 | cell_defer_no_holder(tc, m->cell); | 582 | cell_defer_no_holder(tc, m->cell); |
587 | bio_endio(bio, 0); | 583 | bio_endio(bio, 0); |
588 | } else | 584 | } else |
589 | cell_defer(tc, m->cell, m->data_block); | 585 | cell_defer(tc, m->cell); |
590 | 586 | ||
591 | out: | 587 | out: |
592 | list_del(&m->list); | 588 | list_del(&m->list); |
@@ -1447,8 +1443,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio, | |||
1447 | * of doing so. Just error it. | 1443 | * of doing so. Just error it. |
1448 | */ | 1444 | */ |
1449 | bio_io_error(bio); | 1445 | bio_io_error(bio); |
1450 | r = DM_MAPIO_SUBMITTED; | 1446 | return DM_MAPIO_SUBMITTED; |
1451 | break; | ||
1452 | } | 1447 | } |
1453 | /* fall through */ | 1448 | /* fall through */ |
1454 | 1449 | ||
@@ -1458,8 +1453,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio, | |||
1458 | * provide the hint to load the metadata into cache. | 1453 | * provide the hint to load the metadata into cache. |
1459 | */ | 1454 | */ |
1460 | thin_defer_bio(tc, bio); | 1455 | thin_defer_bio(tc, bio); |
1461 | r = DM_MAPIO_SUBMITTED; | 1456 | return DM_MAPIO_SUBMITTED; |
1462 | break; | ||
1463 | 1457 | ||
1464 | default: | 1458 | default: |
1465 | /* | 1459 | /* |
@@ -1468,11 +1462,8 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio, | |||
1468 | * pool is switched to fail-io mode. | 1462 | * pool is switched to fail-io mode. |
1469 | */ | 1463 | */ |
1470 | bio_io_error(bio); | 1464 | bio_io_error(bio); |
1471 | r = DM_MAPIO_SUBMITTED; | 1465 | return DM_MAPIO_SUBMITTED; |
1472 | break; | ||
1473 | } | 1466 | } |
1474 | |||
1475 | return r; | ||
1476 | } | 1467 | } |
1477 | 1468 | ||
1478 | static int pool_is_congested(struct dm_target_callbacks *cb, int bdi_bits) | 1469 | static int pool_is_congested(struct dm_target_callbacks *cb, int bdi_bits) |