Lines Matching refs:desc
40 VHDXLogDescriptor desc[]; member
275 static bool vhdx_log_desc_is_valid(VHDXLogDescriptor *desc, in vhdx_log_desc_is_valid() argument
280 if (desc->sequence_number != hdr->sequence_number) { in vhdx_log_desc_is_valid()
283 if (desc->file_offset % VHDX_LOG_SECTOR_SIZE) { in vhdx_log_desc_is_valid()
287 if (desc->signature == VHDX_LOG_ZERO_SIGNATURE) { in vhdx_log_desc_is_valid()
288 if (desc->zero_length % VHDX_LOG_SECTOR_SIZE == 0) { in vhdx_log_desc_is_valid()
292 } else if (desc->signature == VHDX_LOG_DESC_SIGNATURE) { in vhdx_log_desc_is_valid()
347 VHDXLogDescriptor desc; in vhdx_log_read_desc() local
382 desc = desc_entries->desc[i]; in vhdx_log_read_desc()
383 vhdx_log_desc_le_import(&desc); in vhdx_log_read_desc()
385 desc_entries->desc[i] = desc; in vhdx_log_read_desc()
387 if (vhdx_log_desc_is_valid(&desc, &hdr) == false) { in vhdx_log_read_desc()
418 vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc, in vhdx_log_flush_desc() argument
430 if (desc->signature == VHDX_LOG_DESC_SIGNATURE) { in vhdx_log_flush_desc()
443 if (seq != desc->sequence_number) { in vhdx_log_flush_desc()
450 memcpy(buffer, &desc->leading_bytes, 8); in vhdx_log_flush_desc()
456 memcpy(buffer+offset, &desc->trailing_bytes, 4); in vhdx_log_flush_desc()
458 } else if (desc->signature == VHDX_LOG_ZERO_SIGNATURE) { in vhdx_log_flush_desc()
461 count = desc->zero_length / VHDX_LOG_SECTOR_SIZE; in vhdx_log_flush_desc()
464 desc->signature); in vhdx_log_flush_desc()
469 file_offset = desc->file_offset; in vhdx_log_flush_desc()
537 if (desc_entries->desc[i].signature == VHDX_LOG_DESC_SIGNATURE) { in vhdx_log_flush()
551 ret = vhdx_log_flush_desc(bs, &desc_entries->desc[i], data); in vhdx_log_flush()
837 static void vhdx_log_raw_to_le_sector(VHDXLogDescriptor *desc, in vhdx_log_raw_to_le_sector() argument
842 memcpy(&desc->leading_bytes, data, 8); in vhdx_log_raw_to_le_sector()
844 desc->leading_bytes = cpu_to_le64(desc->leading_bytes); in vhdx_log_raw_to_le_sector()
847 memcpy(&desc->trailing_bytes, data, 4); in vhdx_log_raw_to_le_sector()
848 desc->trailing_bytes = cpu_to_le32(desc->trailing_bytes); in vhdx_log_raw_to_le_sector()
855 vhdx_log_desc_le_export(desc); in vhdx_log_raw_to_le_sector()