diff options
| author | Alasdair G Kergon <agk@redhat.com> | 2011-10-31 16:19:00 -0400 |
|---|---|---|
| committer | Alasdair G Kergon <agk@redhat.com> | 2011-10-31 16:19:00 -0400 |
| commit | 3791e2fc0e4b40d4188e79b0a99bfa6bce714a10 (patch) | |
| tree | 2dc67f0593e1cb1f3dc07ff9883a03fe9edb4b2a /include/linux | |
| parent | 7f06965390e4a10fb6906c886324bfd0a96961be (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')
| -rw-r--r-- | include/linux/device-mapper.h | 14 |
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); | |||
| 128 | * Information about a target type | 128 | * Information about a target type |
| 129 | */ | 129 | */ |
| 130 | 130 | ||
| 131 | /* | ||
| 132 | * Target features | ||
| 133 | */ | ||
| 134 | |||
| 135 | struct target_type { | 131 | struct target_type { |
| 136 | uint64_t features; | 132 | uint64_t features; |
| 137 | const char *name; | 133 | const char *name; |
| @@ -160,6 +156,16 @@ struct target_type { | |||
| 160 | struct list_head list; | 156 | struct list_head list; |
| 161 | }; | 157 | }; |
| 162 | 158 | ||
| 159 | /* | ||
| 160 | * Target features | ||
| 161 | */ | ||
| 162 | |||
| 163 | /* | ||
| 164 | * Any table that contains an instance of this target must have only one. | ||
| 165 | */ | ||
| 166 | #define DM_TARGET_SINGLETON 0x00000001 | ||
| 167 | #define dm_target_needs_singleton(type) ((type)->features & DM_TARGET_SINGLETON) | ||
| 168 | |||
| 163 | struct dm_target { | 169 | struct dm_target { |
| 164 | struct dm_table *table; | 170 | struct dm_table *table; |
| 165 | struct target_type *type; | 171 | struct target_type *type; |
