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

dm thin: rename cell_defer_except to cell_defer_no_holder

Rename cell_defer_except() to cell_defer_no_holder() which describes
its function more clearly.
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 9aa0c0e6
...@@ -526,7 +526,7 @@ static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell, ...@@ -526,7 +526,7 @@ static void cell_defer(struct thin_c *tc, struct dm_bio_prison_cell *cell,
/* /*
* Same as cell_defer except it omits the original holder of the cell. * Same as cell_defer except it omits the original holder of the cell.
*/ */
static void cell_defer_except(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 bio_list bios;
struct pool *pool = tc->pool; struct pool *pool = tc->pool;
...@@ -583,7 +583,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m) ...@@ -583,7 +583,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m)
* the bios in the cell. * the bios in the cell.
*/ */
if (bio) { if (bio) {
cell_defer_except(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, m->data_block);
...@@ -598,8 +598,8 @@ static void process_prepared_discard_fail(struct dm_thin_new_mapping *m) ...@@ -598,8 +598,8 @@ static void process_prepared_discard_fail(struct dm_thin_new_mapping *m)
struct thin_c *tc = m->tc; struct thin_c *tc = m->tc;
bio_io_error(m->bio); bio_io_error(m->bio);
cell_defer_except(tc, m->cell); cell_defer_no_holder(tc, m->cell);
cell_defer_except(tc, m->cell2); cell_defer_no_holder(tc, m->cell2);
mempool_free(m, tc->pool->mapping_pool); mempool_free(m, tc->pool->mapping_pool);
} }
...@@ -608,8 +608,8 @@ static void process_prepared_discard_passdown(struct dm_thin_new_mapping *m) ...@@ -608,8 +608,8 @@ static void process_prepared_discard_passdown(struct dm_thin_new_mapping *m)
struct thin_c *tc = m->tc; struct thin_c *tc = m->tc;
inc_all_io_entry(tc->pool, m->bio); inc_all_io_entry(tc->pool, m->bio);
cell_defer_except(tc, m->cell); cell_defer_no_holder(tc, m->cell);
cell_defer_except(tc, m->cell2); cell_defer_no_holder(tc, m->cell2);
if (m->pass_discard) if (m->pass_discard)
remap_and_issue(tc, m->bio, m->data_block); remap_and_issue(tc, m->bio, m->data_block);
...@@ -950,7 +950,7 @@ static void process_discard(struct thin_c *tc, struct bio *bio) ...@@ -950,7 +950,7 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
*/ */
build_data_key(tc->td, lookup_result.block, &key2); build_data_key(tc->td, lookup_result.block, &key2);
if (dm_bio_detain(tc->pool->prison, &key2, bio, &cell2)) { if (dm_bio_detain(tc->pool->prison, &key2, bio, &cell2)) {
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
break; break;
} }
...@@ -977,8 +977,8 @@ static void process_discard(struct thin_c *tc, struct bio *bio) ...@@ -977,8 +977,8 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
} }
} else { } else {
inc_all_io_entry(pool, bio); inc_all_io_entry(pool, bio);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
cell_defer_except(tc, cell2); cell_defer_no_holder(tc, cell2);
/* /*
* The DM core makes sure that the discard doesn't span * The DM core makes sure that the discard doesn't span
...@@ -996,13 +996,13 @@ static void process_discard(struct thin_c *tc, struct bio *bio) ...@@ -996,13 +996,13 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
/* /*
* It isn't provisioned, just forget it. * It isn't provisioned, just forget it.
*/ */
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
bio_endio(bio, 0); bio_endio(bio, 0);
break; break;
default: default:
DMERR("discard: find block unexpectedly returned %d", r); DMERR("discard: find block unexpectedly returned %d", r);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
bio_io_error(bio); bio_io_error(bio);
break; break;
} }
...@@ -1057,7 +1057,7 @@ static void process_shared_bio(struct thin_c *tc, struct bio *bio, ...@@ -1057,7 +1057,7 @@ static void process_shared_bio(struct thin_c *tc, struct bio *bio,
h->shared_read_entry = dm_deferred_entry_inc(pool->shared_read_ds); h->shared_read_entry = dm_deferred_entry_inc(pool->shared_read_ds);
inc_all_io_entry(pool, bio); inc_all_io_entry(pool, bio);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
remap_and_issue(tc, bio, lookup_result->block); remap_and_issue(tc, bio, lookup_result->block);
} }
...@@ -1074,7 +1074,7 @@ static void provision_block(struct thin_c *tc, struct bio *bio, dm_block_t block ...@@ -1074,7 +1074,7 @@ static void provision_block(struct thin_c *tc, struct bio *bio, dm_block_t block
*/ */
if (!bio->bi_size) { if (!bio->bi_size) {
inc_all_io_entry(tc->pool, bio); inc_all_io_entry(tc->pool, bio);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
remap_and_issue(tc, bio, 0); remap_and_issue(tc, bio, 0);
return; return;
...@@ -1085,7 +1085,7 @@ static void provision_block(struct thin_c *tc, struct bio *bio, dm_block_t block ...@@ -1085,7 +1085,7 @@ static void provision_block(struct thin_c *tc, struct bio *bio, dm_block_t block
*/ */
if (bio_data_dir(bio) == READ) { if (bio_data_dir(bio) == READ) {
zero_fill_bio(bio); zero_fill_bio(bio);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
bio_endio(bio, 0); bio_endio(bio, 0);
return; return;
} }
...@@ -1132,10 +1132,10 @@ static void process_bio(struct thin_c *tc, struct bio *bio) ...@@ -1132,10 +1132,10 @@ static void process_bio(struct thin_c *tc, struct bio *bio)
case 0: case 0:
if (lookup_result.shared) { if (lookup_result.shared) {
process_shared_bio(tc, bio, block, &lookup_result); process_shared_bio(tc, bio, block, &lookup_result);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
} else { } else {
inc_all_io_entry(tc->pool, bio); inc_all_io_entry(tc->pool, bio);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
remap_and_issue(tc, bio, lookup_result.block); remap_and_issue(tc, bio, lookup_result.block);
} }
...@@ -1144,7 +1144,7 @@ static void process_bio(struct thin_c *tc, struct bio *bio) ...@@ -1144,7 +1144,7 @@ static void process_bio(struct thin_c *tc, struct bio *bio)
case -ENODATA: case -ENODATA:
if (bio_data_dir(bio) == READ && tc->origin_dev) { if (bio_data_dir(bio) == READ && tc->origin_dev) {
inc_all_io_entry(tc->pool, bio); inc_all_io_entry(tc->pool, bio);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
remap_to_origin_and_issue(tc, bio); remap_to_origin_and_issue(tc, bio);
} else } else
...@@ -1153,7 +1153,7 @@ static void process_bio(struct thin_c *tc, struct bio *bio) ...@@ -1153,7 +1153,7 @@ static void process_bio(struct thin_c *tc, struct bio *bio)
default: default:
DMERR("dm_thin_find_block() failed, error = %d", r); DMERR("dm_thin_find_block() failed, error = %d", r);
cell_defer_except(tc, cell); cell_defer_no_holder(tc, cell);
bio_io_error(bio); bio_io_error(bio);
break; break;
} }
...@@ -1429,13 +1429,13 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio, ...@@ -1429,13 +1429,13 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio,
build_data_key(tc->td, result.block, &key); build_data_key(tc->td, result.block, &key);
if (dm_bio_detain(tc->pool->prison, &key, bio, &cell2)) { if (dm_bio_detain(tc->pool->prison, &key, bio, &cell2)) {
cell_defer_except(tc, cell1); cell_defer_no_holder(tc, cell1);
return DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
} }
inc_all_io_entry(tc->pool, bio); inc_all_io_entry(tc->pool, bio);
cell_defer_except(tc, cell2); cell_defer_no_holder(tc, cell2);
cell_defer_except(tc, cell1); cell_defer_no_holder(tc, cell1);
remap(tc, bio, result.block); remap(tc, bio, result.block);
return DM_MAPIO_REMAPPED; return DM_MAPIO_REMAPPED;
......
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