pub fn new(block_size: u32, partition: &GptEntry) -> MetaDataHeader {
        let index_start = Aligned::get_blocks(
            MetaDataHeader::METADATA_HEADER_SIZE,
            block_size,
        );

        let data_start = index_start
            + Aligned::get_blocks(
                MetaDataHeader::MAX_INDEX_ENTRIES
                    * MetaDataHeader::INDEX_ENTRY_SIZE,
                block_size,
            );

        MetaDataHeader {
            signature: [0x4d, 0x61, 0x79, 0x61, 0x44, 0x61, 0x74, 0x61],
            header_size: MetaDataHeader::METADATA_HEADER_SIZE,
            self_checksum: 0,
            generation: 0,
            self_lba: partition.ent_start + 1, /* skip the first block of the
                                                * partition */
            index_start: index_start as u64,
            used_entries: 0,
            max_entries: MetaDataHeader::MAX_INDEX_ENTRIES,
            entry_size: MetaDataHeader::INDEX_ENTRY_SIZE,
            index_checksum: 0,
            data_start: data_start as u64,
            data_end: partition.ent_end - partition.ent_start - 1,
        }
    }
/// Generate a new MetaDataHeader based on the partition information and the
/// underlying block_size
Generate a new MetaDataHeader based on the partition information and the
underlying block_size
Generate a new MetaDataHeader based on the partition information and the underlying block_size
pub fn new(block_size: u32, partition: &GptEntry) -> MetaDataHeader {
        let index_start = Aligned::get_blocks(
            MetaDataHeader::METADATA_HEADER_SIZE,
            block_size,
        );
        let data_start = index_start
            + Aligned::get_blocks(
                MetaDataHeader::MAX_INDEX_ENTRIES
                    * MetaDataHeader::INDEX_ENTRY_SIZE,
                block_size,
            );
        MetaDataHeader {
            signature: [0x4d, 0x61, 0x79, 0x61, 0x44, 0x61, 0x74, 0x61],
            header_size: MetaDataHeader::METADATA_HEADER_SIZE,
            self_checksum: 0,
            generation: 0,
            self_lba: partition.ent_start + 1, /* skip the first block of the
                                                * partition */
            index_start: index_start as u64,
            used_entries: 0,
            max_entries: MetaDataHeader::MAX_INDEX_ENTRIES,
            entry_size: MetaDataHeader::INDEX_ENTRY_SIZE,
            index_checksum: 0,
            data_start: data_start as u64,
            data_end: partition.ent_end - partition.ent_start - 1,
        }
    }
pub fn new ( block_size : u32 , partition : & GptEntry ) -> MetaDataHeader { let index_start = Aligned :: get_blocks ( MetaDataHeader :: METADATA_HEADER_SIZE , block_size , ) ; let data_start = index_start + Aligned :: get_blocks ( MetaDataHeader :: MAX_INDEX_ENTRIES * MetaDataHeader :: INDEX_ENTRY_SIZE , block_size , ) ; MetaDataHeader { signature : [ 0x4d , 0x61 , 0x79 , 0x61 , 0x44 , 0x61 , 0x74 , 0x61 ] , header_size : MetaDataHeader :: METADATA_HEADER_SIZE , self_checksum : 0 , generation : 0 , self_lba : partition . ent_start + 1 , /* skip the first block of the
                                                * partition */ index_start : index_start as u64 , used_entries : 0 , max_entries : MetaDataHeader :: MAX_INDEX_ENTRIES , entry_size : MetaDataHeader :: INDEX_ENTRY_SIZE , index_checksum : 0 , data_start : data_start as u64 , data_end : partition . ent_end - partition . ent_start - 1 , } }
Generate a new MetaDataHeader based on the partition information and the
underlying block_size
Generate a new MetaDataHeader based on the partition information and the underlying block_size
block_size
u32
partition
&GptEntry