diff options
author | Doug Ledford <dledford@redhat.com> | 2010-04-16 16:05:21 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2010-04-16 16:05:21 -0400 |
commit | eda79540d4fee8b0f2eb872eed9e372091714379 (patch) | |
tree | 0784529287c7fc88ad49fb1346abfb1f11b9a8a8 | |
parent | 1ce29c45d784d808e89f8f9d99918aa5780e9109 (diff) | |
download | mdadm-eda79540d4fee8b0f2eb872eed9e372091714379.tar.gz mdadm-eda79540d4fee8b0f2eb872eed9e372091714379.tar.xz mdadm-eda79540d4fee8b0f2eb872eed9e372091714379.zip |
Rename *_partition to *_table, fill in a little more meat in
IncrementalNewDisk
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | Incremental.c | 9 | ||||
-rw-r--r-- | mdadm.h | 8 | ||||
-rw-r--r-- | util.c | 14 |
3 files changed, 18 insertions, 13 deletions
diff --git a/Incremental.c b/Incremental.c index 7b5970e..8bc455d 100644 --- a/Incremental.c +++ b/Incremental.c @@ -954,15 +954,20 @@ static int IncrementalNewDisk(char *devname, int verbose, int export, close(dfd); return 1; } + if (domain->handler->check_table(dfd, verbose, export, domain) == 0) + return 0; /* * OK, at this point we have a valid block device without a - * superblock. If we aren't in force mode, then don't use the + * superblock, the partition table doesn't match, and we are a + * partition domain. If we aren't in force mode, then don't use the * device unless it's "clean", meaning no filesystems, no lvm, * no anything. The requirement here is that both the first and * last 4k of the device must be one of three patterns: 0x00, 0x5a, * or 0xff. */ - + if (force(domain)) + return domain->handler->write_table(dfd, verbose, export, + domain); return 0; } @@ -299,10 +299,10 @@ 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); + int (*check_table)(int dfd, int verbose, int export, + struct domain_ent *domain); + int (*write_table)(int dfd, int verbose, int export, + struct domain_ent *domain); } *partition_list[]; struct domain_ent { @@ -1716,22 +1716,22 @@ char *get_devpath_from_devname(char *devname) return NULL; } -static int sfdisk_check_partition(int dfd, int verbose, int export, - struct domain_ent *domain) +static int sfdisk_check_table(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) +static int sfdisk_write_table(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, + .match = "sfdisk", + .check_table = sfdisk_check_table, + .write_table = sfdisk_write_table, }; struct partition_handler *partition_list[] = { |