mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
block: introduce BDRV_REQ_MAY_UNMAP request flag
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
aa7bfbfff7
commit
d32f35cbc5
4 changed files with 14 additions and 2 deletions
4
block.c
4
block.c
|
@ -2818,6 +2818,10 @@ int coroutine_fn bdrv_co_write_zeroes(BlockDriverState *bs,
|
|||
{
|
||||
trace_bdrv_co_write_zeroes(bs, sector_num, nb_sectors);
|
||||
|
||||
if (!(bs->open_flags & BDRV_O_UNMAP)) {
|
||||
flags &= ~BDRV_REQ_MAY_UNMAP;
|
||||
}
|
||||
|
||||
return bdrv_co_do_writev(bs, sector_num, nb_sectors, NULL,
|
||||
BDRV_REQ_ZERO_WRITE | flags);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue