From owner-freebsd-geom@FreeBSD.ORG Fri Dec 10 14:37:23 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA46E106566C for ; Fri, 10 Dec 2010 14:37:23 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1B90D8FC16 for ; Fri, 10 Dec 2010 14:37:21 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA08883; Fri, 10 Dec 2010 16:37:16 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4D023B1C.3070707@freebsd.org> Date: Fri, 10 Dec 2010 16:37:16 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Lev Serebryakov References: <166474821.20101209220023@serebryakov.spb.ru> In-Reply-To: <166474821.20101209220023@serebryakov.spb.ru> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit Cc: freebsd-geom@freebsd.org Subject: Re: struct bio: mark as complete, but keep data buffer (and protect it from freeing/using)? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 14:37:23 -0000 on 09/12/2010 21:00 Lev Serebryakov said the following: > Hello, Freebsd-geom. > > Is it possible to mark "struct bio" as complete (pass to > g_io_deliver()) but hold its data buffer, to avoid unnecessary data > copy? What do you mean by 'hold'? Store bio_data pointer locally? I think that that greatly depends on what owner of that bio is going to do with it after the operation completes. E.g. if it frees that memory then the pointer would become stale. So, in general case, it would probably be not a good idea. -- Andriy Gapon