-
Notifications
You must be signed in to change notification settings - Fork 0
/
parseMetadata.h
executable file
·61 lines (52 loc) · 1.49 KB
/
parseMetadata.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// Created by Paul on 2/23/2018.
//
#ifndef READLOGICALVOLUME_PARSEMETADATA_H
#define READLOGICALVOLUME_PARSEMETADATA_H
typedef enum
{
childNode = 1,
listNode,
stringNode,
integerNode
} tNodeType;
typedef struct tNode
{
struct tNode * next;
tHash hash;
tStringZ * key;
tNodeType type;
union
{
struct tNode * child;
struct tNode * list;
tStringZ * string;
int64_t integer;
};
} tNode;
/* built from the metadata node tree */
typedef struct tPhysicalVolume {
struct tPhysicalVolume * next;
tDrive * drive;
char * name;
char * id;
char * dev;
size_t extentSize; /* in bytes */
uint64_t devSize;
tExtent peStart; /* start of the region containing extents, in sectors from the beginning of the partition */
long peCount;
} tPhysicalVolume;
typedef struct tStripe {
tStringZ * pvName;
tPhysicalVolume * physicalVolume;
tExtent startExtent;
} tStripe;
typedef struct tLogicalVolumeSegment {
tExtent startExtent;
long extentCount;
long stripeCount;
tStripe * stripes;
} tLogicalVolumeSegment;
tNode * parseMetadata( tTextBlock * metadata );
tMemoryBlock * readLogicalVolume( tDrive * drive, const char * lvName, tNode * root );
#endif //READLOGICALVOLUME_PARSEMETADATA_H