From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNU2z-0000Qe-3J for qemu-devel@nongnu.org; Fri, 20 May 2011 14:03:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNU2y-0006mD-Er for qemu-devel@nongnu.org; Fri, 20 May 2011 14:03:37 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:55328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNU2y-0006m1-9J for qemu-devel@nongnu.org; Fri, 20 May 2011 14:03:36 -0400 Received: by wyb42 with SMTP id 42so3326273wyb.4 for ; Fri, 20 May 2011 11:03:35 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4DD6ACF5.8040707@redhat.com> Date: Fri, 20 May 2011 20:03:33 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1305630067-2119-1-git-send-email-pbonzini@redhat.com> <1305630067-2119-6-git-send-email-pbonzini@redhat.com> <20110520155807.GE4466@lst.de> <4DD6A97B.6030702@redhat.com> In-Reply-To: <4DD6A97B.6030702@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 05/21] scsi: reference-count requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christoph Hellwig , qemu-devel@nongnu.org On 05/20/2011 07:48 PM, Paolo Bonzini wrote: >> Is there any reason to keep a free function? > > It's internal for SCSIDevice implementation, kind of a "base > implementation" for free_req > >> The pattern should be >> that people just call the function to decrement the reference count, >> and that frees the structure when it hits zero. In the current model >> that would mean moving the freeing out of ->free_req into scsi_req_unref, >> but that seems pretty sensible anyway. > > free_req is still needed, because it takes care of freeing the bounce > buffers or any other allocated data. Nevermind, I see what you mean. Will do. Paolo