summaryrefslogtreecommitdiff
path: root/maps.c
diff options
context:
space:
mode:
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>2017-03-29 11:54:15 +0200
committerJes Sorensen <Jes.Sorensen@gmail.com>2017-03-29 11:32:15 -0400
commit5308f11727b889965efe5ac0e854d197c2b51f6d (patch)
tree9b35204d86ddc3bf3275c123b4a420dda57c02a8 /maps.c
parentb4decd517d90098bc2d17d3eddfe858d8b903920 (diff)
downloadmdadm-5308f11727b889965efe5ac0e854d197c2b51f6d.tar.gz
Generic support for --consistency-policy and PPL
Add a new parameter to mdadm: --consistency-policy=. It determines how the array maintains consistency in case of unexpected shutdown. This maps to the md sysfs attribute 'consistency_policy'. It can be used to create a raid5 array using PPL. Add the necessary plumbing to pass this option to metadata handlers. The write journal and bitmap functionalities are treated as different policies, which are implicitly selected when using --write-journal or --bitmap options. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Diffstat (limited to 'maps.c')
-rw-r--r--maps.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/maps.c b/maps.c
index 64f1df2..d9ee7de 100644
--- a/maps.c
+++ b/maps.c
@@ -129,6 +129,16 @@ mapping_t faultylayout[] = {
{ NULL, 0}
};
+mapping_t consistency_policies[] = {
+ { "unknown", CONSISTENCY_POLICY_UNKNOWN},
+ { "none", CONSISTENCY_POLICY_NONE},
+ { "resync", CONSISTENCY_POLICY_RESYNC},
+ { "bitmap", CONSISTENCY_POLICY_BITMAP},
+ { "journal", CONSISTENCY_POLICY_JOURNAL},
+ { "ppl", CONSISTENCY_POLICY_PPL},
+ { NULL, 0}
+};
+
char *map_num(mapping_t *map, int num)
{
while (map->name) {