22 |
|
|
23 |
struct lvm1_super_block { |
struct lvm1_super_block { |
24 |
uint8_t id[2]; |
uint8_t id[2]; |
25 |
} __attribute__((packed)); |
} PACKED; |
26 |
|
|
27 |
struct lvm2_super_block { |
struct lvm2_super_block { |
28 |
uint8_t id[8]; |
uint8_t id[8]; |
30 |
uint32_t crc_xl; |
uint32_t crc_xl; |
31 |
uint32_t offset_xl; |
uint32_t offset_xl; |
32 |
uint8_t type[8]; |
uint8_t type[8]; |
33 |
} __attribute__((packed)); |
} PACKED; |
34 |
|
|
35 |
#define LVM1_SB_OFF 0x400 |
#define LVM1_SB_OFF 0x400 |
36 |
|
|
37 |
int volume_id_probe_lvm1(struct volume_id *id, uint64_t off) |
int FAST_FUNC volume_id_probe_lvm1(struct volume_id *id, uint64_t off) |
38 |
{ |
{ |
39 |
struct lvm1_super_block *lvm; |
struct lvm1_super_block *lvm; |
40 |
|
|
56 |
#define LVM2_LABEL_ID "LABELONE" |
#define LVM2_LABEL_ID "LABELONE" |
57 |
#define LVM2LABEL_SCAN_SECTORS 4 |
#define LVM2LABEL_SCAN_SECTORS 4 |
58 |
|
|
59 |
int volume_id_probe_lvm2(struct volume_id *id, uint64_t off) |
int FAST_FUNC volume_id_probe_lvm2(struct volume_id *id, uint64_t off) |
60 |
{ |
{ |
61 |
const uint8_t *buf; |
const uint8_t *buf; |
62 |
unsigned soff; |
unsigned soff; |