Lines Matching refs:bs
59 vhdx_log_peek_hdr(BlockDriverState *bs, VHDXLogEntries *log, in vhdx_log_peek_hdr() argument
89 ret = bdrv_pread(bs->file, offset, sizeof(VHDXLogEntryHeader), hdr, 0); in vhdx_log_peek_hdr()
111 static void GRAPH_RDLOCK vhdx_log_reset(BlockDriverState *bs, BDRVVHDXState *s) in vhdx_log_reset() argument
117 vhdx_update_headers(bs, s, false, &guid); in vhdx_log_reset()
132 vhdx_log_read_sectors(BlockDriverState *bs, VHDXLogEntries *log, in vhdx_log_read_sectors() argument
150 ret = bdrv_pread(bs->file, offset, VHDX_LOG_SECTOR_SIZE, buffer, 0); in vhdx_log_read_sectors()
175 vhdx_log_write_sectors(BlockDriverState *bs, VHDXLogEntries *log, in vhdx_log_write_sectors() argument
183 BDRVVHDXState *s = bs->opaque; in vhdx_log_write_sectors()
185 ret = vhdx_user_visible_write(bs, s); in vhdx_log_write_sectors()
201 ret = bdrv_co_pwrite(bs->file, offset, VHDX_LOG_SECTOR_SIZE, buffer_tmp, 0); in vhdx_log_write_sectors()
339 vhdx_log_read_desc(BlockDriverState *bs, BDRVVHDXState *s, VHDXLogEntries *log, in vhdx_log_read_desc() argument
352 ret = vhdx_log_peek_hdr(bs, log, &hdr); in vhdx_log_read_desc()
363 desc_entries = qemu_try_blockalign(bs->file->bs, in vhdx_log_read_desc()
370 ret = vhdx_log_read_sectors(bs, log, §ors_read, desc_entries, in vhdx_log_read_desc()
418 vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc, in vhdx_log_flush_desc() argument
428 buffer = qemu_blockalign(bs, VHDX_LOG_SECTOR_SIZE); in vhdx_log_flush_desc()
473 ret = bdrv_pwrite_sync(bs->file, file_offset, VHDX_LOG_SECTOR_SIZE, in vhdx_log_flush_desc()
491 vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, VHDXLogSequence *logs) in vhdx_log_flush() argument
504 data = qemu_blockalign(bs, VHDX_LOG_SECTOR_SIZE); in vhdx_log_flush()
506 ret = vhdx_user_visible_write(bs, s); in vhdx_log_flush()
514 ret = vhdx_log_peek_hdr(bs, &logs->log, &hdr_tmp); in vhdx_log_flush()
518 file_length = bdrv_getlength(bs->file->bs); in vhdx_log_flush()
531 ret = vhdx_log_read_desc(bs, s, &logs->log, &desc_entries, true); in vhdx_log_flush()
539 ret = vhdx_log_read_sectors(bs, &logs->log, §ors_read, in vhdx_log_flush()
551 ret = vhdx_log_flush_desc(bs, &desc_entries->desc[i], data); in vhdx_log_flush()
565 ret = bdrv_truncate(bs->file, new_file_size, false, in vhdx_log_flush()
576 ret = bdrv_flush(bs); in vhdx_log_flush()
582 vhdx_log_reset(bs, s); in vhdx_log_flush()
591 vhdx_validate_log_entry(BlockDriverState *bs, BDRVVHDXState *s, in vhdx_validate_log_entry() argument
604 ret = vhdx_log_peek_hdr(bs, log, &hdr); in vhdx_validate_log_entry()
627 ret = vhdx_log_read_desc(bs, s, log, &desc_buffer, false); in vhdx_validate_log_entry()
636 buffer = qemu_blockalign(bs, VHDX_LOG_SECTOR_SIZE); in vhdx_validate_log_entry()
640 ret = vhdx_log_read_sectors(bs, log, §ors_read, buffer, in vhdx_validate_log_entry()
671 vhdx_log_search(BlockDriverState *bs, BDRVVHDXState *s, VHDXLogSequence *logs) in vhdx_log_search() argument
694 ret = vhdx_validate_log_entry(bs, s, &curr_log, curr_seq, in vhdx_log_search()
710 ret = vhdx_validate_log_entry(bs, s, &curr_log, curr_seq, in vhdx_log_search()
754 int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed, in vhdx_parse_log() argument
767 s->log.hdr = qemu_blockalign(bs, sizeof(VHDXLogEntryHeader)); in vhdx_parse_log()
804 ret = vhdx_log_search(bs, s, &logs); in vhdx_parse_log()
810 if (bdrv_is_read_only(bs)) { in vhdx_parse_log()
811 bdrv_refresh_filename(bs); in vhdx_parse_log()
816 bs->filename); in vhdx_parse_log()
819 bs->filename); in vhdx_parse_log()
823 ret = vhdx_log_flush(bs, s, &logs); in vhdx_parse_log()
861 vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s, in vhdx_log_write() argument
897 vhdx_update_headers(bs, s, false, &new_guid); in vhdx_log_write()
932 file_length = bdrv_co_getlength(bs->file->bs); in vhdx_log_write()
960 buffer = qemu_blockalign(bs, total_length); in vhdx_log_write()
970 merged_sector = qemu_blockalign(bs, VHDX_LOG_SECTOR_SIZE); in vhdx_log_write()
979 ret = bdrv_co_pread(bs->file, file_offset, VHDX_LOG_SECTOR_SIZE, in vhdx_log_write()
989 ret = bdrv_co_pread(bs->file, file_offset + trailing_length, in vhdx_log_write()
1021 ret = vhdx_log_write_sectors(bs, &s->log, §ors_written, buffer, in vhdx_log_write()
1045 vhdx_log_write_and_flush(BlockDriverState *bs, BDRVVHDXState *s, in vhdx_log_write_and_flush() argument
1056 ret = bdrv_co_flush(bs); in vhdx_log_write_and_flush()
1061 ret = vhdx_log_write(bs, s, data, length, offset); in vhdx_log_write_and_flush()
1068 ret = bdrv_co_flush(bs); in vhdx_log_write_and_flush()
1073 ret = vhdx_log_flush(bs, s, &logs); in vhdx_log_write_and_flush()