Jamie Lokier wrote:
> 
> Ben Fennema wrote:
> > Well, theres a few other pain in the butt things to consider.
> > One, I have to keep track of the file sizes of all the files in the streams
> > directory (there is a record of the total size of the main file + all
> > streams) I guess I'd need a link from the stream file to the main file,
> > so when the stream file gets written out and the size differs from the
> > on-disc size, I adjust the main file total size. Sounds like race city :)
> 
> Oh I see, these aren't "forks" like on a Mac, they're "streams" like the
> ones not used on NTFS.

Well, they include:
*UDF Macintosh Resource Fork
*UDF OS/2 EA
*UDF NT ACL
*UDF UNIX ACL

I think the original idea was like NTFS, but their being used to store
things like macintosh forks and ACL's and such.

I think I'll just drop any thoughts of doing anything with the streams
for now, but I do have to handle deleting a file w/ streams dir + files.

I assume I need to decrease the link count by 1 if a stream exists in the
file on read_inode, so that delete_inode when be called when the file
gets deleted.

Then in delete_inode, I can either:
  go through the stream directory, totally ignoring the dcache. For each
  file in stream directory, manually determine the blocks it occupies, then
  free those blocks. Finally free all the blocks occupied by stream
  directory.

  This seems like a ton of redundant codeing :)

or:
  iget the stream directory, iterate through the
  directory, iget-ing each stream file, setting the link count to 0, and
  iput-ing it. Finally, setting the link count of the directory to 0 and
  iput-ing it.

  What kind of races are involved in the second. I don't have to worry
  about delete_inode being called on the same inode while I am doing this,
  correct? And since the stream directory isn't link into the filesystem
  anywhere I wouldn't have to worry about anyone else accessing any of
  my dummy inodes... Or am I missing something?

Ben

-- 
Linux UDF - http://www.trylinux.com/projects/udf/index.html
Latest Is - udf-0.9.1 (http://www.csc.calpoly.edu/~bfennema/udf.html)

Reply via email to