diff options
author | Doug Ledford <dledford@redhat.com> | 2010-04-16 13:27:59 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2010-04-16 13:27:59 -0400 |
commit | 61923125d52d26398c38c8465a898913e3b7171a (patch) | |
tree | 7d915231466d13dca72b2ed438658cd32a50f045 | |
parent | c7e7c90ce625db7d937dbfa87a10003514a7ebfd (diff) | |
download | mdadm-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.h | 10 | ||||
-rw-r--r-- | util.c | 24 |
2 files changed, 34 insertions, 0 deletions
@@ -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 @@ -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 +}; + |