[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/20] rbd: call flush, if available
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 16/20] rbd: call flush, if available |
Date: |
Tue, 20 Sep 2011 13:11:48 +0200 |
From: Sage Weil <address@hidden>
librbd recently added async writeback and flush support. If the new
rbd_flush() call is available, call it.
Signed-off-by: Sage Weil <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/rbd.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/block/rbd.c b/block/rbd.c
index 23d8751..98efd2c 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -680,6 +680,17 @@ static BlockDriverAIOCB
*qemu_rbd_aio_writev(BlockDriverState *bs,
return rbd_aio_rw_vector(bs, sector_num, qiov, nb_sectors, cb, opaque, 1);
}
+static int qemu_rbd_flush(BlockDriverState *bs)
+{
+#if LIBRBD_VERSION_CODE >= LIBRBD_VERSION(0, 1, 1)
+ /* rbd_flush added in 0.1.1 */
+ BDRVRBDState *s = bs->opaque;
+ return rbd_flush(s->image);
+#else
+ return 0;
+#endif
+}
+
static int qemu_rbd_getinfo(BlockDriverState *bs, BlockDriverInfo *bdi)
{
BDRVRBDState *s = bs->opaque;
@@ -815,6 +826,7 @@ static BlockDriver bdrv_rbd = {
.bdrv_file_open = qemu_rbd_open,
.bdrv_close = qemu_rbd_close,
.bdrv_create = qemu_rbd_create,
+ .bdrv_flush = qemu_rbd_flush,
.bdrv_get_info = qemu_rbd_getinfo,
.create_options = qemu_rbd_create_options,
.bdrv_getlength = qemu_rbd_getlength,
--
1.7.6.2
- [Qemu-devel] [PATCH 02/20] nbd: sync API definitions with upstream, (continued)
- [Qemu-devel] [PATCH 02/20] nbd: sync API definitions with upstream, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 08/20] dma-helpers: rewrite completion/cancellation, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 05/20] scsi-generic: do not disable FUA, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 07/20] dma-helpers: allow including from target-independent code, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 06/20] dma-helpers: rename is_write to to_dev, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 11/20] VMDK: fix leak of extent_file, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 09/20] scsi-disk: commonize iovec creation between reads and writes, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 04/20] raw-posix: Fix bdrv_flush error return values, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 12/20] posix-aio-compat: Removed unused offset variable, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 10/20] scsi-disk: lazily allocate bounce buffer, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 16/20] rbd: call flush, if available,
Kevin Wolf <=
- [Qemu-devel] [PATCH 13/20] AHCI Port Interrupt Enable register cleaning on soft reset, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 14/20] rbd: ignore failures when reading from default conf location, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 18/20] block: avoid SIGUSR2, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 17/20] scsi: fix sign extension problems, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 15/20] rbd: update comment heading, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 19/20] linux-aio: remove process requests callback, Kevin Wolf, 2011/09/20
- [Qemu-devel] [PATCH 20/20] rbd: allow escaping in config string, Kevin Wolf, 2011/09/20
- Re: [Qemu-devel] [PULL 00/20] Block patches, Anthony Liguori, 2011/09/20