From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Taq6U-0002do-Hr for qemu-devel@nongnu.org; Tue, 20 Nov 2012 10:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Taq6N-0005dq-Es for qemu-devel@nongnu.org; Tue, 20 Nov 2012 10:51:14 -0500 Received: from mail-bk0-f45.google.com ([209.85.214.45]:49156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Taq6N-0005co-87 for qemu-devel@nongnu.org; Tue, 20 Nov 2012 10:51:07 -0500 Received: by mail-bk0-f45.google.com with SMTP id jk13so1473716bkc.4 for ; Tue, 20 Nov 2012 07:51:06 -0800 (PST) Date: Tue, 20 Nov 2012 16:51:03 +0100 From: Stefan Hajnoczi Message-ID: <20121120155103.GA5676@stefanha-thinkpad.redhat.com> References: <50AA4917.5000402@dlhnet.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50AA4917.5000402@dlhnet.de> Subject: Re: [Qemu-devel] [PATCH] iscsi: partly avoid iovec linearization in iscsi_aio_writev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, Paolo Bonzini , "qemu-devel@nongnu.org" , ronnie sahlberg On Mon, Nov 19, 2012 at 03:58:31PM +0100, Peter Lieven wrote: > libiscsi expects all write16 data in a linear buffer. If the > iovec only contains one buffer we can skip the linearization > step as well as the additional malloc/free and pass the > buffer directly. > > Reported-by: Ronnie Sahlberg > Signed-off-by: Peter Lieven > --- > block/iscsi.c | 24 +++++++++++++++--------- > 1 file changed, 15 insertions(+), 9 deletions(-) > > diff --git a/block/iscsi.c b/block/iscsi.c > index d0b1a10..f12148e 100644 > --- a/block/iscsi.c > +++ b/block/iscsi.c > @@ -199,8 +199,10 @@ iscsi_aio_write16_cb(struct iscsi_context *iscsi, int status, > trace_iscsi_aio_write16_cb(iscsi, status, acb, acb->canceled); > - g_free(acb->buf); > - > + if (acb->buf != NULL) { > + g_free(acb->buf); > + } > + g_free(NULL) is a nop, so this change isn't necessary. Poalo: Could be done when merging the patch? Reviewed-by: Stefan Hajnoczi