Lines Matching refs:bs

314     BlockDriverState *bs_file = file->bs;  in vhdx_write_header()
357 vhdx_update_header(BlockDriverState *bs, BDRVVHDXState *s, in vhdx_update_header() argument
393 ret = vhdx_write_header(bs->file, inactive_header, header_offset, true); in vhdx_update_header()
407 int vhdx_update_headers(BlockDriverState *bs, BDRVVHDXState *s, in vhdx_update_headers() argument
412 ret = vhdx_update_header(bs, s, generate_data_write_guid, log_guid); in vhdx_update_headers()
416 return vhdx_update_header(bs, s, generate_data_write_guid, log_guid); in vhdx_update_headers()
421 vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s, Error **errp) in vhdx_parse_header() argument
433 header1 = qemu_blockalign(bs, sizeof(VHDXHeader)); in vhdx_parse_header()
434 header2 = qemu_blockalign(bs, sizeof(VHDXHeader)); in vhdx_parse_header()
436 buffer = qemu_blockalign(bs, VHDX_HEADER_SIZE); in vhdx_parse_header()
444 ret = bdrv_pread(bs->file, VHDX_HEADER1_OFFSET, VHDX_HEADER_SIZE, buffer, in vhdx_parse_header()
461 ret = bdrv_pread(bs->file, VHDX_HEADER2_OFFSET, VHDX_HEADER_SIZE, buffer, in vhdx_parse_header()
522 vhdx_open_region_tables(BlockDriverState *bs, BDRVVHDXState *s) in vhdx_open_region_tables() argument
534 buffer = qemu_blockalign(bs, VHDX_HEADER_BLOCK_SIZE); in vhdx_open_region_tables()
536 ret = bdrv_pread(bs->file, VHDX_REGION_TABLE_OFFSET, in vhdx_open_region_tables()
640 vhdx_parse_metadata(BlockDriverState *bs, BDRVVHDXState *s) in vhdx_parse_metadata() argument
648 buffer = qemu_blockalign(bs, VHDX_METADATA_TABLE_MAX_SIZE); in vhdx_parse_metadata()
650 ret = bdrv_pread(bs->file, s->metadata_rt.file_offset, in vhdx_parse_metadata()
753 ret = bdrv_pread(bs->file, in vhdx_parse_metadata()
789 ret = bdrv_pread(bs->file, in vhdx_parse_metadata()
798 ret = bdrv_pread(bs->file, in vhdx_parse_metadata()
807 ret = bdrv_pread(bs->file, in vhdx_parse_metadata()
892 vhdx_check_bat_entries(BlockDriverState *bs, int *errcnt) in vhdx_check_bat_entries() argument
894 BDRVVHDXState *s = bs->opaque; in vhdx_check_bat_entries()
895 int64_t image_file_size = bdrv_getlength(bs->file->bs); in vhdx_check_bat_entries()
915 bs->total_sectors * BDRV_SECTOR_SIZE - i * s->block_size); in vhdx_check_bat_entries()
981 static void vhdx_close(BlockDriverState *bs) in vhdx_close() argument
983 BDRVVHDXState *s = bs->opaque; in vhdx_close()
998 static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, in vhdx_open() argument
1001 BDRVVHDXState *s = bs->opaque; in vhdx_open()
1009 ret = bdrv_open_file_child(NULL, options, "file", bs, errp); in vhdx_open()
1023 ret = bdrv_pread(bs->file, 0, sizeof(uint64_t), &signature, 0); in vhdx_open()
1037 vhdx_parse_header(bs, s, &local_err); in vhdx_open()
1044 ret = vhdx_parse_log(bs, s, &s->log_replayed_on_open, errp); in vhdx_open()
1049 ret = vhdx_open_region_tables(bs, s); in vhdx_open()
1054 ret = vhdx_parse_metadata(bs, s); in vhdx_open()
1063 bs->total_sectors = s->virtual_disk_size >> s->logical_sector_size_bits; in vhdx_open()
1076 s->bat = qemu_try_blockalign(bs->file->bs, s->bat_rt.length); in vhdx_open()
1082 ret = bdrv_pread(bs->file, s->bat_offset, s->bat_rt.length, s->bat, 0); in vhdx_open()
1093 ret = vhdx_check_bat_entries(bs, NULL); in vhdx_open()
1102 bdrv_get_device_or_node_name(bs)); in vhdx_open()
1112 vhdx_close(bs); in vhdx_open()
1171 vhdx_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) in vhdx_co_get_info() argument
1173 BDRVVHDXState *s = bs->opaque; in vhdx_co_get_info()
1182 vhdx_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, in vhdx_co_readv() argument
1185 BDRVVHDXState *s = bs->opaque; in vhdx_co_readv()
1220 ret = bdrv_co_preadv(bs->file, sinfo.file_offset, in vhdx_co_readv()
1260 vhdx_allocate_block(BlockDriverState *bs, BDRVVHDXState *s, in vhdx_allocate_block() argument
1265 current_len = bdrv_co_getlength(bs->file->bs); in vhdx_allocate_block()
1281 ret = bdrv_co_truncate(bs->file, *new_offset + s->block_size, false, in vhdx_allocate_block()
1289 return bdrv_co_truncate(bs->file, *new_offset + s->block_size, false, in vhdx_allocate_block()
1296 static void vhdx_update_bat_table_entry(BlockDriverState *bs, BDRVVHDXState *s, in vhdx_update_bat_table_entry() argument
1325 int vhdx_user_visible_write(BlockDriverState *bs, BDRVVHDXState *s) in vhdx_user_visible_write() argument
1330 ret = vhdx_update_headers(bs, s, true, NULL); in vhdx_user_visible_write()
1336 vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors, in vhdx_co_writev() argument
1340 BDRVVHDXState *s = bs->opaque; in vhdx_co_writev()
1357 ret = vhdx_user_visible_write(bs, s); in vhdx_co_writev()
1388 ret = vhdx_allocate_block(bs, s, &sinfo.file_offset, in vhdx_co_writev()
1398 vhdx_update_bat_table_entry(bs, s, &sinfo, &bat_entry, in vhdx_co_writev()
1416 iov1.iov_base = qemu_blockalign(bs, iov1.iov_len); in vhdx_co_writev()
1432 iov2.iov_base = qemu_blockalign(bs, iov2.iov_len); in vhdx_co_writev()
1455 ret = bdrv_co_pwritev(bs->file, sinfo.file_offset, in vhdx_co_writev()
1475 ret = vhdx_log_write_and_flush(bs, s, &bat_entry, in vhdx_co_writev()
1497 vhdx_update_bat_table_entry(bs, s, &sinfo, &bat_entry, in vhdx_co_writev()
1520 BlockDriverState *bs = blk_bs(blk); in vhdx_create_new_headers() local
1541 child = QLIST_FIRST(&bs->parents); in vhdx_create_new_headers()
1916 BlockDriverState *bs = NULL; in vhdx_co_create() local
2006 bs = bdrv_co_open_blockdev_ref(vhdx_opts->file, errp); in vhdx_co_create()
2007 if (bs == NULL) { in vhdx_co_create()
2011 blk = blk_co_new_with_bs(bs, BLK_PERM_WRITE | BLK_PERM_RESIZE, BLK_PERM_ALL, in vhdx_co_create()
2068 bdrv_co_unref(bs); in vhdx_co_create()
2080 BlockDriverState *bs = NULL; in vhdx_co_create_opts() local
2104 bs = bdrv_co_open(filename, NULL, NULL, in vhdx_co_create_opts()
2106 if (bs == NULL) { in vhdx_co_create_opts()
2113 qdict_put_str(qdict, "file", bs->node_name); in vhdx_co_create_opts()
2158 bdrv_co_unref(bs); in vhdx_co_create_opts()
2171 vhdx_co_check(BlockDriverState *bs, BdrvCheckResult *result, in vhdx_co_check() argument
2174 BDRVVHDXState *s = bs->opaque; in vhdx_co_check()
2180 vhdx_check_bat_entries(bs, &result->corruptions); in vhdx_co_check()
2185 static int GRAPH_RDLOCK vhdx_has_zero_init(BlockDriverState *bs) in vhdx_has_zero_init() argument
2187 BDRVVHDXState *s = bs->opaque; in vhdx_has_zero_init()
2202 return bdrv_has_zero_init(bs->file->bs); in vhdx_has_zero_init()