Hi,
ext2fs and ufs both take great care to avoid messing up the file pager
writes with the disk pager writes. Something similar has to be done about
the FAT fs, but I am unsure about the best approach. While ext2fs and ufs
only need to seperate disk writes of metadata from fiel writes, FAT mixes it
all up again (and writing inode data actually is a file write).
FAT is divided in a meta data area at the beginning of the fs, and a file
area (including directories) following it. I use file pagers for the
directories to parse the directory entries, as ext2fs. However, as all node
information is stored in directory records, write_node wants to scribble in
the file pagers area for this directory. I can think of several solutions:
1) Not handling directories through file pagers at all, but use the disk
pager (as is done in isofs and fatfs 0.1). This obviously avoids the
problem and might be the simplest solution. One would hope for a better
solution, as directories are really much like files (and using the file
pager is very handy).
2) Not writing to directory records through the disk pager at all (clipping
the disk pager to the meta data area). This requires to use the directory
file pager in write_node, for example by using diskfs_node_rdwr. Is this
acceptable performance wise? This solution would require me to make the
directory's node and record offset accesible to the file node, which has all
sort of nasty problems attached to it, although it is not much worse than
the current problem of making the directory record offset within disk image
accesible to the file node.
3) Serializing disk pager writes to the file area and file pager writes for
directory nodes (in short: all file pager writes). Sounds like the "let's
chop the arm off" solution with worst impact on performance. Would this
actually work (will the pager take notice of modified disk pages in the file
pager?)
Note that although 2) looks slightly more complicated, the additional
complication of storing the diretory in which the file resides is needed
for directories anyway: Every directory needs to be able to get the parent
directories inode (for "cd .."). So, I'd prefer to keep the file pagers for
directories.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server
Marcus Brinkmann GNU http://www.gnu.org for public PGP Key
[EMAIL PROTECTED], [EMAIL PROTECTED] PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ [EMAIL PROTECTED]