📄 evms_aix.h
字号:
/* * The following structures are nested within the structures used by the * system management routines. These structures and sizes were pulled from the AIX* src tree.*/ #define LVM_MAXLPS 65535 /* max number of logical partitions allowed */#define LVM_NAMESIZ 64 /* maximum size for the logical volume name */#define LVM_NUMCOPIES 3 /* max number of copies allowed of a logical partition */#define LVM_MAXVGS 255#define LVM_MAXPVS 32#define LVM_MAXLVS 256#define AIX_MIN_BLOCK_SIZE 4096#define VGSA_BT_PV 127#define NBPI 32#define TRUE 1#define OFFSET_CONSTANT 144#define SLEEP_TIME 0#define MAXLVS_OFFSET 16#define PHYS_VOL_OFFSET 34#define AIX_PVHPP_LENGTH PHYS_VOL_OFFSET#define MAX_SECTORS_NAMELIST 32#define AIX_DEFAULT_MIRRORING 1#define AIX_FIRST_MIRROR 2#define AIX_MAX_MIRRORS 3 // AIX defines ALL copies as mirrors - 3 mirrors MAX - 1 orig and 2 copies#define PSN_LVM_REC 7#define PSN_VGSA_REC 128#define PSN_NAMELIST_REC 2065#define PSN_VGT_TRAILER 135#define PSN_LVE_REC 1#define PSN_PPH_OFFSET 17#define PSN_PVH_INCREMENT 34#define AIX_SECTOR_SIZE 512#define MAX_PPENT_SECTOR 16#define NAME_LEN 128 /* don't change!!! */#define UUID_LEN 32 /* don't change!!! */#define MAX_SECTORS_LV_ENTRIES 16#define AIX_MIN_MIRROR_POOL 10#define AIX_MIRROR_POOL_CHANGE 10#define LV_SET_ACCESS _IOW ( 0xfe, 0x28, 1)#define LV_SET_ALLOCATION _IOW ( 0xfe, 0x29, 1)#define LV_SET_STATUS _IOW ( 0xfe, 0x2a, 1)#define LV_BMAP _IOWR ( 0xfe, 0x30, 1)#define LV_ACTIVE 0x01 /* lv_status */#define LV_SPINDOWN 0x02 /* " */#define LV_ERROR 0x99 /* " */ #define VG_ACTIVE 0x01 /* vg_status */#define AIX_LV_READ 0x00 /* lv_access */#define AIX_LV_WRITE 0x01 /* " */#define EVMS_LV_NEW 0x10 // volume was created during the current discovery pass#define EVMS_LV_INCOMPLETE 0x20 // volume has an incomplete LE map#define EVMS_LV_INVALID 0x40 // volume has a memory-corruption problem#define EVMS_VG_DIRTY 0x01 // group has had a new PV added during this discovery#define AIX_VG_INCOMPLETE 0x20 // volume group is incomplete #define LOG_PREFIX "--AIXlvm: "// Entries in the list of physical volumes (PV)// in a volume group (VG)typedef struct unique_id_s { uint32_t word1; uint32_t word2; uint32_t word3; uint32_t word4;} unique_id;typedef struct _partition_list_entry { evms_logical_node_t * logical_node; u_int32_t pv_number; u_int32_t block_size; // bytes u_int32_t hard_sect_size; // bytes struct _partition_list_entry * next;} partition_list_entry_t;// Table for mapping logical extents (LE) to physical extents (PE)typedef struct _pe_table_entry { partition_list_entry_t * owning_pv; u_int64_t pe_sector_offset;} pe_table_entry_t;// Logical volumes (LV) in a volume group (VG)typedef struct _aix_logical_volume { u_int32_t lv_number; u_int64_t lv_size; // Sectors u_int32_t lv_access; // Flags: LV_READ, LV_WRITE, LV_SNAPSHOT, LV_SNAPSHOT_ORG, EVMS_QUIESCE u_int32_t lv_status; // Flags: LV_ACTIVE, LV_SPINDOWN u_int32_t lv_minor; // Device minor number u_int32_t mirror_copies; // Do we have mirroring and how many ? u_int32_t mirror_number; // mirror number - which copy is this ? u_int32_t mirror_iterations; // Which mirror should we be writing to ? u_int32_t stripes; u_int32_t stripe_size; // Sectors u_int32_t stripe_size_shift; // Number of bits to shift right instead of dividing by stripe_size u_int32_t pe_size; // Sectors u_int32_t pe_size_shift; // Number of bits to shift right instead of dividing by pe_size u_int32_t num_le; // Number of entries in the le_to_pe_map u_int32_t new_volume; // Flag to indicate if this volume needs to be exported struct _aix_volume_group * group; // Pointer back to parent volume group unsigned char name[EVMS_VOLUME_NAME_SIZE+1]; // Dev-tree volume name (eg: /dev/group0/vol0) pe_table_entry_t * le_to_pe_map; // Mapping of logical to physical extents pe_table_entry_t * le_to_pe_map_mir1; // Mapping of logical to physical extents for mirror 1 pe_table_entry_t * le_to_pe_map_mir2; // Mapping of logical to physical extents for mirror 2 evms_logical_node_t * volume_node; // Pointer to the parent EVMS node representing this volume} aix_logical_volume_t;// Volume groups (VG)typedef struct _aix_volume_group { unique_id vg_id; // volume group number */ u_int32_t numpvs; // Number of PVs found on this VG. u_int32_t numlvs; // Number of LVs found on this VG. u_int32_t hard_sect_size; // The largest hard_sect_size and block_size u_int32_t block_size; // values of all partitions in this group. u_int32_t flags; // u_int32_t lv_max; // maximum logical volumes */ u_int32_t pe_size; // physical extent size in sectors */ partition_list_entry_t * partition_list; // List of partitions/segments/PVs that make up this VG u_int32_t partition_count; struct _aix_logical_volume ** volume_list; // Array of volumes found in this VG. struct _aix_volume_group * next; // Pointer to the next VG u_int32_t CleanVGInfo; // Do we have a clean VG Info to work with ? daddr_t vgda_psn; // Which VGDA we should use long vgda_len; // length of the volume group descriptor area */ struct _vg_header * AIXvgh; // Pointer to valid data area on disk for the VG} aix_volume_group_t;typedef struct _aix_mirror_bh { atomic_t remaining; int iteration; // 'have we finished' count, used from IRQ handlers int cmd; u_int64_t mir_sector1; u_int64_t mir_sector2; struct buffer_head *master_bh; struct buffer_head bh_req; struct _aix_mirror_bh *mirror_bh_list; evms_logical_node_t *node; // map to evms node (READ only) evms_logical_node_t *mir_node1; // evms_logical_node_t *mir_node2; // eio_t eio; struct _aix_mirror_bh *next_r1; // next for retry or in free list } aix_mirror_bh_t;typedef struct _timestruc_t { int tv_sec; int tv_nsec;} timestruc_t;typedef struct ipl_rec_area{ unsigned int IPL_record_id; /* This physical volume contains a */ /* valid IPL record if and only if */ /* this field contains IPLRECID */#define IPLRECID 0xc9c2d4c1 /* Value is EBCIDIC 'IBMA' */ char reserved1[20]; unsigned int formatted_cap; /* Formatted capacity. The number of */ /* sectors available after formatting*/ /* The presence or absence of bad */ /* blocks does not alter this value. */ char last_head; /* THIS IS DISKETTE INFORMATION */ /* The number of heads minus 1. Heads*/ /* are number from 0 to last_head. */ char last_sector; /* THIS IS DISKETTE INFORMATION */ /* The number of sectors per track. */ /* Sectors are numbered from 1 to */ /* last_sector. */ char reserved2[6]; unsigned int boot_code_length; /* Boot code length in sectors. A 0 */ /* value implies no boot code present*/ unsigned int boot_code_offset; /* Boot code offset. Must be 0 if no */ /* boot code present, else contains */ /* byte offset from start of boot */ /* code to first instruction. */ unsigned int boot_lv_start; /* Contains the PSN of the start of */ /* the BLV. */ unsigned int boot_prg_start; /* Boot code start. Must be 0 if no */ /* boot code present, else contains */ /* the PSN of the start of boot code.*/ unsigned int boot_lv_length; /* BLV length in sectors. */ unsigned int boot_load_add; /* 512 byte boundary load address for*/ /* boot code. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -