From: Sage Weil <sage@newdream.net>
To: qemu-devel@nongnu.org, ceph-devel@vger.kernel.org
Cc: Sage Weil <sage@newdream.net>
Subject: [Qemu-devel] [PATCH 4/4] rbd: call flush, if available
Date: Thu, 15 Sep 2011 14:11:11 -0700 [thread overview]
Message-ID: <1316121071-7690-5-git-send-email-sage@newdream.net> (raw)
In-Reply-To: <1316121071-7690-1-git-send-email-sage@newdream.net>
librbd recently added async writeback and flush support. If the new
rbd_flush() call is available, call it.
Signed-off-by: Sage Weil <sage@newdream.net>
---
block/rbd.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/block/rbd.c b/block/rbd.c
index 202e7ec..af65924 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -705,6 +705,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;
@@ -840,6 +851,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.2.5
next prev parent reply other threads:[~2011-09-15 21:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-15 21:11 [Qemu-devel] [PATCH 0/4] More RBD updates Sage Weil
2011-09-15 21:11 ` [Qemu-devel] [PATCH 1/4] rbd: ignore failures when reading from default conf location Sage Weil
2011-09-15 21:11 ` [Qemu-devel] [PATCH 2/4] rbd: allow escaping in config string Sage Weil
2011-09-19 14:06 ` Kevin Wolf
2011-09-19 20:33 ` Sage Weil
2011-09-15 21:11 ` [Qemu-devel] [PATCH 3/4] rbd: update comment heading Sage Weil
2011-09-15 21:11 ` Sage Weil [this message]
2011-09-19 14:09 ` [Qemu-devel] [PATCH 0/4] More RBD updates Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316121071-7690-5-git-send-email-sage@newdream.net \
--to=sage@newdream.net \
--cc=ceph-devel@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).