Subject: Adding B_WRITETHRU -- file system question
To: None <>
From: Jason R Thorpe <>
List: tech-kern
Date: 12/03/2001 14:23:13
Warping back to a conversation I had here some time ago...

I want to add a flag to struct buf which indicates that an I/O
transaction is to be done in a "cache write-through" manner.

This is pretty easy to accomplish, for SCSI at least... Set the
Force Unit Access bit when you see B_WRITETHRU, and then clear
B_WRITETHRU when the transfer is finished.

The real question is where to use it.  The intended use here is to
make sure file system metadata really bloody well makes it out to
the disk.

So, at first glance, this appears to be pretty much anywhere that bwrite(),
bdwrite(), or bawrite() are used within a file system (since in the UBC
world, only metadata uses those interfaces).

In order to set this flag safely, I think the best way would be to add
"flags" argument to each of those functions (and to VOP_BWRITE()), which
would be or'd into bp->b_flags when it is safe (i.e. "when at splbio()").


        -- Jason R. Thorpe <>