diff options
author | Sami Kerola | 2014-04-25 23:05:33 +0200 |
---|---|---|
committer | Karel Zak | 2014-05-06 10:08:51 +0200 |
commit | 506b4999916dae071a4368f137f807ae4f178a6e (patch) | |
tree | de7b0d89bc4edf3c08435dfe153e1119b1979de3 | |
parent | mkswap, swaplabel: move version number to header (diff) | |
download | kernel-qcow2-util-linux-506b4999916dae071a4368f137f807ae4f178a6e.tar.gz kernel-qcow2-util-linux-506b4999916dae071a4368f137f807ae4f178a6e.tar.xz kernel-qcow2-util-linux-506b4999916dae071a4368f137f807ae4f178a6e.zip |
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: 4c85aa3a4c26f2a2c33bf16960b548d5bbd5b4bf
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | disk-utils/mkswap.c | 3 | ||||
-rw-r--r-- | include/swapheader.h | 12 |
2 files changed, 3 insertions, 12 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index cd96ad575..830b14c06 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 80fa36b88..c986202e3 100644 --- a/include/swapheader.h +++ b/include/swapheader.h @@ -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 */ |