From: Frediano Ziglio <freddy77@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, Frediano Ziglio <freddy77@gmail.com>
Subject: [Qemu-devel] [PATCH 1/2] linux aio: support flush operation
Date: Wed, 27 Jul 2011 20:25:25 +0200 [thread overview]
Message-ID: <1311791126-11383-2-git-send-email-freddy77@gmail.com> (raw)
In-Reply-To: <1311791126-11383-1-git-send-email-freddy77@gmail.com>
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
---
block/raw-posix.c | 7 +++++++
linux-aio.c | 3 +++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 3c6bd4b..27ae81e 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -628,6 +628,13 @@ static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs,
if (fd_open(bs) < 0)
return NULL;
+#ifdef CONFIG_LINUX_AIO
+ if (s->use_aio) {
+ return laio_submit(bs, s->aio_ctx, s->fd, 0, NULL,
+ 0, cb, opaque, QEMU_AIO_FLUSH);
+ }
+#endif
+
return paio_submit(bs, s->fd, 0, NULL, 0, cb, opaque, QEMU_AIO_FLUSH);
}
diff --git a/linux-aio.c b/linux-aio.c
index 68f4b3d..d07c435 100644
--- a/linux-aio.c
+++ b/linux-aio.c
@@ -215,6 +215,9 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
case QEMU_AIO_READ:
io_prep_preadv(iocbs, fd, qiov->iov, qiov->niov, offset);
break;
+ case QEMU_AIO_FLUSH:
+ io_prep_fdsync(iocbs, fd);
+ break;
default:
fprintf(stderr, "%s: invalid AIO request type 0x%x.\n",
__func__, type);
--
1.7.1
next prev parent reply other threads:[~2011-07-27 18:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-27 18:25 [Qemu-devel] [PATCH 0/2] improve Linux AIO support Frediano Ziglio
2011-07-27 18:25 ` Frediano Ziglio [this message]
2011-07-27 18:31 ` [Qemu-devel] [PATCH 1/2] linux aio: support flush operation Christoph Hellwig
2011-07-27 19:52 ` Frediano Ziglio
2011-07-27 19:57 ` Christoph Hellwig
2011-07-28 7:47 ` Kevin Wolf
2011-07-28 12:15 ` Christoph Hellwig
2011-07-28 12:41 ` Kevin Wolf
2011-07-29 14:24 ` Christoph Hellwig
2011-07-29 15:33 ` Stefan Hajnoczi
2011-07-27 18:25 ` [Qemu-devel] [PATCH 2/2] aio: use Linux AIO even if nocache is not specified Frediano Ziglio
2011-07-27 18:32 ` Christoph Hellwig
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=1311791126-11383-2-git-send-email-freddy77@gmail.com \
--to=freddy77@gmail.com \
--cc=kwolf@redhat.com \
--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).