dm-flakey.c (c7cfdf5973f644a21ef4a0a0f1aa1f081efc42c1) dm-flakey.c (7de3ee57da4b717050e79c9313a9bf66ccc72519)
1/*
2 * Copyright (C) 2003 Sistina Software (UK) Limited.
3 * Copyright (C) 2004, 2010-2011 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include <linux/device-mapper.h>

--- 256 unchanged lines hidden (view full) ---

265 DMDEBUG("Corrupting data bio=%p by writing %u to byte %u "
266 "(rw=%c bi_rw=%lu bi_sector=%llu cur_bytes=%u)\n",
267 bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,
268 (bio_data_dir(bio) == WRITE) ? 'w' : 'r',
269 bio->bi_rw, (unsigned long long)bio->bi_sector, bio_bytes);
270 }
271}
272
1/*
2 * Copyright (C) 2003 Sistina Software (UK) Limited.
3 * Copyright (C) 2004, 2010-2011 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include <linux/device-mapper.h>

--- 256 unchanged lines hidden (view full) ---

265 DMDEBUG("Corrupting data bio=%p by writing %u to byte %u "
266 "(rw=%c bi_rw=%lu bi_sector=%llu cur_bytes=%u)\n",
267 bio, fc->corrupt_bio_value, fc->corrupt_bio_byte,
268 (bio_data_dir(bio) == WRITE) ? 'w' : 'r',
269 bio->bi_rw, (unsigned long long)bio->bi_sector, bio_bytes);
270 }
271}
272
273static int flakey_map(struct dm_target *ti, struct bio *bio,
274 union map_info *map_context)
273static int flakey_map(struct dm_target *ti, struct bio *bio)
275{
276 struct flakey_c *fc = ti->private;
277 unsigned elapsed;
278 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
279 pb->bio_submitted = false;
280
281 /* Are we alive ? */
282 elapsed = (jiffies - fc->start_time) / HZ;

--- 33 unchanged lines hidden (view full) ---

316 }
317
318map_bio:
319 flakey_map_bio(ti, bio);
320
321 return DM_MAPIO_REMAPPED;
322}
323
274{
275 struct flakey_c *fc = ti->private;
276 unsigned elapsed;
277 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
278 pb->bio_submitted = false;
279
280 /* Are we alive ? */
281 elapsed = (jiffies - fc->start_time) / HZ;

--- 33 unchanged lines hidden (view full) ---

315 }
316
317map_bio:
318 flakey_map_bio(ti, bio);
319
320 return DM_MAPIO_REMAPPED;
321}
322
324static int flakey_end_io(struct dm_target *ti, struct bio *bio,
325 int error, union map_info *map_context)
323static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error)
326{
327 struct flakey_c *fc = ti->private;
328 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
329
330 /*
331 * Corrupt successful READs while in down state.
332 * If flags were specified, only corrupt those that match.
333 */

--- 116 unchanged lines hidden ---
324{
325 struct flakey_c *fc = ti->private;
326 struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
327
328 /*
329 * Corrupt successful READs while in down state.
330 * If flags were specified, only corrupt those that match.
331 */

--- 116 unchanged lines hidden ---