Commit 2aab3850 authored by Joe Thornber's avatar Joe Thornber Committed by Alasdair G Kergon

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: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent f286ba0e
...@@ -510,8 +510,7 @@ static void overwrite_endio(struct bio *bio, int err) ...@@ -510,8 +510,7 @@ static void overwrite_endio(struct bio *bio, int err)
/* /*
* This sends the bios in the cell back to the deferred_bios list. * This sends the bios in the cell back to the deferred_bios list.
*/ */
static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell, static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell)
dm_block_t data_block)
{ {
struct pool *pool = tc->pool; struct pool *pool = tc->pool;
unsigned long flags; unsigned long flags;
...@@ -528,12 +527,9 @@ static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell, ...@@ -528,12 +527,9 @@ static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell,
*/ */
static void cell_defer_no_holder(struct thin_c *tc, struct dm_bio_prison_cell *cell) static void cell_defer_no_holder(struct thin_c *tc, struct dm_bio_prison_cell *cell)
{ {
struct bio_list bios;
struct pool *pool = tc->pool; struct pool *pool = tc->pool;
unsigned long flags; unsigned long flags;
bio_list_init(&bios);
spin_lock_irqsave(&pool->lock, flags); spin_lock_irqsave(&pool->lock, flags);
dm_cell_release_no_holder(cell, &pool->deferred_bios); dm_cell_release_no_holder(cell, &pool->deferred_bios);
spin_unlock_irqrestore(&pool->lock, flags); spin_unlock_irqrestore(&pool->lock, flags);
...@@ -586,7 +582,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m) ...@@ -586,7 +582,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m)
cell_defer_no_holder(tc, m->cell); cell_defer_no_holder(tc, m->cell);
bio_endio(bio, 0); bio_endio(bio, 0);
} else } else
cell_defer(tc, m->cell, m->data_block); cell_defer(tc, m->cell);
out: out:
list_del(&m->list); list_del(&m->list);
...@@ -1447,8 +1443,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio, ...@@ -1447,8 +1443,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio,
* of doing so. Just error it. * of doing so. Just error it.
*/ */
bio_io_error(bio); bio_io_error(bio);
r = DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
break;
} }
/* fall through */ /* fall through */
...@@ -1458,8 +1453,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio, ...@@ -1458,8 +1453,7 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio,
* provide the hint to load the metadata into cache. * provide the hint to load the metadata into cache.
*/ */
thin_defer_bio(tc, bio); thin_defer_bio(tc, bio);
r = DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
break;
default: default:
/* /*
...@@ -1468,11 +1462,8 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio, ...@@ -1468,11 +1462,8 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio,
* pool is switched to fail-io mode. * pool is switched to fail-io mode.
*/ */
bio_io_error(bio); bio_io_error(bio);
r = DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
break;
} }
return r;
} }
static int pool_is_congested(struct dm_target_callbacks *cb, int bdi_bits) static int pool_is_congested(struct dm_target_callbacks *cb, int bdi_bits)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment