[PATCH 06/12] mkswap: remove legacy swap structure

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

 



If software archeolgists want to know how the old, and unused, swap
header looked they can dig it from the revision history.

Reference: 4c85aa3a4c26f2a2c33bf16960b548d5bbd5b4bf
Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 disk-utils/mkswap.c  |  3 +--
 include/swapheader.h | 11 +----------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index cd96ad5..830b14c 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -186,8 +186,7 @@ write_uuid_and_label(unsigned char *uuid, char *volume_name)
 	struct swap_header_v1_2 *h;
 
 	/* Sanity check */
-	if (sizeof(struct swap_header_v1) !=
-	    sizeof(struct swap_header_v1_2)) {
+	if (sizeof(struct swap_header_v1_2) != SWAP_HEADER_SIZE) {
 		warnx(_("Bad swap header size, no label written."));
 		return;
 	}
diff --git a/include/swapheader.h b/include/swapheader.h
index 80fa36b..1fdd133 100644
--- a/include/swapheader.h
+++ b/include/swapheader.h
@@ -1,19 +1,10 @@
 #ifndef _SWAPHEADER_H
 #define _SWAPHEADER_H
 
-struct swap_header_v1 {
-        char         bootbits[1024];    /* Space for disklabel etc. */
-	unsigned int version;
-	unsigned int last_page;
-	unsigned int nr_badpages;
-	unsigned int padding[125];
-	unsigned int badpages[1];
-};
-
-
 #define SWAP_VERSION 1
 #define SWAP_UUID_LENGTH 16
 #define SWAP_LABEL_LENGTH 16
+#define SWAP_HEADER_SIZE 1540
 
 struct swap_header_v1_2 {
 	char	      bootbits[1024];    /* Space for disklabel etc. */
-- 
1.9.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux