mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
block: drop redundant bdrv_flush implementation
Block drivers now only need to provide either of .bdrv_co_flush, .bdrv_aio_flush() or for legacy drivers .bdrv_flush(). Remove the redundant .bdrv_flush() implementations. [Paolo Bonzini: change raw driver to bdrv_co_flush] Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
07f0761574
commit
6f6dc6565e
7 changed files with 3 additions and 74 deletions
13
block/raw.c
13
block/raw.c
|
@ -25,15 +25,9 @@ static void raw_close(BlockDriverState *bs)
|
|||
{
|
||||
}
|
||||
|
||||
static int raw_flush(BlockDriverState *bs)
|
||||
static int coroutine_fn raw_co_flush(BlockDriverState *bs)
|
||||
{
|
||||
return bdrv_flush(bs->file);
|
||||
}
|
||||
|
||||
static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs,
|
||||
BlockDriverCompletionFunc *cb, void *opaque)
|
||||
{
|
||||
return bdrv_aio_flush(bs->file, cb, opaque);
|
||||
return bdrv_co_flush(bs->file);
|
||||
}
|
||||
|
||||
static int64_t raw_getlength(BlockDriverState *bs)
|
||||
|
@ -117,12 +111,11 @@ static BlockDriver bdrv_raw = {
|
|||
.bdrv_close = raw_close,
|
||||
.bdrv_co_readv = raw_co_readv,
|
||||
.bdrv_co_writev = raw_co_writev,
|
||||
.bdrv_flush = raw_flush,
|
||||
.bdrv_co_flush = raw_co_flush,
|
||||
.bdrv_probe = raw_probe,
|
||||
.bdrv_getlength = raw_getlength,
|
||||
.bdrv_truncate = raw_truncate,
|
||||
|
||||
.bdrv_aio_flush = raw_aio_flush,
|
||||
.bdrv_discard = raw_discard,
|
||||
|
||||
.bdrv_is_inserted = raw_is_inserted,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue