Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Anton Altaparmakov <email@hidden>
- Date: Tue, 1 Nov 2005 22:02:44 +0000 (GMT)
On Tue, 1 Nov 2005, Ron Aldrich wrote:
> 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.
Read buf_strategy() in the xnu source and the functions it calls and
that's what you have to do. (-;
Or for something very simple look at the ntfs driver for example which
needs to do it, too (ntfs_strategy()).
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >(no subject) (From: Ron Aldrich <email@hidden>) |