]> git.ipfire.org Git - thirdparty/util-linux.git/blob - include/swapheader.h
swapon, swapheader, mkswap: move swap signature to header
[thirdparty/util-linux.git] / include / swapheader.h
1 #ifndef _SWAPHEADER_H
2 #define _SWAPHEADER_H
3
4 #define SWAP_VERSION 1
5 #define SWAP_UUID_LENGTH 16
6 #define SWAP_LABEL_LENGTH 16
7 #define SWAP_SIGNATURE "SWAPSPACE2"
8 #define SWAP_SIGNATURE_SZ (sizeof(SWAP_SIGNATURE) - 1)
9
10 #include <stdint.h>
11
12 struct swap_header_v1_2 {
13 char bootbits[1024]; /* Space for disklabel etc. */
14 uint32_t version;
15 uint32_t last_page;
16 uint32_t nr_badpages;
17 unsigned char uuid[SWAP_UUID_LENGTH];
18 char volume_name[SWAP_LABEL_LENGTH];
19 uint32_t padding[117];
20 uint32_t badpages[1];
21 };
22
23 #define SWAP_HEADER_SIZE (sizeof(struct swap_header_v1_2))
24
25 #endif /* _SWAPHEADER_H */