struct buf * and journaled-UFS help

David E. Cross crossd at
Wed Mar 3 13:38:54 PST 2004

As some are aware I have been working with a computer science graduate
student to bring jounralling to the UFS(2) filesystem.  Right now we
have it so that operations are journaled to an in-core memory structure
(comprised of BLKSIZE * number amount of memory, which is obtained by
malloc(9)).  When this in-core journal gets full we need to flush it to
disk.  Previously we had used VOP_WRITE() for this, but it was
suggested, and I agree that we should use either VOP_STRATEGY or
brwite/bread for our IO work.  Both of these require a "struct buf" to
do their work.  What is the appropriate way to get such a structure?  I
have seen gbincore() used in similar cases, but it seems that
gbincore(), like many of the other buf(9) routines are for getting an
already allocated struct buf from the system pool; for example gbincore
checks that the lblkno of what is requested is the name as the block
already allocated in either the clean or dirty block trees.

David E. Cross

More information about the freebsd-fs mailing list