Lines Matching refs:ti

43 			  struct dm_target *ti)
60 r = dm_read_arg_group(_args, as, &argc, &ti->error);
73 ti->error = "Feature drop_writes duplicated";
85 ti->error = "Feature corrupt_bio_byte requires parameters";
89 r = dm_read_arg(_args + 1, as, &fc->corrupt_bio_byte, &ti->error);
103 ti->error = "Invalid corrupt bio direction (r or w)";
111 r = dm_read_arg(_args + 2, as, &fc->corrupt_bio_value, &ti->error);
119 r = dm_read_arg(_args + 3, as, &fc->corrupt_bio_flags, &ti->error);
127 ti->error = "Unrecognised flakey feature requested";
132 ti->error = "drop_writes is incompatible with corrupt_bio_byte with the WRITE flag set";
151 static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
168 ti->error = "Invalid argument count";
174 ti->error = "Cannot allocate linear context";
182 ti->error = "Invalid device sector";
187 r = dm_read_arg(_args, &as, &fc->up_interval, &ti->error);
191 r = dm_read_arg(_args, &as, &fc->down_interval, &ti->error);
196 ti->error = "Total (up + down) interval is zero";
201 ti->error = "Interval overflow";
205 r = parse_features(&as, fc, ti);
209 if (dm_get_device(ti, devname, dm_table_get_mode(ti->table), &fc->dev)) {
210 ti->error = "Device lookup failed";
214 ti->num_flush_requests = 1;
215 ti->num_discard_requests = 1;
216 ti->private = fc;
224 static void flakey_dtr(struct dm_target *ti)
226 struct flakey_c *fc = ti->private;
228 dm_put_device(ti, fc->dev);
232 static sector_t flakey_map_sector(struct dm_target *ti, sector_t bi_sector)
234 struct flakey_c *fc = ti->private;
236 return fc->start + dm_target_offset(ti, bi_sector);
239 static void flakey_map_bio(struct dm_target *ti, struct bio *bio)
241 struct flakey_c *fc = ti->private;
245 bio->bi_sector = flakey_map_sector(ti, bio->bi_sector);
267 static int flakey_map(struct dm_target *ti, struct bio *bio,
270 struct flakey_c *fc = ti->private;
311 flakey_map_bio(ti, bio);
316 static int flakey_end_io(struct dm_target *ti, struct bio *bio,
319 struct flakey_c *fc = ti->private;
334 static int flakey_status(struct dm_target *ti, status_type_t type,
338 struct flakey_c *fc = ti->private;
368 static int flakey_ioctl(struct dm_target *ti, unsigned int cmd, unsigned long arg)
370 struct flakey_c *fc = ti->private;
378 ti->len != i_size_read(dev->bdev->bd_inode) >> SECTOR_SHIFT)
384 static int flakey_merge(struct dm_target *ti, struct bvec_merge_data *bvm,
387 struct flakey_c *fc = ti->private;
394 bvm->bi_sector = flakey_map_sector(ti, bvm->bi_sector);
399 static int flakey_iterate_devices(struct dm_target *ti, iterate_devices_callout_fn fn, void *data)
401 struct flakey_c *fc = ti->private;
403 return fn(ti, fc->dev, fc->start, ti->len, data);