[PATCH 5/5] imsm: add new chunk size to metadata update

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

 



Put information about new chunk size change in to migration metadata
update allowing simultaneous level change and re-striping.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@xxxxxxxxx>
---
 super-intel.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index d4a45d7..e3f3f19 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -354,6 +354,7 @@ struct imsm_update_reshape_migration {
 	int subdev;
 	int new_level;
 	int new_layout;
+	int new_chunksize;
 
 	int new_disks[1]; /* new_raid_disks - old_raid_disks makedev number */
 };
@@ -6156,6 +6157,12 @@ static int apply_reshape_migration_update(struct imsm_update_reshape_migration *
 			id->dev = new_dev;
 			tofree = (void **)dev;
 
+			/* update chunk size
+			 */
+			if (u->new_chunksize > 0)
+				map->blocks_per_strip =
+					__cpu_to_le16(u->new_chunksize * 2);
+
 			/* add disk
 			 */
 			if ((u->new_level != 5) ||
@@ -7367,14 +7374,25 @@ static int imsm_create_metadata_update_for_migration(
 	u->new_layout = geo->layout;
 	u->new_raid_disks = u->old_raid_disks = geo->raid_disks;
 	u->new_disks[0] = -1;
+	u->new_chunksize = -1;
 
 	dev = get_imsm_dev(super, u->subdev);
 	if (dev) {
 		struct imsm_map *map;
 
 		map = get_imsm_map(dev, 0);
-		if (map)
+		if (map) {
+			int current_chunk_size =
+				__le16_to_cpu(map->blocks_per_strip) / 2;
+
+			if (geo->chunksize != current_chunk_size) {
+				u->new_chunksize = geo->chunksize / 1024;
+				dprintf("imsm: "
+					"chunk size change from %i to %i\n",
+					current_chunk_size, u->new_chunksize);
+			}
 			previous_level = map->raid_level;
+		}
 	}
 	if ((geo->level == 5) && (previous_level == 0)) {
 		struct mdinfo *spares = NULL;

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