summaryrefslogtreecommitdiff
path: root/include/linux/device-mapper.h
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2011-10-31 20:19:00 +0000
committerAlasdair G Kergon <agk@redhat.com>2011-10-31 20:19:00 +0000
commit3791e2fc0e4b40d4188e79b0a99bfa6bce714a10 (patch)
tree2dc67f0593e1cb1f3dc07ff9883a03fe9edb4b2a /include/linux/device-mapper.h
parent7f06965390e4a10fb6906c886324bfd0a96961be (diff)
dm table: add singleton feature
Introduce the concept of a singleton table which contains exactly one target. If a target type sets the DM_TARGET_SINGLETON feature bit device-mapper will ensure that any table that includes that target contains no others. The thin provisioning pool target uses this. Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r--include/linux/device-mapper.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 622678ccb5e0..294e78a7fccd 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -128,10 +128,6 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d);
* Information about a target type
*/
-/*
- * Target features
- */
-
struct target_type {
uint64_t features;
const char *name;
@@ -160,6 +156,16 @@ struct target_type {
struct list_head list;
};
+/*
+ * Target features
+ */
+
+/*
+ * Any table that contains an instance of this target must have only one.
+ */
+#define DM_TARGET_SINGLETON 0x00000001
+#define dm_target_needs_singleton(type) ((type)->features & DM_TARGET_SINGLETON)
+
struct dm_target {
struct dm_table *table;
struct target_type *type;