Subject: Re: RFC: addition of B_MANAGED and B_NESTED to buf.h and vfs_bio.c
To: Jason Thorpe <thorpej@shagadelic.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 01/04/2006 14:15:54
--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Dear Jason,

On Tue, Jan 03, 2006 at 09:14:45PM -0800, Jason Thorpe 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.

All file data in UDF is indeed managed by UBC and thats ok with me. This 
patch has nothing to do with my UDF implementation though it could use 
such functionality.

Also in the example i'm refering to descriptors (inodes) and other meta 
information that is read in from the disc. Its part of the vnode's v_data. 
Such information could be stored in buffers with a B_LOCKED but that would 
be abusing the bio cache.

> >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?

For its for metadata only like file allocation lists etc? that is not part 
of directory contents and not part of file data. See my explanation on the 
example above.

With regards,
Reinoud

--2fHTh5uZTiUOsy+g
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQ7vKgYKcNwBDyKpoAQJ0SAf9HqpbXuizHOqvPLxtFopjaLYtkp5GKyvu
RHj/m63Eql67gdprUXTa8lD5i5O+562s6JEtp6JgvW++Eq71pt2BtCBcRAy217Ml
3vH6RPrykE6CS2zjkhLJynYYxZLjUtN5oQ9oFXW21MtOVyv0rwyCDKQSJpxrgkf5
8jEsS/qUwpIHlIvHlsu8kbbCexLOcLCnXnA29i3A7lK5D9po4AlKtpH5bJml0ZYu
aW1hFCZw8bVDisktldrxK5qo5JUApk5tJHmBN7CRZFvM0CjVlm6ljJmneADvf5JB
B38zweGedTTV+A231ZvrIHiYJFkf22i66P4+AgvqI+GNKHbhvUgQew==
=j0Cs
-----END PGP SIGNATURE-----

--2fHTh5uZTiUOsy+g--