Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next
[pandora-kernel.git] / include / linux / device-mapper.h
index 622678c..98f34b8 100644 (file)
@@ -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,30 @@ 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)
+
+/*
+ * Indicates that a target does not support read-only devices.
+ */
+#define DM_TARGET_ALWAYS_WRITEABLE     0x00000002
+#define dm_target_always_writeable(type) \
+               ((type)->features & DM_TARGET_ALWAYS_WRITEABLE)
+
+/*
+ * Any device that contains a table with an instance of this target may never
+ * have tables containing any different target type.
+ */
+#define DM_TARGET_IMMUTABLE            0x00000004
+#define dm_target_is_immutable(type)   ((type)->features & DM_TARGET_IMMUTABLE)
+
 struct dm_target {
        struct dm_table *table;
        struct target_type *type;