[PATCH 2/4] imsm: Use single migration type for all migrations

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

 



Use single enum definition/migration type for all migrations.
Using separate definitions causes limitation for number of changes
in metadata implementation during single update for migration/reshape.
Single CH_MIGRATION enum allows for many mtadata parameters change
in single update. It will be possible to change i.e. chunk size together
with raid level. In current implementation 2 metadata updates would be
required for such action, one using CH_CHUNK_MIGR and second using
CH_LEVEL_MIGRATION migration type.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 super-intel.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 2875ade..876cc4c 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -294,8 +294,7 @@ struct extent {
 /* definitions of reshape process types */
 enum imsm_reshape_type {
 	CH_TAKEOVER,
-	CH_CHUNK_MIGR,
-	CH_LEVEL_MIGRATION
+	CH_MIGRATION
 };
 
 /* definition of messages passed to imsm_process_update */
@@ -6919,7 +6918,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
 		switch (info.array.level) {
 		case 0:
 			if (geo->level == 5) {
-				change = CH_LEVEL_MIGRATION;
+				change = CH_MIGRATION;
 				check_devs = 1;
 			}
 			if (geo->level == 10) {
@@ -6935,7 +6934,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
 			break;
 		case 5:
 			if (geo->level == 0)
-				change = CH_LEVEL_MIGRATION;
+				change = CH_MIGRATION;
 			break;
 		case 10:
 			if (geo->level == 0) {
@@ -6956,7 +6955,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
 
 	if ((geo->layout != info.array.layout)
 	    && ((geo->layout != UnSet) && (geo->layout != -1))) {
-		change = CH_LEVEL_MIGRATION;
+		change = CH_MIGRATION;
 		if ((info.array.layout == 0)
 		    && (info.array.level == 5)
 		    && (geo->layout == 5)) {
@@ -6980,7 +6979,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
 
 	if ((geo->chunksize > 0) && (geo->chunksize != UnSet)
 	    && (geo->chunksize != info.array.chunk_size))
-		change = CH_CHUNK_MIGR;
+		change = CH_MIGRATION;
 	else
 		geo->chunksize = info.array.chunk_size;
 
@@ -7128,10 +7127,7 @@ static int imsm_reshape_super(struct supertype *st, long long size, int level,
 		case CH_TAKEOVER:
 			ret_val = imsm_takeover(st, &geo);
 			break;
-		case CH_CHUNK_MIGR:
-			ret_val = 0;
-			break;
-		case CH_LEVEL_MIGRATION:
+		case CH_MIGRATION:
 			ret_val = 0;
 			break;
 		default:

--
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