if (!(param->flags & DM_QUERY_INACTIVE_TABLE_FLAG)) {
if (get_disk_ro(disk))
param->flags |= DM_READONLY_FLAG;
- param->target_count = dm_table_get_num_targets(table);
+ param->target_count = table->num_targets;
}
param->flags |= DM_ACTIVE_PRESENT_FLAG;
if (table) {
if (!(dm_table_get_mode(table) & FMODE_WRITE))
param->flags |= DM_READONLY_FLAG;
- param->target_count = dm_table_get_num_targets(table);
+ param->target_count = table->num_targets;
}
dm_put_live_table(md, srcu_idx);
}
type = STATUSTYPE_INFO;
/* Get all the target info */
- num_targets = dm_table_get_num_targets(table);
+ num_targets = table->num_targets;
for (i = 0; i < num_targets; i++) {
struct dm_target *ti = dm_table_get_target(table, i);
size_t l;
/*
* Check each entry in the table in turn.
*/
- for (i = 0; i < dm_table_get_num_targets(table); i++) {
+ for (i = 0; i < table->num_targets; i++) {
ti = dm_table_get_target(table, i);
blk_set_stacking_limits(&ti_limits);
unsigned i;
/* Ensure that all targets support DAX. */
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!ti->type->direct_access)
struct dm_target *ti;
unsigned i;
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (dm_target_is_wildcard(ti->type))
return ti;
struct gendisk *prev_disk = NULL, *template_disk = NULL;
unsigned i;
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
struct dm_target *ti = dm_table_get_target(t, i);
if (!dm_target_passes_integrity(ti->type))
goto no_integrity;
t = dm_get_live_table(md, &srcu_idx);
if (!t)
return 0;
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!ti->type->iterate_devices)
continue;
memset(profile->modes_supported, 0xFF,
sizeof(profile->modes_supported));
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!dm_target_passes_crypto(ti->type)) {
struct dm_target *ti;
unsigned int i;
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (ti->type->iterate_devices &&
struct dm_target *ti;
unsigned i = 0;
- while (i < dm_table_get_num_targets(t)) {
+ while (i < t->num_targets) {
ti = dm_table_get_target(t, i++);
if (!ti->type->iterate_devices ||
struct dm_target *ti;
unsigned i, num_devices;
- for (i = 0; i < dm_table_get_num_targets(table); i++) {
+ for (i = 0; i < table->num_targets; i++) {
ti = dm_table_get_target(table, i);
if (!ti->type->iterate_devices)
struct dm_target *ti;
unsigned i;
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (dm_target_supports_zoned_hm(ti->type)) {
blk_set_stacking_limits(limits);
- for (i = 0; i < dm_table_get_num_targets(table); i++) {
+ for (i = 0; i < table->num_targets; i++) {
blk_set_stacking_limits(&ti_limits);
ti = dm_table_get_target(table, i);
* so we need to use iterate_devices here, which targets
* supporting flushes must provide.
*/
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!ti->num_flush_bios)
struct dm_target *ti;
unsigned i = 0;
- while (i < dm_table_get_num_targets(t)) {
+ while (i < t->num_targets) {
ti = dm_table_get_target(t, i++);
if (!ti->num_write_zeroes_bios)
struct dm_target *ti;
unsigned i = 0;
- while (i < dm_table_get_num_targets(t)) {
+ while (i < t->num_targets) {
ti = dm_table_get_target(t, i++);
if (!dm_target_supports_nowait(ti->type))
struct dm_target *ti;
unsigned i;
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!ti->num_discard_bios)
struct dm_target *ti;
unsigned int i;
- for (i = 0; i < dm_table_get_num_targets(t); i++) {
+ for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!ti->num_secure_erase_bios)
return 0;
}
-unsigned int dm_table_get_num_targets(struct dm_table *t)
-{
- return t->num_targets;
-}
-
struct list_head *dm_table_get_devices(struct dm_table *t)
{
return &t->devices;