Blame SOURCES/0065-imsm-Remove-dump-restore-implementation.patch

2792dd
From 45c43276d02a32876c7e1f9f0d04580595141b3d Mon Sep 17 00:00:00 2001
2792dd
From: Blazej Kucman <blazej.kucman@intel.com>
2792dd
Date: Wed, 19 Feb 2020 11:13:17 +0100
2792dd
Subject: [RHEL7.9 PATCH 65/77] imsm: Remove --dump/--restore implementation
2792dd
2792dd
Functionalities --dump and --restore are not supported.
2792dd
Remove dead code from imsm.
2792dd
2792dd
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
2792dd
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2792dd
---
2792dd
 super-intel.c | 56 --------------------------------------------------------
2792dd
 1 file changed, 56 deletions(-)
2792dd
2792dd
diff --git a/super-intel.c b/super-intel.c
2792dd
index e4d2122..c9a1af5 100644
2792dd
--- a/super-intel.c
2792dd
+++ b/super-intel.c
2792dd
@@ -2128,61 +2128,6 @@ static void export_examine_super_imsm(struct supertype *st)
2792dd
 	printf("MD_DEVICES=%u\n", mpb->num_disks);
2792dd
 }
2792dd
 
2792dd
-static int copy_metadata_imsm(struct supertype *st, int from, int to)
2792dd
-{
2792dd
-	/* The second last sector of the device contains
2792dd
-	 * the "struct imsm_super" metadata.
2792dd
-	 * This contains mpb_size which is the size in bytes of the
2792dd
-	 * extended metadata.  This is located immediately before
2792dd
-	 * the imsm_super.
2792dd
-	 * We want to read all that, plus the last sector which
2792dd
-	 * may contain a migration record, and write it all
2792dd
-	 * to the target.
2792dd
-	 */
2792dd
-	void *buf;
2792dd
-	unsigned long long dsize, offset;
2792dd
-	int sectors;
2792dd
-	struct imsm_super *sb;
2792dd
-	struct intel_super *super = st->sb;
2792dd
-	unsigned int sector_size = super->sector_size;
2792dd
-	unsigned int written = 0;
2792dd
-
2792dd
-	if (posix_memalign(&buf, MAX_SECTOR_SIZE, MAX_SECTOR_SIZE) != 0)
2792dd
-		return 1;
2792dd
-
2792dd
-	if (!get_dev_size(from, NULL, &dsize))
2792dd
-		goto err;
2792dd
-
2792dd
-	if (lseek64(from, dsize-(2*sector_size), 0) < 0)
2792dd
-		goto err;
2792dd
-	if ((unsigned int)read(from, buf, sector_size) != sector_size)
2792dd
-		goto err;
2792dd
-	sb = buf;
2792dd
-	if (strncmp((char*)sb->sig, MPB_SIGNATURE, MPB_SIG_LEN) != 0)
2792dd
-		goto err;
2792dd
-
2792dd
-	sectors = mpb_sectors(sb, sector_size) + 2;
2792dd
-	offset = dsize - sectors * sector_size;
2792dd
-	if (lseek64(from, offset, 0) < 0 ||
2792dd
-	    lseek64(to, offset, 0) < 0)
2792dd
-		goto err;
2792dd
-	while (written < sectors * sector_size) {
2792dd
-		int n = sectors*sector_size - written;
2792dd
-		if (n > 4096)
2792dd
-			n = 4096;
2792dd
-		if (read(from, buf, n) != n)
2792dd
-			goto err;
2792dd
-		if (write(to, buf, n) != n)
2792dd
-			goto err;
2792dd
-		written += n;
2792dd
-	}
2792dd
-	free(buf);
2792dd
-	return 0;
2792dd
-err:
2792dd
-	free(buf);
2792dd
-	return 1;
2792dd
-}
2792dd
-
2792dd
 static void detail_super_imsm(struct supertype *st, char *homehost,
2792dd
 			      char *subarray)
2792dd
 {
2792dd
@@ -12270,7 +12215,6 @@ struct superswitch super_imsm = {
2792dd
 	.reshape_super  = imsm_reshape_super,
2792dd
 	.manage_reshape = imsm_manage_reshape,
2792dd
 	.recover_backup = recover_backup_imsm,
2792dd
-	.copy_metadata = copy_metadata_imsm,
2792dd
 	.examine_badblocks = examine_badblocks_imsm,
2792dd
 	.match_home	= match_home_imsm,
2792dd
 	.uuid_from_super= uuid_from_super_imsm,
2792dd
-- 
2792dd
2.7.5
2792dd