Lines Matching refs:header
411 orig_entries = vhd->header.max_bat_size; in vhd_clear_bat_entries()
421 vhd->header.max_bat_size = new_entries; in vhd_clear_bat_entries()
422 err = vhd_write_header(vhd, &vhd->header); in vhd_clear_bat_entries()
427 vhd->footer.curr_size = (uint64_t)new_entries * vhd->header.block_size; in vhd_clear_bat_entries()
628 if (in_range(off, vhd->header.table_offset, in vhd_check_for_clobber()
629 vhd_bytes_padded(vhd->header.max_bat_size * in vhd_check_for_clobber()
637 in_range(off, vhd->batmap.header.batmap_offset, in vhd_check_for_clobber()
638 vhd_bytes_padded(vhd->batmap.header.batmap_size))) { in vhd_check_for_clobber()
644 n = sizeof(vhd->header.loc) / sizeof(vhd_parent_locator_t); in vhd_check_for_clobber()
646 loc = vhd->header.loc + i; in vhd_check_for_clobber()
691 n = sizeof(vhd->header.loc) / sizeof(vhd_parent_locator_t); in vhd_shift_metadata()
700 loc = vhd->header.loc + i; in vhd_shift_metadata()
733 loc = vhd->header.loc + i; in vhd_shift_metadata()
758 if (vhd_has_batmap(vhd) && vhd->batmap.header.batmap_offset > eob) { in vhd_shift_metadata()
759 vhd->batmap.header.batmap_offset += bat_needed; in vhd_shift_metadata()
786 new_entries = vhd->header.max_bat_size + entries; in vhd_add_bat_entries()
788 bat_size = vhd_bytes_padded(vhd->header.max_bat_size * in vhd_add_bat_entries()
792 map_size = vhd_bytes_padded((vhd->header.max_bat_size + 7) >> 3); in vhd_add_bat_entries()
795 off = vhd->header.table_offset + new_bat_size; in vhd_add_bat_entries()
799 vhd->file, new_bat_size, vhd->header.table_offset); in vhd_add_bat_entries()
804 off = vhd->batmap.header.batmap_offset + new_map_size; in vhd_add_bat_entries()
808 new_map_size, vhd->batmap.header.batmap_offset); in vhd_add_bat_entries()
814 vhd->header.max_bat_size = new_entries; in vhd_add_bat_entries()
815 err = vhd_write_header(vhd, &vhd->header); in vhd_add_bat_entries()
820 vhd->footer.curr_size = (uint64_t)new_entries * vhd->header.block_size; in vhd_add_bat_entries()
858 new_batmap.header = vhd->batmap.header; in vhd_add_bat_entries()
859 new_batmap.header.batmap_size = secs_round_up_no_zero(new_map_size); in vhd_add_bat_entries()
902 bat_bytes = vhd->header.max_bat_size * sizeof(uint32_t); in vhd_dynamic_grow()
909 map_bytes = (vhd->header.max_bat_size + 7) >> 3; in vhd_dynamic_grow()
910 map_secs = vhd->batmap.header.batmap_size; in vhd_dynamic_grow()
944 eob = vhd->header.table_offset + vhd_sectors_to_bytes(bat_secs); in vhd_dynamic_grow()