aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2012-12-21 15:23:41 -0500
committerAlasdair G Kergon <agk@redhat.com>2012-12-21 15:23:41 -0500
commit7de3ee57da4b717050e79c9313a9bf66ccc72519 (patch)
treedd9bf250c6d9139528e563167cabdb811c8fd6cb /drivers
parentee18026ac69efba804144541171299efd41747d2 (diff)
dm: remove map_info
This patch removes map_info from bio-based device mapper targets. map_info is still used for request-based targets. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-crypt.c5
-rw-r--r--drivers/md/dm-delay.c5
-rw-r--r--drivers/md/dm-flakey.c6
-rw-r--r--drivers/md/dm-linear.c3
-rw-r--r--drivers/md/dm-raid.c4
-rw-r--r--drivers/md/dm-raid1.c6
-rw-r--r--drivers/md/dm-snap.c12
-rw-r--r--drivers/md/dm-stripe.c6
-rw-r--r--drivers/md/dm-target.c5
-rw-r--r--drivers/md/dm-thin.c15
-rw-r--r--drivers/md/dm-verity.c3
-rw-r--r--drivers/md/dm-zero.c5
-rw-r--r--drivers/md/dm.c4
13 files changed, 29 insertions, 50 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index bbf459bca61..f7369f9d859 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1689,8 +1689,7 @@ bad:
1689 return ret; 1689 return ret;
1690} 1690}
1691 1691
1692static int crypt_map(struct dm_target *ti, struct bio *bio, 1692static int crypt_map(struct dm_target *ti, struct bio *bio)
1693 union map_info *map_context)
1694{ 1693{
1695 struct dm_crypt_io *io; 1694 struct dm_crypt_io *io;
1696 struct crypt_config *cc = ti->private; 1695 struct crypt_config *cc = ti->private;
@@ -1846,7 +1845,7 @@ static int crypt_iterate_devices(struct dm_target *ti,
1846 1845
1847static struct target_type crypt_target = { 1846static struct target_type crypt_target = {
1848 .name = "crypt", 1847 .name = "crypt",
1849 .version = {1, 11, 0}, 1848 .version = {1, 12, 0},
1850 .module = THIS_MODULE, 1849 .module = THIS_MODULE,
1851 .ctr = crypt_ctr, 1850 .ctr = crypt_ctr,
1852 .dtr = crypt_dtr, 1851 .dtr = crypt_dtr,
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index f53846f9ab5..cc1bd048acb 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -274,8 +274,7 @@ static void delay_resume(struct dm_target *ti)
274 atomic_set(&dc->may_delay, 1); 274 atomic_set(&dc->may_delay, 1);
275} 275}
276 276
277static int delay_map(struct dm_target *ti, struct bio *bio, 277static int delay_map(struct dm_target *ti, struct bio *bio)
278 union map_info *map_context)
279{ 278{
280 struct delay_c *dc = ti->private; 279 struct delay_c *dc = ti->private;
281 280
@@ -338,7 +337,7 @@ out:
338 337
339static struct target_type delay_target = { 338static struct target_type delay_target = {
340 .name = "delay", 339 .name = "delay",
341 .version = {1, 1, 0}, 340 .version = {1, 2, 0},
342 .module = THIS_MODULE, 341 .module = THIS_MODULE,
343 .ctr = delay_ctr, 342 .ctr = delay_ctr,
344 .dtr = delay_dtr, 343 .dtr = delay_dtr,
diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c
index 660f98167e7..9721f2ffb1a 100644
--- a/drivers/md/dm-flakey.c
+++ b/drivers/md/dm-flakey.c
@@ -270,8 +270,7 @@ static void corrupt_bio_data(struct bio *bio, struct flakey_c *fc)
270 } 270 }
271} 271}
272 272
273static int flakey_map(struct dm_target *ti, struct bio *bio, 273static int flakey_map(struct dm_target *ti, struct bio *bio)
274 union map_info *map_context)
275{ 274{
276 struct flakey_c *fc = ti->private; 275 struct flakey_c *fc = ti->private;
277 unsigned elapsed; 276 unsigned elapsed;
@@ -321,8 +320,7 @@ map_bio:
321 return DM_MAPIO_REMAPPED; 320 return DM_MAPIO_REMAPPED;
322} 321}
323 322
324static int flakey_end_io(struct dm_target *ti, struct bio *bio, 323static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error)
325 int error, union map_info *map_context)
326{ 324{
327 struct flakey_c *fc = ti->private; 325 struct flakey_c *fc = ti->private;
328 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data)); 326 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 82222a8cf75..328cad5617a 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -88,8 +88,7 @@ static void linear_map_bio(struct dm_target *ti, struct bio *bio)
88 bio->bi_sector = linear_map_sector(ti, bio->bi_sector); 88 bio->bi_sector = linear_map_sector(ti, bio->bi_sector);
89} 89}
90 90
91static int linear_map(struct dm_target *ti, struct bio *bio, 91static int linear_map(struct dm_target *ti, struct bio *bio)
92 union map_info *map_context)
93{ 92{
94 linear_map_bio(ti, bio); 93 linear_map_bio(ti, bio);
95 94
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 4a20bf8c72d..3d8984edeff 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -1218,7 +1218,7 @@ static void raid_dtr(struct dm_target *ti)
1218 context_free(rs); 1218 context_free(rs);
1219} 1219}
1220 1220
1221static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context) 1221static int raid_map(struct dm_target *ti, struct bio *bio)
1222{ 1222{
1223 struct raid_set *rs = ti->private; 1223 struct raid_set *rs = ti->private;
1224 struct mddev *mddev = &rs->md; 1224 struct mddev *mddev = &rs->md;
@@ -1432,7 +1432,7 @@ static void raid_resume(struct dm_target *ti)
1432 1432
1433static struct target_type raid_target = { 1433static struct target_type raid_target = {
1434 .name = "raid", 1434 .name = "raid",
1435 .version = {1, 3, 1}, 1435 .version = {1, 4, 0},
1436 .module = THIS_MODULE, 1436 .module = THIS_MODULE,
1437 .ctr = raid_ctr, 1437 .ctr = raid_ctr,
1438 .dtr = raid_dtr, 1438 .dtr = raid_dtr,
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 57685cf0afa..fa519185ebb 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -1142,8 +1142,7 @@ static void mirror_dtr(struct dm_target *ti)
1142/* 1142/*
1143 * Mirror mapping function 1143 * Mirror mapping function
1144 */ 1144 */
1145static int mirror_map(struct dm_target *ti, struct bio *bio, 1145static int mirror_map(struct dm_target *ti, struct bio *bio)
1146 union map_info *map_context)
1147{ 1146{
1148 int r, rw = bio_rw(bio); 1147 int r, rw = bio_rw(bio);
1149 struct mirror *m; 1148 struct mirror *m;
@@ -1192,8 +1191,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio,
1192 return DM_MAPIO_REMAPPED; 1191 return DM_MAPIO_REMAPPED;
1193} 1192}
1194 1193
1195static int mirror_end_io(struct dm_target *ti, struct bio *bio, 1194static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
1196 int error, union map_info *map_context)
1197{ 1195{
1198 int rw = bio_rw(bio); 1196 int rw = bio_rw(bio);
1199 struct mirror_set *ms = (struct mirror_set *) ti->private; 1197 struct mirror_set *ms = (struct mirror_set *) ti->private;
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index e1ecacf2456..59fc18ae52c 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1567,8 +1567,7 @@ static void remap_exception(struct dm_snapshot *s, struct dm_exception *e,
1567 s->store->chunk_mask); 1567 s->store->chunk_mask);
1568} 1568}
1569 1569
1570static int snapshot_map(struct dm_target *ti, struct bio *bio, 1570static int snapshot_map(struct dm_target *ti, struct bio *bio)
1571 union map_info *map_context)
1572{ 1571{
1573 struct dm_exception *e; 1572 struct dm_exception *e;
1574 struct dm_snapshot *s = ti->private; 1573 struct dm_snapshot *s = ti->private;
@@ -1683,8 +1682,7 @@ out:
1683 * If merging is currently taking place on the chunk in question, the 1682 * If merging is currently taking place on the chunk in question, the
1684 * I/O is deferred by adding it to s->bios_queued_during_merge. 1683 * I/O is deferred by adding it to s->bios_queued_during_merge.
1685 */ 1684 */
1686static int snapshot_merge_map(struct dm_target *ti, struct bio *bio, 1685static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
1687 union map_info *map_context)
1688{ 1686{
1689 struct dm_exception *e; 1687 struct dm_exception *e;
1690 struct dm_snapshot *s = ti->private; 1688 struct dm_snapshot *s = ti->private;
@@ -1744,8 +1742,7 @@ out_unlock:
1744 return r; 1742 return r;
1745} 1743}
1746 1744
1747static int snapshot_end_io(struct dm_target *ti, struct bio *bio, 1745static int snapshot_end_io(struct dm_target *ti, struct bio *bio, int error)
1748 int error, union map_info *map_context)
1749{ 1746{
1750 struct dm_snapshot *s = ti->private; 1747 struct dm_snapshot *s = ti->private;
1751 1748
@@ -2119,8 +2116,7 @@ static void origin_dtr(struct dm_target *ti)
2119 dm_put_device(ti, dev); 2116 dm_put_device(ti, dev);
2120} 2117}
2121 2118
2122static int origin_map(struct dm_target *ti, struct bio *bio, 2119static int origin_map(struct dm_target *ti, struct bio *bio)
2123 union map_info *map_context)
2124{ 2120{
2125 struct dm_dev *dev = ti->private; 2121 struct dm_dev *dev = ti->private;
2126 bio->bi_bdev = dev->bdev; 2122 bio->bi_bdev = dev->bdev;
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 4e7ba82146c..6b0e5ea3802 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -271,8 +271,7 @@ static int stripe_map_discard(struct stripe_c *sc, struct bio *bio,
271 } 271 }
272} 272}
273 273
274static int stripe_map(struct dm_target *ti, struct bio *bio, 274static int stripe_map(struct dm_target *ti, struct bio *bio)
275 union map_info *map_context)
276{ 275{
277 struct stripe_c *sc = ti->private; 276 struct stripe_c *sc = ti->private;
278 uint32_t stripe; 277 uint32_t stripe;
@@ -342,8 +341,7 @@ static int stripe_status(struct dm_target *ti, status_type_t type,
342 return 0; 341 return 0;
343} 342}
344 343
345static int stripe_end_io(struct dm_target *ti, struct bio *bio, 344static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error)
346 int error, union map_info *map_context)
347{ 345{
348 unsigned i; 346 unsigned i;
349 char major_minor[16]; 347 char major_minor[16];
diff --git a/drivers/md/dm-target.c b/drivers/md/dm-target.c
index 8da366cf381..617d21a7725 100644
--- a/drivers/md/dm-target.c
+++ b/drivers/md/dm-target.c
@@ -126,15 +126,14 @@ static void io_err_dtr(struct dm_target *tt)
126 /* empty */ 126 /* empty */
127} 127}
128 128
129static int io_err_map(struct dm_target *tt, struct bio *bio, 129static int io_err_map(struct dm_target *tt, struct bio *bio)
130 union map_info *map_context)
131{ 130{
132 return -EIO; 131 return -EIO;
133} 132}
134 133
135static struct target_type error_target = { 134static struct target_type error_target = {
136 .name = "error", 135 .name = "error",
137 .version = {1, 0, 1}, 136 .version = {1, 1, 0},
138 .ctr = io_err_ctr, 137 .ctr = io_err_ctr,
139 .dtr = io_err_dtr, 138 .dtr = io_err_dtr,
140 .map = io_err_map, 139 .map = io_err_map,
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index e7743c69a24..675ae527401 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -1371,8 +1371,7 @@ static void thin_hook_bio(struct thin_c *tc, struct bio *bio)
1371/* 1371/*
1372 * Non-blocking function called from the thin target's map function. 1372 * Non-blocking function called from the thin target's map function.
1373 */ 1373 */
1374static int thin_bio_map(struct dm_target *ti, struct bio *bio, 1374static int thin_bio_map(struct dm_target *ti, struct bio *bio)
1375 union map_info *map_context)
1376{ 1375{
1377 int r; 1376 int r;
1378 struct thin_c *tc = ti->private; 1377 struct thin_c *tc = ti->private;
@@ -1980,8 +1979,7 @@ out_unlock:
1980 return r; 1979 return r;
1981} 1980}
1982 1981
1983static int pool_map(struct dm_target *ti, struct bio *bio, 1982static int pool_map(struct dm_target *ti, struct bio *bio)
1984 union map_info *map_context)
1985{ 1983{
1986 int r; 1984 int r;
1987 struct pool_c *pt = ti->private; 1985 struct pool_c *pt = ti->private;
@@ -2626,17 +2624,14 @@ out_unlock:
2626 return r; 2624 return r;
2627} 2625}
2628 2626
2629static int thin_map(struct dm_target *ti, struct bio *bio, 2627static int thin_map(struct dm_target *ti, struct bio *bio)
2630 union map_info *map_context)
2631{ 2628{
2632 bio->bi_sector = dm_target_offset(ti, bio->bi_sector); 2629 bio->bi_sector = dm_target_offset(ti, bio->bi_sector);
2633 2630
2634 return thin_bio_map(ti, bio, map_context); 2631 return thin_bio_map(ti, bio);
2635} 2632}
2636 2633
2637static int thin_endio(struct dm_target *ti, 2634static int thin_endio(struct dm_target *ti, struct bio *bio, int err)
2638 struct bio *bio, int err,
2639 union map_info *map_context)
2640{ 2635{
2641 unsigned long flags; 2636 unsigned long flags;
2642 struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook)); 2637 struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));
diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c
index 78f349894b2..52cde982164 100644
--- a/drivers/md/dm-verity.c
+++ b/drivers/md/dm-verity.c
@@ -458,8 +458,7 @@ no_prefetch_cluster:
458 * Bio map function. It allocates dm_verity_io structure and bio vector and 458 * Bio map function. It allocates dm_verity_io structure and bio vector and
459 * fills them. Then it issues prefetches and the I/O. 459 * fills them. Then it issues prefetches and the I/O.
460 */ 460 */
461static int verity_map(struct dm_target *ti, struct bio *bio, 461static int verity_map(struct dm_target *ti, struct bio *bio)
462 union map_info *map_context)
463{ 462{
464 struct dm_verity *v = ti->private; 463 struct dm_verity *v = ti->private;
465 struct dm_verity_io *io; 464 struct dm_verity_io *io;
diff --git a/drivers/md/dm-zero.c b/drivers/md/dm-zero.c
index cc2b3cb8194..69a5c3b3b34 100644
--- a/drivers/md/dm-zero.c
+++ b/drivers/md/dm-zero.c
@@ -33,8 +33,7 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
33/* 33/*
34 * Return zeros only on reads 34 * Return zeros only on reads
35 */ 35 */
36static int zero_map(struct dm_target *ti, struct bio *bio, 36static int zero_map(struct dm_target *ti, struct bio *bio)
37 union map_info *map_context)
38{ 37{
39 switch(bio_rw(bio)) { 38 switch(bio_rw(bio)) {
40 case READ: 39 case READ:
@@ -56,7 +55,7 @@ static int zero_map(struct dm_target *ti, struct bio *bio,
56 55
57static struct target_type zero_target = { 56static struct target_type zero_target = {
58 .name = "zero", 57 .name = "zero",
59 .version = {1, 0, 0}, 58 .version = {1, 1, 0},
60 .module = THIS_MODULE, 59 .module = THIS_MODULE,
61 .ctr = zero_ctr, 60 .ctr = zero_ctr,
62 .map = zero_map, 61 .map = zero_map,
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 5ee580b4f33..c72e4d5a961 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -645,7 +645,7 @@ static void clone_endio(struct bio *bio, int error)
645 error = -EIO; 645 error = -EIO;
646 646
647 if (endio) { 647 if (endio) {
648 r = endio(tio->ti, bio, error, &tio->info); 648 r = endio(tio->ti, bio, error);
649 if (r < 0 || r == DM_ENDIO_REQUEUE) 649 if (r < 0 || r == DM_ENDIO_REQUEUE)
650 /* 650 /*
651 * error and requeue request are handled 651 * error and requeue request are handled
@@ -1004,7 +1004,7 @@ static void __map_bio(struct dm_target *ti, struct dm_target_io *tio)
1004 */ 1004 */
1005 atomic_inc(&tio->io->io_count); 1005 atomic_inc(&tio->io->io_count);
1006 sector = clone->bi_sector; 1006 sector = clone->bi_sector;
1007 r = ti->type->map(ti, clone, &tio->info); 1007 r = ti->type->map(ti, clone);
1008 if (r == DM_MAPIO_REMAPPED) { 1008 if (r == DM_MAPIO_REMAPPED) {
1009 /* the bio has been remapped so dispatch it */ 1009 /* the bio has been remapped so dispatch it */
1010 1010