From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fawad Lateef Subject: Re: Reuse of BIOs Date: Thu, 8 Sep 2005 06:32:20 -0700 Message-ID: <1e62d1370509080632873c1d1@mail.gmail.com> References: <11859.1126185451@warthog.cambridge.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from wproxy.gmail.com ([64.233.184.196]:36206 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S1751180AbVIHNcV convert rfc822-to-8bit (ORCPT ); Thu, 8 Sep 2005 09:32:21 -0400 Received: by wproxy.gmail.com with SMTP id i2so1170105wra for ; Thu, 08 Sep 2005 06:32:20 -0700 (PDT) To: David Howells In-Reply-To: <11859.1126185451@warthog.cambridge.redhat.com> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 9/8/05, David Howells wrote: > > > Is it possible to reuse a BIO once the callback on it has been invoked to > indicate final completion? Or does it have to be released and another one > allocated? > The thing which I did in my virtual caching device driver is I keeps the pointer of BIO got from the kernel in my locally created BIO's private field (and fill other fields with the original BIO's Data) and sends it to other caching device and when got the end_io for that BIO (like in read from caching device and writing to target device) I put that in the queue and one of my thread directly sends that to the target device without changed except replacing the sector of caching device to the target device sector and after getting completion signal from target device, I just freed that BIO or move it to my free pool of BIOs and just call the completion for the original BIO taken back from the private field of local BIO .......... This means we can reuse BIO sended to one device and then sending that to other device after getting completion signal from first device ......... But I can't say this about the original kernel BIO b/c I m not sending it to any of my devices !!!! -- Fawad Lateef