summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2010-04-16 13:27:59 -0400
committerDoug Ledford <dledford@redhat.com>2010-04-16 13:27:59 -0400
commit61923125d52d26398c38c8465a898913e3b7171a (patch)
tree7d915231466d13dca72b2ed438658cd32a50f045
parentc7e7c90ce625db7d937dbfa87a10003514a7ebfd (diff)
downloadmdadm-61923125d52d26398c38c8465a898913e3b7171a.tar.gz
mdadm-61923125d52d26398c38c8465a898913e3b7171a.tar.xz
mdadm-61923125d52d26398c38c8465a898913e3b7171a.zip
Stub entries for making partition handling be done via an indirection
layer so we can easily support different partitioning methods required for different platforms Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--mdadm.h10
-rw-r--r--util.c24
2 files changed, 34 insertions, 0 deletions
diff --git a/mdadm.h b/mdadm.h
index a020ad9..beadaf9 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -295,6 +295,16 @@ enum domain_actions {
#define action(domain) ((domain)->action & action_mask)
#define force(domain) ((domain)->action & force)
+struct domain_ent;
+
+extern struct partition_handler {
+ char *match; /* string we match in mdadm.conf */
+ int (*check_partition)(int dfd, int verbose, int export,
+ struct domain_ent *domain);
+ int (*write_partition)(int dfd, int verbose, int export,
+ struct domain_ent *domain);
+} *partition_list[];
+
struct domain_ent {
char *spare_group; /* only set this in monitor mode
when we know what arrays we
diff --git a/util.c b/util.c
index cd17d93..5ae208c 100644
--- a/util.c
+++ b/util.c
@@ -1691,3 +1691,27 @@ char *get_devpath_from_devname(char *devname)
closedir(by_path);
return NULL;
}
+
+static int sfdisk_check_partition(int dfd, int verbose, int export,
+ struct domain_ent *domain)
+{
+ return 0;
+}
+
+static int sfdisk_write_partition(int dfd, int verbose, int export,
+ struct domain_ent *domain)
+{
+ return 0;
+}
+
+static struct partition_handler sfdisk_handler = {
+ .match = "sfdisk",
+ .check_partition = sfdisk_check_partition,
+ .write_partition = sfdisk_write_partition,
+};
+
+struct partition_handler *partition_list[] = {
+ &sfdisk_handler,
+ NULL
+};
+