[PATCH 6/6] raid0->raid10 takeover- allocate memory for added disks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allocate memory necessary to add new dummy disks
in process_update.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@xxxxxxxxx>
---
 super-intel.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 63bd2d2..a7d7d08 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -6224,6 +6224,24 @@ static void imsm_prepare_update(struct supertype *st,
 	size_t len = 0;
 
 	switch (type) {
+	case update_takeover: {
+		struct imsm_update_takeover *u = (void *)update->buf;
+		if (u->direction == R0_TO_R10) {
+			void **tail = (void**)&update->space_list;
+			void *space;
+			int size = sizeof_imsm_dev(super->devlist->dev, 0) +
+				(TAKEOVER_DISKS * sizeof(__u32));
+			space = malloc(size);
+			if (!space)
+				break;
+			*tail = space;
+			tail = space;
+			*tail = NULL;
+
+			len = disks_to_mpb_size(TAKEOVER_DISKS * 2);
+		}
+		break;
+	}
 	case update_reshape_container_disks: {
 		/* Every raid device in the container is about to
 		 * gain some more devices, and we will enter a

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux