read-only mode.
The thin provisioning target will use this.
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
t->singleton = 1;
}
+ if (dm_target_always_writeable(tgt->type) && !(t->mode & FMODE_WRITE)) {
+ DMERR("%s: target type %s may not be included in read-only tables",
+ dm_device_name(t->md), type);
+ return -EINVAL;
+ }
+
tgt->table = t;
tgt->begin = start;
tgt->len = len;
#define DM_TARGET_SINGLETON 0x00000001
#define dm_target_needs_singleton(type) ((type)->features & DM_TARGET_SINGLETON)
+#define DM_TARGET_ALWAYS_WRITEABLE 0x00000002
+#define dm_target_always_writeable(type) \
+ ((type)->features & DM_TARGET_ALWAYS_WRITEABLE)
+
struct dm_target {
struct dm_table *table;
struct target_type *type;