Patchwork [v3,07/19] block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c

login
register
mail settings
Submitter Jeff Cody
Date Sept. 18, 2012, 6:53 p.m.
Message ID <7047947d51dbf569d25632b2530a4686b8c1f7a6.1347993885.git.jcody@redhat.com>
Download mbox | patch
Permalink /patch/184809/
State New
Headers show

Comments

Jeff Cody - Sept. 18, 2012, 6:53 p.m.
Rather than check for a non-NULL aligned_buf to determine if
raw_aio_submit needs to check for alignment, check for the presence
of BDRV_O_NOCACHE in the bs->open_flags.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 block/raw-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/block/raw-posix.c b/block/raw-posix.c
index 4a1047c..1ea09c0 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -352,7 +352,7 @@  static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,
      * boundary.  Check if this is the case or tell the low-level
      * driver that it needs to copy the buffer.
      */
-    if (s->aligned_buf) {
+    if ((bs->open_flags & BDRV_O_NOCACHE)) {
         if (!qiov_is_aligned(bs, qiov)) {
             type |= QEMU_AIO_MISALIGNED;
 #ifdef CONFIG_LINUX_AIO