struct bio: mark as complete, but keep data buffer (and protect it from freeing/using)?

Andriy Gapon avg at freebsd.org
Fri Dec 10 14:37:23 UTC 2010


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


More information about the freebsd-geom mailing list