From patchwork Tue Sep 18 18:53:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Cody X-Patchwork-Id: 184809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4ABC12C0085 for ; Wed, 19 Sep 2012 05:18:12 +1000 (EST) Received: from localhost ([::1]:52299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TE2w5-0002nV-0i for incoming@patchwork.ozlabs.org; Tue, 18 Sep 2012 14:54:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TE2vd-00026J-Pi for qemu-devel@nongnu.org; Tue, 18 Sep 2012 14:53:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TE2vb-0004Qh-9j for qemu-devel@nongnu.org; Tue, 18 Sep 2012 14:53:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TE2va-0004QW-WD for qemu-devel@nongnu.org; Tue, 18 Sep 2012 14:53:47 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8IIrhff006804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Sep 2012 14:53:43 -0400 Received: from localhost (ovpn-112-22.phx2.redhat.com [10.3.112.22]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8IIrgKn026004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 18 Sep 2012 14:53:43 -0400 From: Jeff Cody To: qemu-devel@nongnu.org Date: Tue, 18 Sep 2012 14:53:12 -0400 Message-Id: <7047947d51dbf569d25632b2530a4686b8c1f7a6.1347993885.git.jcody@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@gmail.com, eblake@redhat.com, supriyak@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH v3 07/19] block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- block/raw-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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