From 7801ac209240ca5d5159d2ab990dd8d5573e2195 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 18 Sep 2008 15:13:32 +1000 Subject: Factor out add-disk code The variety of approaches to 'add_disk' are factored out into a separate function, and Incremental mode benefits by being closer to supporting the assembly of containers. Also remove the adding-to-array-data-structure out of sysfs_add_disk and into add_disk. And add some tests for --incremental mode to make sure we don't break it. Signed-off-by: NeilBrown --- Create.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Create.c') diff --git a/Create.c b/Create.c index 48d811f..20886d1 100644 --- a/Create.c +++ b/Create.c @@ -714,11 +714,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, inf->errors = 0; rv = 0; - if (st->ss->external) - rv = sysfs_add_disk(sra, inf); - else - rv = ioctl(mdfd, ADD_NEW_DISK, - &inf->disk); + rv = add_disk(mdfd, st, sra, inf); if (rv) { fprintf(stderr, -- cgit v1.2.1