summaryrefslogtreecommitdiff
path: root/super-ddf.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-11-18 10:22:33 +0100
committerNeilBrown <neilb@suse.de>2010-11-23 15:20:50 +1100
commit30f58b2208778245963ee5562f4b2efbde3188cf (patch)
tree900b35637f71a9daff7be00c4d40eef014110357 /super-ddf.c
parent3e82d76d2e53237010bf9d36abc7b68fa85b697d (diff)
Create: cleanup/unify default geometry handling
Support metadata specific level, layout and chunksize defaults. Kill an uneeded superswitch methods ahead of adding more for the reshape case. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/super-ddf.c b/super-ddf.c
index 98c9d58b..8ef766b7 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -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,