Lines Matching refs:ti
29 static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv) in linear_ctr() argument
37 ti->error = "Invalid argument count"; in linear_ctr()
43 ti->error = "Cannot allocate linear context"; in linear_ctr()
49 ti->error = "Invalid device sector"; in linear_ctr()
54 ret = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &lc->dev); in linear_ctr()
56 ti->error = "Device lookup failed"; in linear_ctr()
60 ti->num_flush_bios = 1; in linear_ctr()
61 ti->num_discard_bios = 1; in linear_ctr()
62 ti->num_secure_erase_bios = 1; in linear_ctr()
63 ti->num_write_zeroes_bios = 1; in linear_ctr()
64 ti->private = lc; in linear_ctr()
72 static void linear_dtr(struct dm_target *ti) in linear_dtr() argument
74 struct linear_c *lc = (struct linear_c *) ti->private; in linear_dtr()
76 dm_put_device(ti, lc->dev); in linear_dtr()
80 static sector_t linear_map_sector(struct dm_target *ti, sector_t bi_sector) in linear_map_sector() argument
82 struct linear_c *lc = ti->private; in linear_map_sector()
84 return lc->start + dm_target_offset(ti, bi_sector); in linear_map_sector()
87 static int linear_map(struct dm_target *ti, struct bio *bio) in linear_map() argument
89 struct linear_c *lc = ti->private; in linear_map()
92 bio->bi_iter.bi_sector = linear_map_sector(ti, bio->bi_iter.bi_sector); in linear_map()
97 static void linear_status(struct dm_target *ti, status_type_t type, in linear_status() argument
100 struct linear_c *lc = (struct linear_c *) ti->private; in linear_status()
113 DMEMIT_TARGET_NAME_VERSION(ti->type); in linear_status()
120 static int linear_prepare_ioctl(struct dm_target *ti, struct block_device **bdev) in linear_prepare_ioctl() argument
122 struct linear_c *lc = (struct linear_c *) ti->private; in linear_prepare_ioctl()
130 if (lc->start || ti->len != bdev_nr_sectors(dev->bdev)) in linear_prepare_ioctl()
136 static int linear_report_zones(struct dm_target *ti, in linear_report_zones() argument
139 struct linear_c *lc = ti->private; in linear_report_zones()
142 linear_map_sector(ti, args->next_sector), in linear_report_zones()
149 static int linear_iterate_devices(struct dm_target *ti, in linear_iterate_devices() argument
152 struct linear_c *lc = ti->private; in linear_iterate_devices()
154 return fn(ti, lc->dev, lc->start, ti->len, data); in linear_iterate_devices()
158 static struct dax_device *linear_dax_pgoff(struct dm_target *ti, pgoff_t *pgoff) in linear_dax_pgoff() argument
160 struct linear_c *lc = ti->private; in linear_dax_pgoff()
161 sector_t sector = linear_map_sector(ti, *pgoff << PAGE_SECTORS_SHIFT); in linear_dax_pgoff()
167 static long linear_dax_direct_access(struct dm_target *ti, pgoff_t pgoff, in linear_dax_direct_access() argument
171 struct dax_device *dax_dev = linear_dax_pgoff(ti, &pgoff); in linear_dax_direct_access()
176 static int linear_dax_zero_page_range(struct dm_target *ti, pgoff_t pgoff, in linear_dax_zero_page_range() argument
179 struct dax_device *dax_dev = linear_dax_pgoff(ti, &pgoff); in linear_dax_zero_page_range()
184 static size_t linear_dax_recovery_write(struct dm_target *ti, pgoff_t pgoff, in linear_dax_recovery_write() argument
187 struct dax_device *dax_dev = linear_dax_pgoff(ti, &pgoff); in linear_dax_recovery_write()