Home
last modified time | relevance | path

Searched refs:BDRV_SECTOR_SIZE (Results 1 – 25 of 59) sorted by relevance

123

/openbmc/qemu/block/
H A Dparallels.c214 payload_bytes -= s->data_start * BDRV_SECTOR_SIZE; in parallels_fill_used_bitmap()
283 bytes += s->prealloc_size * BDRV_SECTOR_SIZE; in allocate_clusters()
285 host_off = s->data_end * BDRV_SECTOR_SIZE; in allocate_clusters()
321 host_off = s->data_start * BDRV_SECTOR_SIZE; in allocate_clusters()
330 host_off < s->data_end * BDRV_SECTOR_SIZE) { in allocate_clusters()
353 ret = bdrv_co_pread(bs->backing, idx * s->tracks * BDRV_SECTOR_SIZE, in allocate_clusters()
360 ret = bdrv_co_pwrite(bs->file, s->data_end * BDRV_SECTOR_SIZE, in allocate_clusters()
375 host_off / BDRV_SECTOR_SIZE / s->off_multiplier); in allocate_clusters()
378 if (host_off > s->data_end * BDRV_SECTOR_SIZE) { in allocate_clusters()
379 s->data_end = host_off / BDRV_SECTOR_SIZE; in allocate_clusters()
[all …]
H A Dbochs.c174 if (s->extent_size < BDRV_SECTOR_SIZE) { in bochs_open()
192 s->extent_size / BDRV_SECTOR_SIZE)) in bochs_open()
209 bs->bl.request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O */ in bochs_refresh_limits()
258 assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); in bochs_co_preadv()
259 assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); in bochs_co_preadv()
H A Dreplication.c241 ret = bdrv_co_preadv(bs->file, sector_num * BDRV_SECTOR_SIZE, in replication_co_readv()
242 remaining_sectors * BDRV_SECTOR_SIZE, qiov, 0); in replication_co_readv()
266 ret = bdrv_co_pwritev(top, sector_num * BDRV_SECTOR_SIZE, in replication_co_writev()
267 remaining_sectors * BDRV_SECTOR_SIZE, qiov, 0); in replication_co_writev()
280 sector_num * BDRV_SECTOR_SIZE, in replication_co_writev()
281 remaining_sectors * BDRV_SECTOR_SIZE, in replication_co_writev()
287 assert(QEMU_IS_ALIGNED(count, BDRV_SECTOR_SIZE)); in replication_co_writev()
293 ret = bdrv_co_pwritev(target, sector_num * BDRV_SECTOR_SIZE, in replication_co_writev()
294 n * BDRV_SECTOR_SIZE, &hd_qiov, 0); in replication_co_writev()
H A Dqcow.c443 assert(QEMU_IS_ALIGNED(n_start | n_end, BDRV_SECTOR_SIZE)); in get_cluster_offset()
489 for (i = 0; i < s->cluster_size; i += BDRV_SECTOR_SIZE) { in get_cluster_offset()
491 memset(s->cluster_data, 0x00, BDRV_SECTOR_SIZE); in get_cluster_offset()
495 BDRV_SECTOR_SIZE, in get_cluster_offset()
501 BDRV_SECTOR_SIZE, in get_cluster_offset()
625 bs->bl.request_alignment = BDRV_SECTOR_SIZE; in qcow_refresh_limits()
911 tmp = g_malloc0(BDRV_SECTOR_SIZE); in qcow_co_create()
912 for (i = 0; i < DIV_ROUND_UP(sizeof(uint64_t) * l1_size, BDRV_SECTOR_SIZE); in qcow_co_create()
914 ret = blk_co_pwrite(qcow_blk, header_size + BDRV_SECTOR_SIZE * i, in qcow_co_create()
915 BDRV_SECTOR_SIZE, tmp, 0); in qcow_co_create()
[all …]
H A Discsi.c424 return sector * iscsilun->block_size / BDRV_SECTOR_SIZE; in sector_lun2qemu()
429 return sector * BDRV_SECTOR_SIZE / iscsilun->block_size; in sector_qemu2lun()
677 iscsi_allocmap_set_invalid(iscsilun, sector_num * BDRV_SECTOR_SIZE,
678 nb_sectors * BDRV_SECTOR_SIZE);
685 iscsi_allocmap_set_allocated(iscsilun, sector_num * BDRV_SECTOR_SIZE,
686 nb_sectors * BDRV_SECTOR_SIZE);
820 if (iscsi_allocmap_is_valid(iscsilun, sector_num * BDRV_SECTOR_SIZE, in iscsi_co_readv()
821 nb_sectors * BDRV_SECTOR_SIZE) && in iscsi_co_readv()
822 !iscsi_allocmap_is_allocated(iscsilun, sector_num * BDRV_SECTOR_SIZE, in iscsi_co_readv()
823 nb_sectors * BDRV_SECTOR_SIZE)) { in iscsi_co_readv()
[all …]
H A Dvmdk.c1055 * BDRV_SECTOR_SIZE)); in vmdk_open_vmdk4()
1736 ret = get_whole_cluster(bs, extent, cluster_sector * BDRV_SECTOR_SIZE, in get_cluster_offset()
1771 uint64_t cluster_size = extent->cluster_sectors * BDRV_SECTOR_SIZE; in vmdk_find_offset_in_cluster()
1774 (extent->end_sector - extent->sectors) * BDRV_SECTOR_SIZE; in vmdk_find_offset_in_cluster()
1824 n = extent->cluster_sectors * BDRV_SECTOR_SIZE - index_in_cluster; in vmdk_co_block_status()
1890 write_end_sector = DIV_ROUND_UP(write_offset + n_bytes, BDRV_SECTOR_SIZE); in vmdk_write_extent()
2002 n_bytes = MIN(bytes, extent->cluster_sectors * BDRV_SECTOR_SIZE in vmdk_co_preadv()
2071 if (DIV_ROUND_UP(offset, BDRV_SECTOR_SIZE) > bs->total_sectors) { in vmdk_pwritev()
2087 n_bytes = MIN(bytes, extent->cluster_sectors * BDRV_SECTOR_SIZE in vmdk_pwritev()
2113 n_bytes >= extent->cluster_sectors * BDRV_SECTOR_SIZE) { in vmdk_pwritev()
[all …]
H A Dcloop.c218 bs->bl.request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O */ in cloop_refresh_limits()
263 assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); in cloop_co_preadv()
264 assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); in cloop_co_preadv()
H A Dvpc.c340 BDRV_SECTOR_SIZE; in vpc_open()
364 if (!is_power_of_2(s->block_size) || s->block_size < BDRV_SECTOR_SIZE) { in vpc_open()
566 if ((offset < 0) || (offset > bs->total_sectors * BDRV_SECTOR_SIZE)) { in alloc_block()
945 total_sectors = MIN(VHD_MAX_GEOMETRY, total_size / BDRV_SECTOR_SIZE); in calculate_rounded_image_size()
952 total_sectors = total_size / BDRV_SECTOR_SIZE; in calculate_rounded_image_size()
1030 if (total_size != total_sectors * BDRV_SECTOR_SIZE) { in vpc_co_create()
1036 total_sectors * BDRV_SECTOR_SIZE); in vpc_co_create()
1148 ROUND_UP(create_options->u.vpc.size, BDRV_SECTOR_SIZE); in vpc_co_create_opts()
1158 create_options->u.vpc.size = total_sectors * BDRV_SECTOR_SIZE; in vpc_co_create_opts()
H A Draw-format.c128 if (has_size && !QEMU_IS_ALIGNED(size, BDRV_SECTOR_SIZE)) { in raw_apply_options()
130 BDRV_SECTOR_SIZE); in raw_apply_options()
238 QEMU_BUILD_BUG_ON(BDRV_SECTOR_SIZE != 512); in raw_co_pwritev()
385 BDRV_SECTOR_SIZE); in raw_measure()
410 bs->bl.request_alignment = BDRV_SECTOR_SIZE; in raw_refresh_limits()
H A Dpreallocate.c123 if (!QEMU_IS_ALIGNED(dest->prealloc_align, BDRV_SECTOR_SIZE)) { in preallocate_absorb_opts()
125 "is not aligned to %llu", BDRV_SECTOR_SIZE); in preallocate_absorb_opts()
566 bs->file->bs->total_sectors * BDRV_SECTOR_SIZE; in preallocate_set_perm()
H A Dvvfat.c1301 bs->bl.request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O */ in vvfat_refresh_limits()
1487 ret = bdrv_co_is_allocated(s->qcow->bs, sector_num * BDRV_SECTOR_SIZE, in vvfat_read()
1488 (nb_sectors - i) * BDRV_SECTOR_SIZE, &n); in vvfat_read()
1496 if (bdrv_co_pread(s->qcow, sector_num * BDRV_SECTOR_SIZE, n, in vvfat_read()
1548 assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); in vvfat_co_preadv()
1549 assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); in vvfat_co_preadv()
1815 i) * BDRV_SECTOR_SIZE, in cluster_was_modified()
1816 BDRV_SECTOR_SIZE, NULL); in cluster_was_modified()
1970 (offs + i) * BDRV_SECTOR_SIZE, in get_cluster_count_for_direntry()
1971 BDRV_SECTOR_SIZE, NULL); in get_cluster_count_for_direntry()
[all …]
H A Dssh.c969 BDRV_SECTOR_SIZE); in ssh_co_create_opts()
1129 ret = ssh_read(s, bs, sector_num * BDRV_SECTOR_SIZE, in ssh_co_readv()
1130 nb_sectors * BDRV_SECTOR_SIZE, qiov); in ssh_co_readv()
1204 ret = ssh_write(s, bs, sector_num * BDRV_SECTOR_SIZE, in ssh_co_writev()
1205 nb_sectors * BDRV_SECTOR_SIZE, qiov); in ssh_co_writev()
H A Dqed.c111 int nsectors = DIV_ROUND_UP(sizeof(QEDHeader), BDRV_SECTOR_SIZE); in qed_write_header()
112 size_t len = nsectors * BDRV_SECTOR_SIZE; in qed_write_header()
177 if (image_size % BDRV_SECTOR_SIZE != 0) { in qed_is_image_size_valid()
822 ROUND_UP(create_options->u.qed.size, BDRV_SECTOR_SIZE); in bdrv_qed_co_create_opts()
1398 .cur_pos = (uint64_t) sector_num * BDRV_SECTOR_SIZE, in qed_co_request()
1399 .end_pos = (sector_num + nb_sectors) * BDRV_SECTOR_SIZE, in qed_co_request()
H A Ddmg.c595 bs->bl.request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O */ in dmg_refresh_limits()
737 assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); in dmg_co_preadv()
738 assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); in dmg_co_preadv()
H A Dqcow2.c891 uint64_t virtual_disk_size = bs->total_sectors * BDRV_SECTOR_SIZE; in read_cache_sizes()
1530 bs->total_sectors = header.size / BDRV_SECTOR_SIZE; in qcow2_do_open()
2944 total_size = bs->total_sectors * BDRV_SECTOR_SIZE; in qcow2_update_header()
3536 if (!QEMU_IS_ALIGNED(qcow2_opts->size, BDRV_SECTOR_SIZE)) { in qcow2_co_create()
3538 (unsigned) BDRV_SECTOR_SIZE); in qcow2_co_create()
4009 BDRV_SECTOR_SIZE); in qcow2_co_create_opts()
4038 if (offset + bytes > bs->total_sectors * BDRV_SECTOR_SIZE) { in is_zero()
4039 bytes = bs->total_sectors * BDRV_SECTOR_SIZE - offset; in is_zero()
4073 if (offset + bytes == bs->total_sectors * BDRV_SECTOR_SIZE) { in qcow2_co_pwrite_zeroes()
4134 offset + bytes != bs->total_sectors * BDRV_SECTOR_SIZE) { in qcow2_co_pdiscard()
[all …]
/openbmc/qemu/hw/ppc/
H A Dpnv_pnor.c44 offset = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE); in pnv_pnor_update()
45 offset_end = QEMU_ALIGN_UP(offset_end, BDRV_SECTOR_SIZE); in pnv_pnor_update()
/openbmc/qemu/hw/block/
H A Dhd-geometry.c58 uint8_t buf[BDRV_SECTOR_SIZE]; in guess_disk_lchs()
66 if (blk_pread(blk, 0, BDRV_SECTOR_SIZE, buf, 0) < 0) { in guess_disk_lchs()
H A Dnand.c742 BDRV_SECTOR_SIZE, iobuf, 0) < 0) {
749 BDRV_SECTOR_SIZE, iobuf, 0) < 0) {
754 BDRV_SECTOR_SIZE, iobuf, 0) < 0) {
762 if (blk_pwrite(s->blk, i, BDRV_SECTOR_SIZE, iobuf, 0) < 0) {
770 BDRV_SECTOR_SIZE, iobuf, 0) < 0) {
775 BDRV_SECTOR_SIZE, iobuf, 0) < 0) {
H A Dblock.c137 conf->physical_block_size = BDRV_SECTOR_SIZE; in blkconf_blocksizes()
144 conf->logical_block_size = BDRV_SECTOR_SIZE; in blkconf_blocksizes()
/openbmc/qemu/hw/scsi/
H A Dscsi-disk.c153 r->iov.iov_len = MIN(r->sector_count * BDRV_SECTOR_SIZE, r->buflen); in scsi_init_iovec()
446 n = r->qiov.size / BDRV_SECTOR_SIZE; in scsi_read_complete_noio()
493 BDRV_SECTOR_SIZE, in scsi_do_read()
579 n = r->qiov.size / BDRV_SECTOR_SIZE; in scsi_write_complete_noio()
656 BDRV_SECTOR_SIZE, in scsi_write_data()
1412 nb_sectors /= (s->qdev.blocksize / BDRV_SECTOR_SIZE); in scsi_disk_emulate_mode_sense()
1470 nb_sectors /= s->qdev.blocksize / BDRV_SECTOR_SIZE; in scsi_disk_emulate_read_toc()
1772 r->sector = sector_num * (s->qdev.blocksize / BDRV_SECTOR_SIZE); in scsi_unmap_complete_noio()
1773 r->sector_count = nb_sectors * (s->qdev.blocksize / BDRV_SECTOR_SIZE); in scsi_unmap_complete_noio()
1783 r->sector_count * BDRV_SECTOR_SIZE, in scsi_unmap_complete_noio()
[all …]
/openbmc/qemu/
H A Dqemu-img.c1156 int64_t end = QEMU_ALIGN_DOWN(n, BDRV_SECTOR_SIZE); in find_nonzero()
1158 for (i = 0; i < end; i += BDRV_SECTOR_SIZE) { in find_nonzero()
1159 if (!buffer_is_zero(buf + i, BDRV_SECTOR_SIZE)) { in find_nonzero()
1189 is_zero = buffer_is_zero(buf, BDRV_SECTOR_SIZE); in is_allocated_sectors()
1191 buf += BDRV_SECTOR_SIZE; in is_allocated_sectors()
1192 if (is_zero != buffer_is_zero(buf, BDRV_SECTOR_SIZE)) { in is_allocated_sectors()
1253 buf += BDRV_SECTOR_SIZE * *pnum; in is_allocated_sectors_min()
1261 buf += BDRV_SECTOR_SIZE * *pnum; in is_allocated_sectors_min()
1293 chsize = BDRV_SECTOR_SIZE; in compare_buffers()
1739 uint64_t offset = (sector_num - src_cur_offset) * BDRV_SECTOR_SIZE; in convert_iteration_sectors()
[all …]
/openbmc/qemu/hw/ide/
H A Dcore.c789 ide_transfer_start(s, s->io_buffer, n * BDRV_SECTOR_SIZE, ide_sector_read); in ide_sector_read_cb()
822 qemu_iovec_init_buf(&s->qiov, s->io_buffer, n * BDRV_SECTOR_SIZE); in ide_sector_read()
825 n * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ); in ide_sector_read()
964 BDRV_SECTOR_SIZE, ide_dma_cb, s); in ide_dma_cb()
968 BDRV_SECTOR_SIZE, ide_dma_cb, s); in ide_dma_cb()
972 &s->sg, offset, BDRV_SECTOR_SIZE, in ide_dma_cb()
997 s->nsector * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ); in ide_sector_start_dma()
1001 s->nsector * BDRV_SECTOR_SIZE, BLOCK_ACCT_WRITE); in ide_sector_start_dma()
1058 ide_transfer_start(s, s->io_buffer, n1 * BDRV_SECTOR_SIZE, in ide_sector_write_cb()
1097 qemu_iovec_init_buf(&s->qiov, s->io_buffer, n * BDRV_SECTOR_SIZE); in ide_sector_write()
[all …]
H A Datapi.c835 if (max_len > BDRV_SECTOR_SIZE) { in cmd_get_configuration()
837 max_len = BDRV_SECTOR_SIZE; in cmd_get_configuration()
1211 memset(buf, 0, max_len > IDE_DMA_BUF_SECTORS * BDRV_SECTOR_SIZE + 4 ? in cmd_read_dvd_structure()
1212 IDE_DMA_BUF_SECTORS * BDRV_SECTOR_SIZE + 4 : max_len); in cmd_read_dvd_structure()
/openbmc/qemu/include/block/
H A Dblock-common.h263 #define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS) macro
/openbmc/qemu/block/export/
H A Dvirtio-blk-handler.c38 QEMU_BUILD_BUG_ON(BDRV_SECTOR_SIZE != VIRTIO_BLK_SECTOR_SIZE); in virtio_blk_sect_range_ok()

123