Lines Matching refs:ti
27 static void cleanup_unstripe(struct unstripe_c *uc, struct dm_target *ti) in cleanup_unstripe() argument
30 dm_put_device(ti, uc->dev); in cleanup_unstripe()
38 static int unstripe_ctr(struct dm_target *ti, unsigned int argc, char **argv) in unstripe_ctr() argument
46 ti->error = "Invalid number of arguments"; in unstripe_ctr()
52 ti->error = "Memory allocation for unstriped context failed"; in unstripe_ctr()
57 ti->error = "Invalid stripe count"; in unstripe_ctr()
62 ti->error = "Invalid chunk_size"; in unstripe_ctr()
67 ti->error = "Invalid stripe number"; in unstripe_ctr()
72 ti->error = "Please provide stripe between [0, # of stripes]"; in unstripe_ctr()
76 if (dm_get_device(ti, argv[3], dm_table_get_mode(ti->table), &uc->dev)) { in unstripe_ctr()
77 ti->error = "Couldn't get striped device"; in unstripe_ctr()
82 ti->error = "Invalid striped device offset"; in unstripe_ctr()
91 tmp_len = ti->len; in unstripe_ctr()
93 ti->error = "Target length not divisible by chunk size"; in unstripe_ctr()
97 if (dm_set_target_max_io_len(ti, uc->chunk_size)) { in unstripe_ctr()
98 ti->error = "Failed to set max io len"; in unstripe_ctr()
102 ti->private = uc; in unstripe_ctr()
105 cleanup_unstripe(uc, ti); in unstripe_ctr()
109 static void unstripe_dtr(struct dm_target *ti) in unstripe_dtr() argument
111 struct unstripe_c *uc = ti->private; in unstripe_dtr()
113 cleanup_unstripe(uc, ti); in unstripe_dtr()
116 static sector_t map_to_core(struct dm_target *ti, struct bio *bio) in map_to_core() argument
118 struct unstripe_c *uc = ti->private; in map_to_core()
134 static int unstripe_map(struct dm_target *ti, struct bio *bio) in unstripe_map() argument
136 struct unstripe_c *uc = ti->private; in unstripe_map()
139 bio->bi_iter.bi_sector = map_to_core(ti, bio) + uc->physical_start; in unstripe_map()
144 static void unstripe_status(struct dm_target *ti, status_type_t type, in unstripe_status() argument
147 struct unstripe_c *uc = ti->private; in unstripe_status()
166 static int unstripe_iterate_devices(struct dm_target *ti, in unstripe_iterate_devices() argument
169 struct unstripe_c *uc = ti->private; in unstripe_iterate_devices()
171 return fn(ti, uc->dev, uc->physical_start, ti->len, data); in unstripe_iterate_devices()
174 static void unstripe_io_hints(struct dm_target *ti, in unstripe_io_hints() argument
177 struct unstripe_c *uc = ti->private; in unstripe_io_hints()