Lines Matching refs:ti

54 			  struct dm_target *ti)
72 r = dm_read_arg_group(_args, as, &argc, &ti->error);
81 ti->error = "Insufficient feature arguments";
90 ti->error = "Feature error_reads duplicated";
101 ti->error = "Feature drop_writes duplicated";
104 ti->error = "Feature drop_writes conflicts with feature error_writes";
116 ti->error = "Feature error_writes duplicated";
120 ti->error = "Feature error_writes conflicts with feature drop_writes";
132 ti->error = "Feature corrupt_bio_byte requires parameters";
136 r = dm_read_arg(_args + 1, as, &fc->corrupt_bio_byte, &ti->error);
150 ti->error = "Invalid corrupt bio direction (r or w)";
158 r = dm_read_arg(_args + 2, as, &fc->corrupt_bio_value, &ti->error);
170 &ti->error);
180 ti->error = "Feature random_read_corrupt requires a parameter";
183 r = dm_read_arg(_args + 4, as, &fc->random_read_corrupt, &ti->error);
193 ti->error = "Feature random_write_corrupt requires a parameter";
196 r = dm_read_arg(_args + 4, as, &fc->random_write_corrupt, &ti->error);
204 ti->error = "Unrecognised flakey feature requested";
209 ti->error = "drop_writes is incompatible with corrupt_bio_byte with the WRITE flag set";
213 ti->error = "error_writes is incompatible with corrupt_bio_byte with the WRITE flag set";
239 static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
257 ti->error = "Invalid argument count";
263 ti->error = "Cannot allocate context";
272 ti->error = "Invalid device sector";
277 r = dm_read_arg(_args, &as, &fc->up_interval, &ti->error);
281 r = dm_read_arg(_args, &as, &fc->down_interval, &ti->error);
286 ti->error = "Total (up + down) interval is zero";
292 ti->error = "Interval overflow";
297 r = parse_features(&as, fc, ti);
301 r = dm_get_device(ti, devname, dm_table_get_mode(ti->table), &fc->dev);
303 ti->error = "Device lookup failed";
307 ti->num_flush_bios = 1;
308 ti->num_discard_bios = 1;
309 ti->per_io_data_size = sizeof(struct per_bio_data);
310 ti->private = fc;
318 static void flakey_dtr(struct dm_target *ti)
320 struct flakey_c *fc = ti->private;
322 dm_put_device(ti, fc->dev);
326 static sector_t flakey_map_sector(struct dm_target *ti, sector_t bi_sector)
328 struct flakey_c *fc = ti->private;
330 return fc->start + dm_target_offset(ti, bi_sector);
333 static void flakey_map_bio(struct dm_target *ti, struct bio *bio)
335 struct flakey_c *fc = ti->private;
338 bio->bi_iter.bi_sector = flakey_map_sector(ti, bio->bi_iter.bi_sector);
413 static struct bio *clone_bio(struct dm_target *ti, struct flakey_c *fc, struct bio *bio)
431 clone->bi_iter.bi_sector = flakey_map_sector(ti, bio->bi_iter.bi_sector);
478 static int flakey_map(struct dm_target *ti, struct bio *bio)
480 struct flakey_c *fc = ti->private;
535 struct bio *clone = clone_bio(ti, fc, bio);
548 flakey_map_bio(ti, bio);
553 static int flakey_end_io(struct dm_target *ti, struct bio *bio,
556 struct flakey_c *fc = ti->private;
590 static void flakey_status(struct dm_target *ti, status_type_t type,
594 struct flakey_c *fc = ti->private;
641 static int flakey_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
643 struct flakey_c *fc = ti->private;
650 if (fc->start || ti->len != bdev_nr_sectors((*bdev)))
656 static int flakey_report_zones(struct dm_target *ti,
659 struct flakey_c *fc = ti->private;
662 flakey_map_sector(ti, args->next_sector),
669 static int flakey_iterate_devices(struct dm_target *ti, iterate_devices_callout_fn fn, void *data)
671 struct flakey_c *fc = ti->private;
673 return fn(ti, fc->dev, fc->start, ti->len, data);