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