mkswap: remove legacy swap structure

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

[kzak@redhat.com: - use sizeof() for SWAP_HEADER_SIZE]

Reference: 4c85aa3a4c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Sami Kerola 2014-04-25 22:05:33 +01:00 committed by Karel Zak
parent 8a101b1447
commit 506b499991
2 changed files with 3 additions and 12 deletions

View File

@ -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;
}

View File

@ -1,16 +1,6 @@
#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
@ -26,4 +16,6 @@ struct swap_header_v1_2 {
unsigned int badpages[1];
};
#define SWAP_HEADER_SIZE (sizeof(struct swap_header_v1_2))
#endif /* _SWAPHEADER_H */