diff options
author | Mike Snitzer <snitzer@redhat.com> | 2016-01-31 13:28:26 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2016-02-22 22:34:37 -0500 |
commit | 30187e1d48a258e304af184c45c3140c8509d219 (patch) | |
tree | 58603a739f5a21aa04a1d840639989424eef3332 | |
parent | eca7ee6dc01b21c669bce8c39d3d368509fb65e8 (diff) |
dm: rename target's per_bio_data_size to per_io_data_size
Request-based DM will also make use of per_bio_data_size.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | drivers/md/dm-cache-target.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-crypt.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-delay.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-flakey.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-log-writes.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-raid1.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-snap.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-table.c | 6 | ||||
-rw-r--r-- | drivers/md/dm-thin.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-verity-fec.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-verity-target.c | 12 | ||||
-rw-r--r-- | drivers/md/dm.c | 8 | ||||
-rw-r--r-- | include/linux/device-mapper.h | 6 |
13 files changed, 25 insertions, 25 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 5780accffa30..2238d6f484fe 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -2771,7 +2771,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) | |||
2771 | ti->split_discard_bios = false; | 2771 | ti->split_discard_bios = false; |
2772 | 2772 | ||
2773 | cache->features = ca->features; | 2773 | cache->features = ca->features; |
2774 | ti->per_bio_data_size = get_per_bio_data_size(cache); | 2774 | ti->per_io_data_size = get_per_bio_data_size(cache); |
2775 | 2775 | ||
2776 | cache->callbacks.congested_fn = cache_is_congested; | 2776 | cache->callbacks.congested_fn = cache_is_congested; |
2777 | dm_table_add_target_callbacks(ti->table, &cache->callbacks); | 2777 | dm_table_add_target_callbacks(ti->table, &cache->callbacks); |
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 3147c8d09ea8..5c934b670154 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -1788,7 +1788,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1788 | goto bad; | 1788 | goto bad; |
1789 | } | 1789 | } |
1790 | 1790 | ||
1791 | cc->per_bio_data_size = ti->per_bio_data_size = | 1791 | cc->per_bio_data_size = ti->per_io_data_size = |
1792 | ALIGN(sizeof(struct dm_crypt_io) + cc->dmreq_start + | 1792 | ALIGN(sizeof(struct dm_crypt_io) + cc->dmreq_start + |
1793 | sizeof(struct dm_crypt_request) + iv_size_padding + cc->iv_size, | 1793 | sizeof(struct dm_crypt_request) + iv_size_padding + cc->iv_size, |
1794 | ARCH_KMALLOC_MINALIGN); | 1794 | ARCH_KMALLOC_MINALIGN); |
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index b4c356a21123..cc70871a6d29 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c | |||
@@ -204,7 +204,7 @@ out: | |||
204 | 204 | ||
205 | ti->num_flush_bios = 1; | 205 | ti->num_flush_bios = 1; |
206 | ti->num_discard_bios = 1; | 206 | ti->num_discard_bios = 1; |
207 | ti->per_bio_data_size = sizeof(struct dm_delay_info); | 207 | ti->per_io_data_size = sizeof(struct dm_delay_info); |
208 | ti->private = dc; | 208 | ti->private = dc; |
209 | return 0; | 209 | return 0; |
210 | 210 | ||
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c index 09e2afcafd2d..b7341de87015 100644 --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c | |||
@@ -220,7 +220,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
220 | 220 | ||
221 | ti->num_flush_bios = 1; | 221 | ti->num_flush_bios = 1; |
222 | ti->num_discard_bios = 1; | 222 | ti->num_discard_bios = 1; |
223 | ti->per_bio_data_size = sizeof(struct per_bio_data); | 223 | ti->per_io_data_size = sizeof(struct per_bio_data); |
224 | ti->private = fc; | 224 | ti->private = fc; |
225 | return 0; | 225 | return 0; |
226 | 226 | ||
diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index 624589d51c2c..608302e222af 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c | |||
@@ -475,7 +475,7 @@ static int log_writes_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
475 | ti->flush_supported = true; | 475 | ti->flush_supported = true; |
476 | ti->num_discard_bios = 1; | 476 | ti->num_discard_bios = 1; |
477 | ti->discards_supported = true; | 477 | ti->discards_supported = true; |
478 | ti->per_bio_data_size = sizeof(struct per_bio_data); | 478 | ti->per_io_data_size = sizeof(struct per_bio_data); |
479 | ti->private = lc; | 479 | ti->private = lc; |
480 | return 0; | 480 | return 0; |
481 | 481 | ||
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index f2a363a89629..b3ccf1e0d4f2 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -1121,7 +1121,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1121 | 1121 | ||
1122 | ti->num_flush_bios = 1; | 1122 | ti->num_flush_bios = 1; |
1123 | ti->num_discard_bios = 1; | 1123 | ti->num_discard_bios = 1; |
1124 | ti->per_bio_data_size = sizeof(struct dm_raid1_bio_record); | 1124 | ti->per_io_data_size = sizeof(struct dm_raid1_bio_record); |
1125 | ti->discard_zeroes_data_unsupported = true; | 1125 | ti->discard_zeroes_data_unsupported = true; |
1126 | 1126 | ||
1127 | ms->kmirrord_wq = alloc_workqueue("kmirrord", WQ_MEM_RECLAIM, 0); | 1127 | ms->kmirrord_wq = alloc_workqueue("kmirrord", WQ_MEM_RECLAIM, 0); |
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 3766386080a4..62479ac4baf7 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -1201,7 +1201,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1201 | 1201 | ||
1202 | ti->private = s; | 1202 | ti->private = s; |
1203 | ti->num_flush_bios = num_flush_bios; | 1203 | ti->num_flush_bios = num_flush_bios; |
1204 | ti->per_bio_data_size = sizeof(struct dm_snap_tracked_chunk); | 1204 | ti->per_io_data_size = sizeof(struct dm_snap_tracked_chunk); |
1205 | 1205 | ||
1206 | /* Add snapshot to the list of snapshots for this origin */ | 1206 | /* Add snapshot to the list of snapshots for this origin */ |
1207 | /* Exceptions aren't triggered till snapshot_resume() is called */ | 1207 | /* Exceptions aren't triggered till snapshot_resume() is called */ |
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 89180fdbd28c..7210e5392cc4 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -957,7 +957,7 @@ bool dm_table_mq_request_based(struct dm_table *t) | |||
957 | static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *md) | 957 | static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *md) |
958 | { | 958 | { |
959 | unsigned type = dm_table_get_type(t); | 959 | unsigned type = dm_table_get_type(t); |
960 | unsigned per_bio_data_size = 0; | 960 | unsigned per_io_data_size = 0; |
961 | struct dm_target *tgt; | 961 | struct dm_target *tgt; |
962 | unsigned i; | 962 | unsigned i; |
963 | 963 | ||
@@ -969,10 +969,10 @@ static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device * | |||
969 | if (type == DM_TYPE_BIO_BASED) | 969 | if (type == DM_TYPE_BIO_BASED) |
970 | for (i = 0; i < t->num_targets; i++) { | 970 | for (i = 0; i < t->num_targets; i++) { |
971 | tgt = t->targets + i; | 971 | tgt = t->targets + i; |
972 | per_bio_data_size = max(per_bio_data_size, tgt->per_bio_data_size); | 972 | per_io_data_size = max(per_io_data_size, tgt->per_io_data_size); |
973 | } | 973 | } |
974 | 974 | ||
975 | t->mempools = dm_alloc_md_mempools(md, type, t->integrity_supported, per_bio_data_size); | 975 | t->mempools = dm_alloc_md_mempools(md, type, t->integrity_supported, per_io_data_size); |
976 | if (!t->mempools) | 976 | if (!t->mempools) |
977 | return -ENOMEM; | 977 | return -ENOMEM; |
978 | 978 | ||
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 72d91f477683..4fbbe1fb9f08 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -4037,7 +4037,7 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
4037 | 4037 | ||
4038 | ti->num_flush_bios = 1; | 4038 | ti->num_flush_bios = 1; |
4039 | ti->flush_supported = true; | 4039 | ti->flush_supported = true; |
4040 | ti->per_bio_data_size = sizeof(struct dm_thin_endio_hook); | 4040 | ti->per_io_data_size = sizeof(struct dm_thin_endio_hook); |
4041 | 4041 | ||
4042 | /* In case the pool supports discards, pass them on. */ | 4042 | /* In case the pool supports discards, pass them on. */ |
4043 | ti->discard_zeroes_data_unsupported = true; | 4043 | ti->discard_zeroes_data_unsupported = true; |
diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c index 1cc10c4de701..459a9f8905ed 100644 --- a/drivers/md/dm-verity-fec.c +++ b/drivers/md/dm-verity-fec.c | |||
@@ -812,7 +812,7 @@ int verity_fec_ctr(struct dm_verity *v) | |||
812 | } | 812 | } |
813 | 813 | ||
814 | /* Reserve space for our per-bio data */ | 814 | /* Reserve space for our per-bio data */ |
815 | ti->per_bio_data_size += sizeof(struct dm_verity_fec_io); | 815 | ti->per_io_data_size += sizeof(struct dm_verity_fec_io); |
816 | 816 | ||
817 | return 0; | 817 | return 0; |
818 | } | 818 | } |
diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 5c5d30cb6ec5..0aba34a7b3b3 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c | |||
@@ -354,7 +354,7 @@ int verity_for_bv_block(struct dm_verity *v, struct dm_verity_io *io, | |||
354 | size_t len)) | 354 | size_t len)) |
355 | { | 355 | { |
356 | unsigned todo = 1 << v->data_dev_block_bits; | 356 | unsigned todo = 1 << v->data_dev_block_bits; |
357 | struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_bio_data_size); | 357 | struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_io_data_size); |
358 | 358 | ||
359 | do { | 359 | do { |
360 | int r; | 360 | int r; |
@@ -460,7 +460,7 @@ static int verity_verify_io(struct dm_verity_io *io) | |||
460 | static void verity_finish_io(struct dm_verity_io *io, int error) | 460 | static void verity_finish_io(struct dm_verity_io *io, int error) |
461 | { | 461 | { |
462 | struct dm_verity *v = io->v; | 462 | struct dm_verity *v = io->v; |
463 | struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_bio_data_size); | 463 | struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_io_data_size); |
464 | 464 | ||
465 | bio->bi_end_io = io->orig_bi_end_io; | 465 | bio->bi_end_io = io->orig_bi_end_io; |
466 | bio->bi_error = error; | 466 | bio->bi_error = error; |
@@ -574,7 +574,7 @@ static int verity_map(struct dm_target *ti, struct bio *bio) | |||
574 | if (bio_data_dir(bio) == WRITE) | 574 | if (bio_data_dir(bio) == WRITE) |
575 | return -EIO; | 575 | return -EIO; |
576 | 576 | ||
577 | io = dm_per_bio_data(bio, ti->per_bio_data_size); | 577 | io = dm_per_bio_data(bio, ti->per_io_data_size); |
578 | io->v = v; | 578 | io->v = v; |
579 | io->orig_bi_end_io = bio->bi_end_io; | 579 | io->orig_bi_end_io = bio->bi_end_io; |
580 | io->block = bio->bi_iter.bi_sector >> (v->data_dev_block_bits - SECTOR_SHIFT); | 580 | io->block = bio->bi_iter.bi_sector >> (v->data_dev_block_bits - SECTOR_SHIFT); |
@@ -1036,15 +1036,15 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
1036 | goto bad; | 1036 | goto bad; |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | ti->per_bio_data_size = sizeof(struct dm_verity_io) + | 1039 | ti->per_io_data_size = sizeof(struct dm_verity_io) + |
1040 | v->shash_descsize + v->digest_size * 2; | 1040 | v->shash_descsize + v->digest_size * 2; |
1041 | 1041 | ||
1042 | r = verity_fec_ctr(v); | 1042 | r = verity_fec_ctr(v); |
1043 | if (r) | 1043 | if (r) |
1044 | goto bad; | 1044 | goto bad; |
1045 | 1045 | ||
1046 | ti->per_bio_data_size = roundup(ti->per_bio_data_size, | 1046 | ti->per_io_data_size = roundup(ti->per_io_data_size, |
1047 | __alignof__(struct dm_verity_io)); | 1047 | __alignof__(struct dm_verity_io)); |
1048 | 1048 | ||
1049 | return 0; | 1049 | return 0; |
1050 | 1050 | ||
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index d4040e6d4d3d..89aa9618c061 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -3476,7 +3476,7 @@ int dm_noflush_suspending(struct dm_target *ti) | |||
3476 | EXPORT_SYMBOL_GPL(dm_noflush_suspending); | 3476 | EXPORT_SYMBOL_GPL(dm_noflush_suspending); |
3477 | 3477 | ||
3478 | struct dm_md_mempools *dm_alloc_md_mempools(struct mapped_device *md, unsigned type, | 3478 | struct dm_md_mempools *dm_alloc_md_mempools(struct mapped_device *md, unsigned type, |
3479 | unsigned integrity, unsigned per_bio_data_size) | 3479 | unsigned integrity, unsigned per_io_data_size) |
3480 | { | 3480 | { |
3481 | struct dm_md_mempools *pools = kzalloc(sizeof(*pools), GFP_KERNEL); | 3481 | struct dm_md_mempools *pools = kzalloc(sizeof(*pools), GFP_KERNEL); |
3482 | struct kmem_cache *cachep = NULL; | 3482 | struct kmem_cache *cachep = NULL; |
@@ -3492,7 +3492,7 @@ struct dm_md_mempools *dm_alloc_md_mempools(struct mapped_device *md, unsigned t | |||
3492 | case DM_TYPE_BIO_BASED: | 3492 | case DM_TYPE_BIO_BASED: |
3493 | cachep = _io_cache; | 3493 | cachep = _io_cache; |
3494 | pool_size = dm_get_reserved_bio_based_ios(); | 3494 | pool_size = dm_get_reserved_bio_based_ios(); |
3495 | front_pad = roundup(per_bio_data_size, __alignof__(struct dm_target_io)) + offsetof(struct dm_target_io, clone); | 3495 | front_pad = roundup(per_io_data_size, __alignof__(struct dm_target_io)) + offsetof(struct dm_target_io, clone); |
3496 | break; | 3496 | break; |
3497 | case DM_TYPE_REQUEST_BASED: | 3497 | case DM_TYPE_REQUEST_BASED: |
3498 | cachep = _rq_tio_cache; | 3498 | cachep = _rq_tio_cache; |
@@ -3505,8 +3505,8 @@ struct dm_md_mempools *dm_alloc_md_mempools(struct mapped_device *md, unsigned t | |||
3505 | if (!pool_size) | 3505 | if (!pool_size) |
3506 | pool_size = dm_get_reserved_rq_based_ios(); | 3506 | pool_size = dm_get_reserved_rq_based_ios(); |
3507 | front_pad = offsetof(struct dm_rq_clone_bio_info, clone); | 3507 | front_pad = offsetof(struct dm_rq_clone_bio_info, clone); |
3508 | /* per_bio_data_size is not used. See __bind_mempools(). */ | 3508 | /* per_io_data_size is not used. */ |
3509 | WARN_ON(per_bio_data_size != 0); | 3509 | WARN_ON(per_io_data_size != 0); |
3510 | break; | 3510 | break; |
3511 | default: | 3511 | default: |
3512 | BUG(); | 3512 | BUG(); |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 87d50ecbc9df..82ae3b5e2c45 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -238,10 +238,10 @@ struct dm_target { | |||
238 | unsigned num_write_same_bios; | 238 | unsigned num_write_same_bios; |
239 | 239 | ||
240 | /* | 240 | /* |
241 | * The minimum number of extra bytes allocated in each bio for the | 241 | * The minimum number of extra bytes allocated in each io for the |
242 | * target to use. dm_per_bio_data returns the data location. | 242 | * target to use. |
243 | */ | 243 | */ |
244 | unsigned per_bio_data_size; | 244 | unsigned per_io_data_size; |
245 | 245 | ||
246 | /* | 246 | /* |
247 | * If defined, this function is called to find out how many | 247 | * If defined, this function is called to find out how many |