block.h (64dff52019367194699a772e3cc31941fd9752a8) block.h (67a0fd2a9bca204d2b39f910a97c7137636a0715)
1#ifndef BLOCK_H
2#define BLOCK_H
3
4#include "block/aio.h"
5#include "qemu-common.h"
6#include "qemu/option.h"
7#include "qemu/coroutine.h"
8#include "block/accounting.h"

--- 97 unchanged lines hidden (view full) ---

106#define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS)
107#define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1)
108
109#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \
110 INT_MAX >> BDRV_SECTOR_BITS)
111
112/*
113 * Allocation status flags
1#ifndef BLOCK_H
2#define BLOCK_H
3
4#include "block/aio.h"
5#include "qemu-common.h"
6#include "qemu/option.h"
7#include "qemu/coroutine.h"
8#include "block/accounting.h"

--- 97 unchanged lines hidden (view full) ---

106#define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS)
107#define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1)
108
109#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \
110 INT_MAX >> BDRV_SECTOR_BITS)
111
112/*
113 * Allocation status flags
114 * BDRV_BLOCK_DATA: data is read from bs->file or another file
114 * BDRV_BLOCK_DATA: data is read from a file returned by bdrv_get_block_status.
115 * BDRV_BLOCK_ZERO: sectors read as zero
115 * BDRV_BLOCK_ZERO: sectors read as zero
116 * BDRV_BLOCK_OFFSET_VALID: sector stored in bs->file as raw data
116 * BDRV_BLOCK_OFFSET_VALID: sector stored as raw data in a file returned by
117 * bdrv_get_block_status.
117 * BDRV_BLOCK_ALLOCATED: the content of the block is determined by this
118 * layer (as opposed to the backing file)
119 * BDRV_BLOCK_RAW: used internally to indicate that the request
120 * was answered by the raw driver and that one
121 * should look in bs->file directly.
122 *
123 * If BDRV_BLOCK_OFFSET_VALID is set, bits 9-62 represent the offset in
124 * bs->file where sector data can be read from as raw data.

--- 254 unchanged lines hidden (view full) ---

379
380int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
381int bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
382int bdrv_has_zero_init_1(BlockDriverState *bs);
383int bdrv_has_zero_init(BlockDriverState *bs);
384bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs);
385bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs);
386int64_t bdrv_get_block_status(BlockDriverState *bs, int64_t sector_num,
118 * BDRV_BLOCK_ALLOCATED: the content of the block is determined by this
119 * layer (as opposed to the backing file)
120 * BDRV_BLOCK_RAW: used internally to indicate that the request
121 * was answered by the raw driver and that one
122 * should look in bs->file directly.
123 *
124 * If BDRV_BLOCK_OFFSET_VALID is set, bits 9-62 represent the offset in
125 * bs->file where sector data can be read from as raw data.

--- 254 unchanged lines hidden (view full) ---

380
381int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
382int bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
383int bdrv_has_zero_init_1(BlockDriverState *bs);
384int bdrv_has_zero_init(BlockDriverState *bs);
385bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs);
386bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs);
387int64_t bdrv_get_block_status(BlockDriverState *bs, int64_t sector_num,
387 int nb_sectors, int *pnum);
388 int nb_sectors, int *pnum,
389 BlockDriverState **file);
388int64_t bdrv_get_block_status_above(BlockDriverState *bs,
389 BlockDriverState *base,
390 int64_t sector_num,
390int64_t bdrv_get_block_status_above(BlockDriverState *bs,
391 BlockDriverState *base,
392 int64_t sector_num,
391 int nb_sectors, int *pnum);
393 int nb_sectors, int *pnum,
394 BlockDriverState **file);
392int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
393 int *pnum);
394int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base,
395 int64_t sector_num, int nb_sectors, int *pnum);
396
397int bdrv_is_read_only(BlockDriverState *bs);
398int bdrv_is_sg(BlockDriverState *bs);
399int bdrv_enable_write_cache(BlockDriverState *bs);

--- 182 unchanged lines hidden ---
395int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
396 int *pnum);
397int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base,
398 int64_t sector_num, int nb_sectors, int *pnum);
399
400int bdrv_is_read_only(BlockDriverState *bs);
401int bdrv_is_sg(BlockDriverState *bs);
402int bdrv_enable_write_cache(BlockDriverState *bs);

--- 182 unchanged lines hidden ---