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

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