]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-ddf.c
Create: cleanup/unify default geometry handling
[thirdparty/mdadm.git] / super-ddf.c
index 98c9d58b4b486c17a1ac15406768357d28c08cba..8ef766b7b0b17079f87735173c95a467007bf3cb 100644 (file)
@@ -3643,6 +3643,15 @@ static int ddf_level_to_layout(int level)
        }
 }
 
+static void default_geometry_ddf(struct supertype *st, int *level, int *layout, int *chunk)
+{
+       if (level && *level == UnSet)
+               *level = LEVEL_CONTAINER;
+
+       if (level && layout && *layout == UnSet)
+               *layout = ddf_level_to_layout(*level);
+}
+
 struct superswitch super_ddf = {
 #ifndef        MDASSEMBLE
        .examine_super  = examine_super_ddf,
@@ -3671,7 +3680,7 @@ struct superswitch super_ddf = {
        .free_super     = free_super_ddf,
        .match_metadata_desc = match_metadata_desc_ddf,
        .container_content = container_content_ddf,
-       .default_layout = ddf_level_to_layout,
+       .default_geometry = default_geometry_ddf,
 
        .external       = 1,