dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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