Lines Matching refs:uc

27 static void cleanup_unstripe(struct unstripe_c *uc, struct dm_target *ti)  in cleanup_unstripe()  argument
29 if (uc->dev) in cleanup_unstripe()
30 dm_put_device(ti, uc->dev); in cleanup_unstripe()
31 kfree(uc); in cleanup_unstripe()
40 struct unstripe_c *uc; in unstripe_ctr() local
50 uc = kzalloc(sizeof(*uc), GFP_KERNEL); in unstripe_ctr()
51 if (!uc) { in unstripe_ctr()
56 if (kstrtouint(argv[0], 10, &uc->stripes) || !uc->stripes) { in unstripe_ctr()
61 if (kstrtouint(argv[1], 10, &uc->chunk_size) || !uc->chunk_size) { in unstripe_ctr()
66 if (kstrtouint(argv[2], 10, &uc->unstripe)) { in unstripe_ctr()
71 if (uc->unstripe > uc->stripes && uc->stripes > 1) { in unstripe_ctr()
76 if (dm_get_device(ti, argv[3], dm_table_get_mode(ti->table), &uc->dev)) { in unstripe_ctr()
85 uc->physical_start = start; in unstripe_ctr()
87 uc->unstripe_offset = uc->unstripe * uc->chunk_size; in unstripe_ctr()
88 uc->unstripe_width = (uc->stripes - 1) * uc->chunk_size; in unstripe_ctr()
89 uc->chunk_shift = is_power_of_2(uc->chunk_size) ? fls(uc->chunk_size) - 1 : 0; in unstripe_ctr()
92 if (sector_div(tmp_len, uc->chunk_size)) { in unstripe_ctr()
97 if (dm_set_target_max_io_len(ti, uc->chunk_size)) { in unstripe_ctr()
102 ti->private = uc; in unstripe_ctr()
105 cleanup_unstripe(uc, ti); in unstripe_ctr()
111 struct unstripe_c *uc = ti->private; in unstripe_dtr() local
113 cleanup_unstripe(uc, ti); in unstripe_dtr()
118 struct unstripe_c *uc = ti->private; in map_to_core() local
123 if (uc->chunk_shift) in map_to_core()
124 tmp_sector >>= uc->chunk_shift; in map_to_core()
126 sector_div(tmp_sector, uc->chunk_size); in map_to_core()
128 sector += uc->unstripe_width * tmp_sector; in map_to_core()
131 return sector + uc->unstripe_offset; in map_to_core()
136 struct unstripe_c *uc = ti->private; in unstripe_map() local
138 bio_set_dev(bio, uc->dev->bdev); in unstripe_map()
139 bio->bi_iter.bi_sector = map_to_core(ti, bio) + uc->physical_start; in unstripe_map()
147 struct unstripe_c *uc = ti->private; in unstripe_status() local
156 uc->stripes, (unsigned long long)uc->chunk_size, uc->unstripe, in unstripe_status()
157 uc->dev->name, (unsigned long long)uc->physical_start); in unstripe_status()
169 struct unstripe_c *uc = ti->private; in unstripe_iterate_devices() local
171 return fn(ti, uc->dev, uc->physical_start, ti->len, data); in unstripe_iterate_devices()
177 struct unstripe_c *uc = ti->private; in unstripe_io_hints() local
179 limits->chunk_sectors = uc->chunk_size; in unstripe_io_hints()