Lines Matching refs:ti

48 			  struct dm_target *ti)
65 r = dm_read_arg_group(_args, as, &argc, &ti->error);
74 ti->error = "Insufficient feature arguments";
83 ti->error = "Feature drop_writes duplicated";
86 ti->error = "Feature drop_writes conflicts with feature error_writes";
98 ti->error = "Feature error_writes duplicated";
102 ti->error = "Feature error_writes conflicts with feature drop_writes";
114 ti->error = "Feature corrupt_bio_byte requires parameters";
118 r = dm_read_arg(_args + 1, as, &fc->corrupt_bio_byte, &ti->error);
132 ti->error = "Invalid corrupt bio direction (r or w)";
140 r = dm_read_arg(_args + 2, as, &fc->corrupt_bio_value, &ti->error);
148 r = dm_read_arg(_args + 3, as, &fc->corrupt_bio_flags, &ti->error);
156 ti->error = "Unrecognised flakey feature requested";
161 ti->error = "drop_writes is incompatible with corrupt_bio_byte with the WRITE flag set";
165 ti->error = "error_writes is incompatible with corrupt_bio_byte with the WRITE flag set";
184 static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
202 ti->error = "Invalid argument count";
208 ti->error = "Cannot allocate context";
217 ti->error = "Invalid device sector";
222 r = dm_read_arg(_args, &as, &fc->up_interval, &ti->error);
226 r = dm_read_arg(_args, &as, &fc->down_interval, &ti->error);
231 ti->error = "Total (up + down) interval is zero";
237 ti->error = "Interval overflow";
242 r = parse_features(&as, fc, ti);
246 r = dm_get_device(ti, devname, dm_table_get_mode(ti->table), &fc->dev);
248 ti->error = "Device lookup failed";
252 ti->num_flush_bios = 1;
253 ti->num_discard_bios = 1;
254 ti->per_io_data_size = sizeof(struct per_bio_data);
255 ti->private = fc;
263 static void flakey_dtr(struct dm_target *ti)
265 struct flakey_c *fc = ti->private;
267 dm_put_device(ti, fc->dev);
271 static sector_t flakey_map_sector(struct dm_target *ti, sector_t bi_sector)
273 struct flakey_c *fc = ti->private;
275 return fc->start + dm_target_offset(ti, bi_sector);
278 static void flakey_map_bio(struct dm_target *ti, struct bio *bio)
280 struct flakey_c *fc = ti->private;
285 flakey_map_sector(ti, bio->bi_iter.bi_sector);
321 static int flakey_map(struct dm_target *ti, struct bio *bio)
323 struct flakey_c *fc = ti->private;
380 flakey_map_bio(ti, bio);
385 static int flakey_end_io(struct dm_target *ti, struct bio *bio,
388 struct flakey_c *fc = ti->private;
416 static void flakey_status(struct dm_target *ti, status_type_t type,
420 struct flakey_c *fc = ti->private;
452 static int flakey_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
454 struct flakey_c *fc = ti->private;
462 ti->len != i_size_read((*bdev)->bd_inode) >> SECTOR_SHIFT)
468 static int flakey_report_zones(struct dm_target *ti,
471 struct flakey_c *fc = ti->private;
472 sector_t sector = flakey_map_sector(ti, args->next_sector);
480 static int flakey_iterate_devices(struct dm_target *ti, iterate_devices_callout_fn fn, void *data)
482 struct flakey_c *fc = ti->private;
484 return fn(ti, fc->dev, fc->start, ti->len, data);