动态磁盘结构
动态磁盘的结构相对普通分区表会有些复杂,这里贴出LDM的结构代码,仅供编程爱好者参考。网址:http://www.datarelab.com
struct privhead { /* Offsets and sizes are in sectors. */
u16 ver_major;
u16 ver_minor;
u64 logical_disk_start;
u64 logical_disk_size;
u64 config_start;
u64 config_size;
u8 disk_id;
};
struct tocblock { /* We have exactly two bitmaps. */
u8 bitmap1_name;
u64 bitmap1_start;
u64 bitmap1_size;
u8 bitmap2_name;
u64 bitmap2_start;
u64 bitmap2_size;
};
struct vmdb { /* VMDB: The database header */
u16 ver_major;
u16 ver_minor;
u32 vblk_size;
u32 vblk_offset;
u32 last_vblk_seq;
};
struct vblk_comp { /* VBLK Component */
u8 state;
u64 parent_id;
u8 type;
u8 children;
u16 chunksize;
};
struct vblk_dgrp { /* VBLK Disk Group */
u8 disk_id;
};
struct vblk_disk { /* VBLK Disk */
u8 disk_id;
u8 alt_name;
};
struct vblk_part { /* VBLK Partition */
u64 start;
u64 size; /* start, size and vol_off in sectors */
u64 volume_offset;
u64 parent_id;
u64 disk_id;
u8 partnum;
};
struct vblk_volu { /* VBLK Volume */
u8 volume_type;
u8 volume_state;
u8 guid;
u8 drive_hint;
u64 size;
u8 partition_type;
};
struct vblk_head { /* VBLK standard header */
u32 group;
u16 rec;
u16 nrec;
};
struct vblk { /* Generalised VBLK */
u8 name;
u64 obj_id;
u32 sequence;
u8 flags;
u8 type;
union {
struct vblk_comp comp;
struct vblk_dgrp dgrp;
struct vblk_disk disk;
struct vblk_part part;
struct vblk_volu volu;
} vblk;
struct list_head list;
};
struct ldmdb { /* Cache of the database */
struct privhead ph;
struct tocblock toc;
struct vmdb vm;
struct list_head v_dgrp;
struct list_head v_disk;
struct list_head v_volu;
struct list_head v_comp;
struct list_head v_part;
}; 郝歌,支持你 支持 --------------------- 学习学习。。。。。。。。。。。。。。 学习学习, 详细就是看不懂 ~~
页:
[1]