Subject: Re: RFC: addition of B_MANAGED and B_NESTED to buf.h and vfs_bio.c
To: Reinoud Zandijk <reinoud@netbsd.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 01/03/2006 21:14:45
On Jan 3, 2006, at 1:40 PM, Reinoud Zandijk wrote:

> B_EXTERN? why named extern? FreeBSD uses the term B_MANAGED too for  
> this
> kind of buffers and since its a `managed' buffer by some other  
> party and
> not a part of the normal queues. The name B_EXTERN doesn't ring a  
> bell with
> me really.

Why are you using the bio cache at all??  File data in UDF should be  
managed by UBC.

> Say a filingsystem has a malloc'd space in wich it keeps for  
> example a FAT
> or some other filing system structure. The only thing to write it  
> out in
> one go is then:
>
> 	buf = getmanagedbuf(xxx->yyyloc, structp, structlen);
> 	buf->b_flags |= B_WRITE;
> 	VOP_STRATEGY(vp, buf)
> 	brelse(buf);
>
> Otherwise it would need either a custom made callback system with a  
> custom
> created buffer and a custom cleanup afterwards in the callback or  
> create a
> buffer and copy stuff in. Reduces complexity a lot for such  
> situations.

Why would you do that at all?  Why not just use getbuf() or bread()  
or whatever?

-- thorpej