diff options
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index a49e62b8611f..89180fdbd28c 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -920,6 +920,16 @@ struct target_type *dm_table_get_immutable_target_type(struct dm_table *t) return t->immutable_target_type; } +struct dm_target *dm_table_get_immutable_target(struct dm_table *t) +{ + /* Immutable target is implicitly a singleton */ + if (t->num_targets > 1 || + !dm_target_is_immutable(t->targets[0].type)) + return NULL; + + return t->targets; +} + struct dm_target *dm_table_get_wildcard_target(struct dm_table *t) { struct dm_target *uninitialized_var(ti); |