Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 2010 16:37:16 +0200
From:      Andriy Gapon <avg@freebsd.org>
To:        Lev Serebryakov <lev@serebryakov.spb.ru>
Cc:        freebsd-geom@freebsd.org
Subject:   Re: struct bio: mark as complete, but keep data buffer (and protect it from freeing/using)?
Message-ID:  <4D023B1C.3070707@freebsd.org>
In-Reply-To: <166474821.20101209220023@serebryakov.spb.ru>
References:  <166474821.20101209220023@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D023B1C.3070707>