Lines Matching refs:ti

194 		struct dm_target *ti = dm_table_get_target(t, i);
196 if (ti->type->dtr)
197 ti->type->dtr(ti);
199 dm_put_target_type(ti->type);
231 static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
245 dm_device_name(ti->table->md), bdev,
261 dm_device_name(ti->table->md),
278 dm_device_name(ti->table->md),
290 dm_device_name(ti->table->md),
298 dm_device_name(ti->table->md),
339 int __ref dm_get_device(struct dm_target *ti, const char *path, blk_mode_t mode,
347 struct dm_table *t = ti->table;
405 static int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
414 dm_device_name(ti->table->md), bdev);
423 dm_device_name(ti->table->md), bdev,
434 void dm_put_device(struct dm_target *ti, struct dm_dev *d)
437 struct dm_table *t = ti->table;
468 static int adjoin(struct dm_table *t, struct dm_target *ti)
473 return !ti->begin;
476 return (ti->begin == (prev->begin + prev->len));
603 struct dm_target *ti;
611 ti = dm_table_get_target(t, i);
616 if (ti->type->iterate_devices)
617 ti->type->iterate_devices(ti, dm_set_device_limits,
624 if (remaining < ti->len &&
630 (unsigned short) ((next_target_start + ti->len) &
640 (unsigned long long) ti->begin,
641 (unsigned long long) ti->len,
654 struct dm_target *ti;
664 ti = t->targets + t->num_targets;
665 memset(ti, 0, sizeof(*ti));
672 ti->type = dm_get_target_type(type);
673 if (!ti->type) {
678 if (dm_target_needs_singleton(ti->type)) {
680 ti->error = "singleton target type must appear alone in table";
686 if (dm_target_always_writeable(ti->type) &&
688 ti->error = "target type may not be included in a read-only table";
693 if (t->immutable_target_type != ti->type) {
694 ti->error = "immutable target type cannot be mixed with other target types";
697 } else if (dm_target_is_immutable(ti->type)) {
699 ti->error = "immutable target type cannot be mixed with other target types";
702 t->immutable_target_type = ti->type;
705 if (dm_target_has_integrity(ti->type))
708 ti->table = t;
709 ti->begin = start;
710 ti->len = len;
711 ti->error = "Unknown error";
716 if (!adjoin(t, ti)) {
717 ti->error = "Gap in table";
723 ti->error = "couldn't split parameters";
727 r = ti->type->ctr(ti, argc, argv);
732 t->highs[t->num_targets++] = ti->begin + ti->len - 1;
734 if (!ti->num_discard_bios && ti->discards_supported)
738 if (ti->limit_swap_bios && !static_key_enabled(&swap_bios_enabled.key))
744 DMERR("%s: %s: %s (%pe)", dm_device_name(t->md), type, ti->error, ERR_PTR(r));
745 dm_put_target_type(ti->type);
825 static int device_not_dax_capable(struct dm_target *ti, struct dm_dev *dev,
836 static int device_not_dax_synchronous_capable(struct dm_target *ti, struct dm_dev *dev,
847 struct dm_target *ti = dm_table_get_target(t, i);
849 if (!ti->type->direct_access)
852 if (!ti->type->iterate_devices ||
853 ti->type->iterate_devices(ti, iterate_fn, NULL))
860 static int device_is_rq_stackable(struct dm_target *ti, struct dm_dev *dev,
876 struct dm_target *ti;
891 ti = dm_table_get_target(t, i);
892 if (dm_target_hybrid(ti))
894 else if (dm_target_request_based(ti))
955 ti = dm_table_get_immutable_target(t);
956 if (!ti) {
959 } else if (ti->max_io_len) {
965 if (!ti->type->iterate_devices ||
966 !ti->type->iterate_devices(ti, device_is_rq_stackable, NULL)) {
997 struct dm_target *ti = dm_table_get_target(t, i);
999 if (dm_target_is_wildcard(ti->type))
1000 return ti;
1041 struct dm_target *ti = dm_table_get_target(t, i);
1043 per_io_data_size = max(per_io_data_size, ti->per_io_data_size);
1044 min_pool_size = max(min_pool_size, ti->num_flush_bios);
1137 struct dm_target *ti = dm_table_get_target(t, i);
1139 if (!dm_target_passes_integrity(ti->type))
1221 static int dm_keyslot_evict_callback(struct dm_target *ti, struct dm_dev *dev,
1247 struct dm_target *ti = dm_table_get_target(t, i);
1249 if (!ti->type->iterate_devices)
1251 ti->type->iterate_devices(ti, dm_keyslot_evict_callback,
1260 device_intersect_crypto_capabilities(struct dm_target *ti, struct dm_dev *dev,
1319 struct dm_target *ti = dm_table_get_target(t, i);
1321 if (!dm_target_passes_crypto(ti->type)) {
1325 if (!ti->type->iterate_devices)
1327 ti->type->iterate_devices(ti,
1495 static int device_not_poll_capable(struct dm_target *ti, struct dm_dev *dev,
1530 struct dm_target *ti = dm_table_get_target(t, i);
1532 if (ti->type->iterate_devices &&
1533 ti->type->iterate_devices(ti, func, data))
1540 static int count_device(struct dm_target *ti, struct dm_dev *dev,
1553 struct dm_target *ti = dm_table_get_target(t, i);
1555 if (!ti->type->iterate_devices ||
1556 ti->type->iterate_devices(ti, device_not_poll_capable, NULL))
1572 struct dm_target *ti = dm_table_get_target(t, i);
1575 if (!ti->type->iterate_devices)
1578 ti->type->iterate_devices(ti, count_device, &num_devices);
1586 static int device_not_zoned_model(struct dm_target *ti, struct dm_dev *dev,
1606 struct dm_target *ti = dm_table_get_target(t, i);
1608 if (dm_target_supports_zoned_hm(ti->type)) {
1609 if (!ti->type->iterate_devices ||
1610 ti->type->iterate_devices(ti, device_not_zoned_model,
1613 } else if (!dm_target_supports_mixed_zoned_model(ti->type)) {
1622 static int device_not_matches_zone_sectors(struct dm_target *ti, struct dm_dev *dev,
1676 struct dm_target *ti = dm_table_get_target(t, i);
1680 if (!ti->type->iterate_devices) {
1682 if (ti->type->io_hints)
1683 ti->type->io_hints(ti, &ti_limits);
1690 ti->type->iterate_devices(ti, dm_set_device_limits,
1703 if (ti->type->io_hints)
1704 ti->type->io_hints(ti, &ti_limits);
1710 if (ti->type->iterate_devices(ti, device_area_is_invalid,
1723 (unsigned long long) ti->begin,
1724 (unsigned long long) ti->len);
1778 static int device_flush_capable(struct dm_target *ti, struct dm_dev *dev,
1796 struct dm_target *ti = dm_table_get_target(t, i);
1798 if (!ti->num_flush_bios)
1801 if (ti->flush_supported)
1804 if (ti->type->iterate_devices &&
1805 ti->type->iterate_devices(ti, device_flush_capable, (void *) flush))
1812 static int device_dax_write_cache_enabled(struct dm_target *ti,
1826 static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
1832 static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
1840 static int device_not_write_zeroes_capable(struct dm_target *ti, struct dm_dev *dev,
1851 struct dm_target *ti = dm_table_get_target(t, i);
1853 if (!ti->num_write_zeroes_bios)
1856 if (!ti->type->iterate_devices ||
1857 ti->type->iterate_devices(ti, device_not_write_zeroes_capable, NULL))
1864 static int device_not_nowait_capable(struct dm_target *ti, struct dm_dev *dev,
1873 struct dm_target *ti = dm_table_get_target(t, i);
1875 if (!dm_target_supports_nowait(ti->type))
1878 if (!ti->type->iterate_devices ||
1879 ti->type->iterate_devices(ti, device_not_nowait_capable, NULL))
1886 static int device_not_discard_capable(struct dm_target *ti, struct dm_dev *dev,
1895 struct dm_target *ti = dm_table_get_target(t, i);
1897 if (!ti->num_discard_bios)
1905 if (!ti->discards_supported &&
1906 (!ti->type->iterate_devices ||
1907 ti->type->iterate_devices(ti, device_not_discard_capable, NULL)))
1914 static int device_not_secure_erase_capable(struct dm_target *ti,
1924 struct dm_target *ti = dm_table_get_target(t, i);
1926 if (!ti->num_secure_erase_bios)
1929 if (!ti->type->iterate_devices ||
1930 ti->type->iterate_devices(ti, device_not_secure_erase_capable, NULL))
1937 static int device_requires_stable_pages(struct dm_target *ti,
2075 struct dm_target *ti = dm_table_get_target(t, i);
2079 if (ti->type->presuspend)
2080 ti->type->presuspend(ti);
2083 if (ti->type->presuspend_undo)
2084 ti->type->presuspend_undo(ti);
2087 if (ti->type->postsuspend)
2088 ti->type->postsuspend(ti);
2126 struct dm_target *ti = dm_table_get_target(t, i);
2128 if (!ti->type->preresume)
2131 r = ti->type->preresume(ti);
2134 dm_device_name(t->md), ti->type->name, r);
2140 struct dm_target *ti = dm_table_get_target(t, i);
2142 if (ti->type->resume)
2143 ti->type->resume(ti);