mirror of https://gitlab.com/qemu-project/qemu
gluster: Convert to bdrv_co_pwrite_zeroes()
Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
9c21a4220b
commit
e88a36ebad
|
@ -454,14 +454,12 @@ static void qemu_gluster_reopen_abort(BDRVReopenState *state)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
||||||
static coroutine_fn int qemu_gluster_co_write_zeroes(BlockDriverState *bs,
|
static coroutine_fn int qemu_gluster_co_pwrite_zeroes(BlockDriverState *bs,
|
||||||
int64_t sector_num, int nb_sectors, BdrvRequestFlags flags)
|
int64_t offset, int size, BdrvRequestFlags flags)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
GlusterAIOCB acb;
|
GlusterAIOCB acb;
|
||||||
BDRVGlusterState *s = bs->opaque;
|
BDRVGlusterState *s = bs->opaque;
|
||||||
off_t size = nb_sectors * BDRV_SECTOR_SIZE;
|
|
||||||
off_t offset = sector_num * BDRV_SECTOR_SIZE;
|
|
||||||
|
|
||||||
acb.size = size;
|
acb.size = size;
|
||||||
acb.ret = 0;
|
acb.ret = 0;
|
||||||
|
@ -769,7 +767,7 @@ static BlockDriver bdrv_gluster = {
|
||||||
.bdrv_co_discard = qemu_gluster_co_discard,
|
.bdrv_co_discard = qemu_gluster_co_discard,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
||||||
.bdrv_co_write_zeroes = qemu_gluster_co_write_zeroes,
|
.bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes,
|
||||||
#endif
|
#endif
|
||||||
.create_opts = &qemu_gluster_create_opts,
|
.create_opts = &qemu_gluster_create_opts,
|
||||||
};
|
};
|
||||||
|
@ -796,7 +794,7 @@ static BlockDriver bdrv_gluster_tcp = {
|
||||||
.bdrv_co_discard = qemu_gluster_co_discard,
|
.bdrv_co_discard = qemu_gluster_co_discard,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
||||||
.bdrv_co_write_zeroes = qemu_gluster_co_write_zeroes,
|
.bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes,
|
||||||
#endif
|
#endif
|
||||||
.create_opts = &qemu_gluster_create_opts,
|
.create_opts = &qemu_gluster_create_opts,
|
||||||
};
|
};
|
||||||
|
@ -823,7 +821,7 @@ static BlockDriver bdrv_gluster_unix = {
|
||||||
.bdrv_co_discard = qemu_gluster_co_discard,
|
.bdrv_co_discard = qemu_gluster_co_discard,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
||||||
.bdrv_co_write_zeroes = qemu_gluster_co_write_zeroes,
|
.bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes,
|
||||||
#endif
|
#endif
|
||||||
.create_opts = &qemu_gluster_create_opts,
|
.create_opts = &qemu_gluster_create_opts,
|
||||||
};
|
};
|
||||||
|
@ -850,7 +848,7 @@ static BlockDriver bdrv_gluster_rdma = {
|
||||||
.bdrv_co_discard = qemu_gluster_co_discard,
|
.bdrv_co_discard = qemu_gluster_co_discard,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
#ifdef CONFIG_GLUSTERFS_ZEROFILL
|
||||||
.bdrv_co_write_zeroes = qemu_gluster_co_write_zeroes,
|
.bdrv_co_pwrite_zeroes = qemu_gluster_co_pwrite_zeroes,
|
||||||
#endif
|
#endif
|
||||||
.create_opts = &qemu_gluster_create_opts,
|
.create_opts = &qemu_gluster_create_opts,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue