summaryrefslogtreecommitdiffstats
path: root/include/swapheader.h
diff options
context:
space:
mode:
authorJason Borden2010-04-02 15:52:45 +0200
committerKarel Zak2010-04-02 16:16:59 +0200
commit4dddc2d4aa37367432f719b7c84cb8084bd7a109 (patch)
treee64068e6bc9fbc3989895193ad80cbc5e81eed13 /include/swapheader.h
parentmkswap: zap bootbits on regular files (diff)
downloadkernel-qcow2-util-linux-4dddc2d4aa37367432f719b7c84cb8084bd7a109.tar.gz
kernel-qcow2-util-linux-4dddc2d4aa37367432f719b7c84cb8084bd7a109.tar.xz
kernel-qcow2-util-linux-4dddc2d4aa37367432f719b7c84cb8084bd7a109.zip
swaplabel: new command
Print or change the label / UUID of a swap area. [kzak@redhat.com: - code refactoring - add long options - clean up Makefile.am] Signed-off-by: Jason Borden <jborden@bluehost.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/swapheader.h')
-rw-r--r--include/swapheader.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/swapheader.h b/include/swapheader.h
index 6ff5390f5..42d521a49 100644
--- a/include/swapheader.h
+++ b/include/swapheader.h
@@ -10,13 +10,17 @@ struct swap_header_v1 {
unsigned int badpages[1];
};
+
+#define SWAP_UUID_LENGTH 16
+#define SWAP_LABEL_LENGTH 16
+
struct swap_header_v1_2 {
char bootbits[1024]; /* Space for disklabel etc. */
unsigned int version;
unsigned int last_page;
unsigned int nr_badpages;
- unsigned char uuid[16];
- char volume_name[16];
+ unsigned char uuid[SWAP_UUID_LENGTH];
+ char volume_name[SWAP_LABEL_LENGTH];
unsigned int padding[117];
unsigned int badpages[1];
};