On Oct 31, 2005, at 2:42 PM, Brian Bergstrand wrote: 2) The file system I'm implementing doesn't always align its file data to block boundaries - for most cases I can simply call buf_strategy from my vnode's strategy routine - what should I be doing for unaligned data?
Thanks,
When you need to change unaligned data on disk, grab the block surrounding the unaligned data, make your change and write the whole block buffer out. Or does your unaligned data cross block boundaries?
Well - no, it doesn't cross block boundaries, but I guess what I'm really looking for is some discussion of what a vnode's strategy routine is supposed to do. It's not like apple's documentation helps :-)
In "File System KPI Porting Experiences", it says:
VNOP_STRATEGY
If your file system's file data is aligned to device blocks, your vnop_strategy implementation can be reduced to calling buf_strategy. Buf_strategy handles files that have been memory mapped, and does all of the work to set up and call the device to do the actual I/O.
What it doesn't say is what to do for files which are not block aligned.
In the end, I'm looking to support memory mapping of files which are not block aligned, and need to know what that involves.
Thanks,
Ron Aldrich Software Architects, Inc.
|