Received: from eggs.gnu.org ([2001:4830:134:3::10]:53172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5DCX-0007qw-Qh for qemu-devel@nongnu.org; Tue, 24 May 2016 10:20:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5DCT-0005Fy-C0 for qemu-devel@nongnu.org; Tue, 24 May 2016 10:20:52 -0400 Sender: Paolo Bonzini References: <1464097151-19479-1-git-send-email-pl@kamp.de> <5744601B.9040905@kamp.de> From: Paolo Bonzini Message-ID: <294ab4e7-4b88-875e-9fea-109298096d6f@redhat.com> Date: Tue, 24 May 2016 16:20:45 +0200 MIME-Version: 1.0 In-Reply-To: <5744601B.9040905@kamp.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block/io: optimize bdrv_co_pwritev for small requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-block@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com On 24/05/2016 16:07, Peter Lieven wrote: > > Oh, thanks, and the if block also too complicated. If I am right it should > collapse to: > > if (bytes < align) { > qemu_iovec_add(&local_qiov, head_buf + bytes, > align - bytes); > bytes = align; > } > > Right? Yes, that should work. But add a comment because it's much more mysterious than your v1 patch. :) Even just /* We have read the tail already if the request is smaller * than one aligned block. */ Thanks, Paolo