From 61923125d52d26398c38c8465a898913e3b7171a Mon Sep 17 00:00:00 2001 From: Doug Ledford Date: Fri, 16 Apr 2010 13:27:59 -0400 Subject: 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 --- mdadm.h | 10 ++++++++++ util.c | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+) 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 +}; + -- cgit