dm-flakey: don't use map_info Don't use map_info and use a per-bio structure "struct per_bio_data" instead. Signed-off-by: Mikulas Patocka --- drivers/md/dm-flakey.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) Index: linux-3.7-rc6/drivers/md/dm-flakey.c =================================================================== --- linux-3.7-rc6.orig/drivers/md/dm-flakey.c 2012-11-19 00:09:10.000000000 +0100 +++ linux-3.7-rc6/drivers/md/dm-flakey.c 2012-11-19 00:23:47.000000000 +0100 @@ -39,6 +39,10 @@ enum feature_flag_bits { DROP_WRITES }; +struct per_bio_data { + bool bio_submitted; +}; + static int parse_features(struct dm_arg_set *as, struct flakey_c *fc, struct dm_target *ti) { @@ -214,6 +218,7 @@ static int flakey_ctr(struct dm_target * ti->num_flush_requests = 1; ti->num_discard_requests = 1; + ti->per_request_data = sizeof(struct per_bio_data); ti->private = fc; return 0; @@ -270,6 +275,8 @@ static int flakey_map(struct dm_target * { struct flakey_c *fc = ti->private; unsigned elapsed; + struct per_bio_data *pb = dm_bio_get_per_request_data(bio, sizeof(struct per_bio_data)); + pb->bio_submitted = false; /* Are we alive ? */ elapsed = (jiffies - fc->start_time) / HZ; @@ -277,7 +284,7 @@ static int flakey_map(struct dm_target * /* * Flag this bio as submitted while down. */ - map_context->ll = 1; + pb->bio_submitted = true; /* * Map reads as normal. @@ -318,13 +325,13 @@ static int flakey_end_io(struct dm_targe int error, union map_info *map_context) { struct flakey_c *fc = ti->private; - unsigned bio_submitted_while_down = map_context->ll; + struct per_bio_data *pb = dm_bio_get_per_request_data(bio, sizeof(struct per_bio_data)); /* * Corrupt successful READs while in down state. * If flags were specified, only corrupt those that match. */ - if (fc->corrupt_bio_byte && !error && bio_submitted_while_down && + if (fc->corrupt_bio_byte && !error && pb->bio_submitted && (bio_data_dir(bio) == READ) && (fc->corrupt_bio_rw == READ) && all_corrupt_bio_flags_match(bio, fc)) corrupt_bio_data(bio, fc);