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 --- drivers/md/dm-crypt.c | 3 +-- drivers/md/dm-delay.c | 3 +-- drivers/md/dm-flakey.c | 6 ++---- drivers/md/dm-linear.c | 3 +-- drivers/md/dm-raid.c | 2 +- drivers/md/dm-raid1.c | 6 ++---- drivers/md/dm-snap.c | 12 ++++-------- drivers/md/dm-stripe.c | 6 ++---- drivers/md/dm-switch.c | 3 +-- drivers/md/dm-target.c | 3 +-- drivers/md/dm-thin.c | 15 +++++---------- drivers/md/dm-verity.c | 3 +-- drivers/md/dm-zero.c | 3 +-- drivers/md/dm.c | 4 ++-- include/linux/device-mapper.h | 6 ++---- 15 files changed, 27 insertions(+), 51 deletions(-) Index: linux-3.7-rc6/include/linux/device-mapper.h =================================================================== --- linux-3.7-rc6.orig/include/linux/device-mapper.h 2012-11-19 20:53:43.000000000 +0100 +++ linux-3.7-rc6/include/linux/device-mapper.h 2012-11-19 21:20:33.000000000 +0100 @@ -45,8 +45,7 @@ typedef void (*dm_dtr_fn) (struct dm_tar * = 1: simple remap complete * = 2: The target wants to push back the io */ -typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, - union map_info *map_context); +typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio); typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, union map_info *map_context); @@ -59,8 +58,7 @@ typedef int (*dm_map_request_fn) (struct * 2 : The target wants to push back the io */ typedef int (*dm_endio_fn) (struct dm_target *ti, - struct bio *bio, int error, - union map_info *map_context); + struct bio *bio, int error); typedef int (*dm_request_endio_fn) (struct dm_target *ti, struct request *clone, int error, union map_info *map_context); Index: linux-3.7-rc6/drivers/md/dm-raid1.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-raid1.c 2012-11-19 20:53:43.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-raid1.c 2012-11-19 21:20:33.000000000 +0100 @@ -1145,8 +1145,7 @@ static void mirror_dtr(struct dm_target /* * Mirror mapping function */ -static int mirror_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int mirror_map(struct dm_target *ti, struct bio *bio) { int r, rw = bio_rw(bio); struct mirror *m; @@ -1195,8 +1194,7 @@ static int mirror_map(struct dm_target * return DM_MAPIO_REMAPPED; } -static int mirror_end_io(struct dm_target *ti, struct bio *bio, - int error, union map_info *map_context) +static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error) { int rw = bio_rw(bio); struct mirror_set *ms = (struct mirror_set *) ti->private; Index: linux-3.7-rc6/drivers/md/dm.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm.c 2012-11-19 20:53:43.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm.c 2012-11-19 21:20:33.000000000 +0100 @@ -673,7 +673,7 @@ static void clone_endio(struct bio *bio, error = -EIO; if (endio) { - r = endio(tio->ti, bio, error, &tio->info); + r = endio(tio->ti, bio, error); if (r < 0 || r == DM_ENDIO_REQUEUE) /* * error and requeue request are handled @@ -1026,7 +1026,7 @@ static void __map_bio(struct dm_target * */ atomic_inc(&tio->io->io_count); sector = clone->bi_sector; - r = ti->type->map(ti, clone, &tio->info); + r = ti->type->map(ti, clone); if (r == DM_MAPIO_REMAPPED) { /* the bio has been remapped so dispatch it */ Index: linux-3.7-rc6/drivers/md/dm-crypt.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-crypt.c 2012-11-19 20:53:43.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-crypt.c 2012-11-19 21:20:33.000000000 +0100 @@ -1764,8 +1764,7 @@ bad: return ret; } -static int crypt_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int crypt_map(struct dm_target *ti, struct bio *bio) { struct dm_crypt_io *io; struct crypt_config *cc = ti->private; Index: linux-3.7-rc6/drivers/md/dm-delay.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-delay.c 2012-11-19 20:53:43.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-delay.c 2012-11-19 21:20:33.000000000 +0100 @@ -274,8 +274,7 @@ static void delay_resume(struct dm_targe atomic_set(&dc->may_delay, 1); } -static int delay_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int delay_map(struct dm_target *ti, struct bio *bio) { struct delay_c *dc = ti->private; Index: linux-3.7-rc6/drivers/md/dm-linear.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-linear.c 2012-11-19 20:53:43.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-linear.c 2012-11-19 21:20:33.000000000 +0100 @@ -87,8 +87,7 @@ static void linear_map_bio(struct dm_tar bio->bi_sector = linear_map_sector(ti, bio->bi_sector); } -static int linear_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int linear_map(struct dm_target *ti, struct bio *bio) { linear_map_bio(ti, bio); Index: linux-3.7-rc6/drivers/md/dm-stripe.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-stripe.c 2012-11-19 20:53:44.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-stripe.c 2012-11-19 21:20:33.000000000 +0100 @@ -271,8 +271,7 @@ static int stripe_map_discard(struct str } } -static int stripe_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int stripe_map(struct dm_target *ti, struct bio *bio) { struct stripe_c *sc = ti->private; uint32_t stripe; @@ -342,8 +341,7 @@ static int stripe_status(struct dm_targe return 0; } -static int stripe_end_io(struct dm_target *ti, struct bio *bio, - int error, union map_info *map_context) +static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error) { unsigned i; char major_minor[16]; Index: linux-3.7-rc6/drivers/md/dm-target.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-target.c 2012-11-19 20:53:44.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-target.c 2012-11-19 21:20:33.000000000 +0100 @@ -126,8 +126,7 @@ static void io_err_dtr(struct dm_target /* empty */ } -static int io_err_map(struct dm_target *tt, struct bio *bio, - union map_info *map_context) +static int io_err_map(struct dm_target *tt, struct bio *bio) { return -EIO; } Index: linux-3.7-rc6/drivers/md/dm-raid.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-raid.c 2012-11-19 20:53:44.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-raid.c 2012-11-19 21:20:33.000000000 +0100 @@ -1216,7 +1216,7 @@ static void raid_dtr(struct dm_target *t context_free(rs); } -static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context) +static int raid_map(struct dm_target *ti, struct bio *bio) { struct raid_set *rs = ti->private; struct mddev *mddev = &rs->md; Index: linux-3.7-rc6/drivers/md/dm-switch.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-switch.c 2012-11-19 20:53:44.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-switch.c 2012-11-19 21:20:33.000000000 +0100 @@ -283,8 +283,7 @@ static void switch_dtr(struct dm_target kfree(pctx); } -static int switch_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int switch_map(struct dm_target *ti, struct bio *bio) { struct switch_ctx *pctx = ti->private; Index: linux-3.7-rc6/drivers/md/dm-verity.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-verity.c 2012-11-19 20:53:44.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-verity.c 2012-11-19 21:20:33.000000000 +0100 @@ -458,8 +458,7 @@ no_prefetch_cluster: * Bio map function. It allocates dm_verity_io structure and bio vector and * fills them. Then it issues prefetches and the I/O. */ -static int verity_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int verity_map(struct dm_target *ti, struct bio *bio) { struct dm_verity *v = ti->private; struct dm_verity_io *io; Index: linux-3.7-rc6/drivers/md/dm-zero.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-zero.c 2012-11-19 20:53:44.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-zero.c 2012-11-19 21:20:33.000000000 +0100 @@ -33,8 +33,7 @@ static int zero_ctr(struct dm_target *ti /* * Return zeros only on reads */ -static int zero_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int zero_map(struct dm_target *ti, struct bio *bio) { switch(bio_rw(bio)) { case READ: Index: linux-3.7-rc6/drivers/md/dm-flakey.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-flakey.c 2012-11-19 20:53:44.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-flakey.c 2012-11-19 21:20:33.000000000 +0100 @@ -270,8 +270,7 @@ static void corrupt_bio_data(struct bio } } -static int flakey_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int flakey_map(struct dm_target *ti, struct bio *bio) { struct flakey_c *fc = ti->private; unsigned elapsed; @@ -321,8 +320,7 @@ map_bio: return DM_MAPIO_REMAPPED; } -static int flakey_end_io(struct dm_target *ti, struct bio *bio, - int error, union map_info *map_context) +static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error) { struct flakey_c *fc = ti->private; struct per_bio_data *pb = dm_bio_get_per_request_data(bio, sizeof(struct per_bio_data)); Index: linux-3.7-rc6/drivers/md/dm-thin.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-thin.c 2012-11-19 21:16:43.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-thin.c 2012-11-19 21:20:33.000000000 +0100 @@ -1356,8 +1356,7 @@ static void thin_hook_bio(struct thin_c /* * Non-blocking function called from the thin target's map function. */ -static int thin_bio_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int thin_bio_map(struct dm_target *ti, struct bio *bio) { int r; struct thin_c *tc = ti->private; @@ -1955,8 +1954,7 @@ out_unlock: return r; } -static int pool_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int pool_map(struct dm_target *ti, struct bio *bio) { int r; struct pool_c *pt = ti->private; @@ -2599,17 +2597,14 @@ out_unlock: return r; } -static int thin_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int thin_map(struct dm_target *ti, struct bio *bio) { bio->bi_sector = dm_target_offset(ti, bio->bi_sector); - return thin_bio_map(ti, bio, map_context); + return thin_bio_map(ti, bio); } -static int thin_endio(struct dm_target *ti, - struct bio *bio, int err, - union map_info *map_context) +static int thin_endio(struct dm_target *ti, struct bio *bio, int err) { unsigned long flags; struct dm_thin_endio_hook *h = dm_bio_get_per_request_data(bio, sizeof(struct dm_thin_endio_hook)); Index: linux-3.7-rc6/drivers/md/dm-snap.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-snap.c 2012-11-19 21:21:35.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-snap.c 2012-11-19 21:21:50.000000000 +0100 @@ -1570,8 +1570,7 @@ static void remap_exception(struct dm_sn s->store->chunk_mask); } -static int snapshot_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int snapshot_map(struct dm_target *ti, struct bio *bio) { struct dm_exception *e; struct dm_snapshot *s = ti->private; @@ -1686,8 +1685,7 @@ out: * If merging is currently taking place on the chunk in question, the * I/O is deferred by adding it to s->bios_queued_during_merge. */ -static int snapshot_merge_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int snapshot_merge_map(struct dm_target *ti, struct bio *bio) { struct dm_exception *e; struct dm_snapshot *s = ti->private; @@ -1747,8 +1745,7 @@ out_unlock: return r; } -static int snapshot_end_io(struct dm_target *ti, struct bio *bio, - int error, union map_info *map_context) +static int snapshot_end_io(struct dm_target *ti, struct bio *bio, int error) { struct dm_snapshot *s = ti->private; @@ -2122,8 +2119,7 @@ static void origin_dtr(struct dm_target dm_put_device(ti, dev); } -static int origin_map(struct dm_target *ti, struct bio *bio, - union map_info *map_context) +static int origin_map(struct dm_target *ti, struct bio *bio) { struct dm_dev *dev = ti->private; bio->bi_bdev = dev->bdev;