HFS+ support (read-only)
I've just uploaded a new release of my hfsplus module. If anyone would like to try it out, or critique my code, you can find it on Sourceforge (I am currently using 2.4.18-pre7 as a base):
http://www.sourceforge.net/projects/linux-hfsplus/
This is still read-only, and no resource forks in any format, but it can handle most standard UNIX features other than hard links, which will show up as empty files. (Don't ask...)
I haven't had any stability problems, but the performance is somewhat slow on a disk with a large number of files.
I appreciate any feedback or suggestions.
Brad Boyer
[email protected]
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines · Brad Boyer
but it can handle most standard UNIX features other than hard links, which will show up as empty files. (Don't ask...)
in case anyone is curious the reason for this is because HFS+ has no support whatsoever for hard links. Apple kludged around this by making OSX create a MacOS alias pointing to an inode number (or similar) this macos alias has a special magic id to it so OSX knows to pretend its a hard link instead of a regular file like it really is. MacOS aliases are of course stored entirly in the resource fork, which this implementation has no support for, thus hard link -> empty file.
Signature · 2 lines
Ethan Benson http://www.alaska.net/~erbenson/
Quoted 11 lines · Ethan Benson
Quoted 2 lines · Brad Boyer
but it can handle most standard UNIX features other than hard links, which will show up as empty files. (Don't ask...)
in case anyone is curious the reason for this is because HFS+ has no support whatsoever for hard links. Apple kludged around this by making OSX create a MacOS alias pointing to an inode number (or similar) this macos alias has a special magic id to it so OSX knows to pretend its a hard link instead of a regular file like it really is. MacOS aliases are of course stored entirly in the resource fork, which this implementation has no support for, thus hard link -> empty file.
I thought there was also a special file (completely hidden from userland in X) which tracks all the hard links in the FS. I'm pretty sure something like that is necessary to truly implement hard link semantics. Consider what happens when a file with hardlinks gets unlink()ed -- then all its hardlinks point at nothing. The OS needs a database of all files that are hardlinked, with full reverse mappings, so that whenever a file with hardlinks is unlinked it has enough information to replace one of the hardlinks with the real file.
(For efficiency I'd want a flag bit in the metadata of each file to indicate that it has been hardlinked, to avoid searching the table when deleting files that have no hardlinks. For even more efficiency, a direct pointer to the table entry.)
Signature · 1 line
Tim Seufert
Quoted 8 lines · Timothy A. Seufert
I thought there was also a special file (completely hidden from userland in X) which tracks all the hard links in the FS. I'm pretty sure something like that is necessary to truly implement hard link semantics. Consider what happens when a file with hardlinks gets unlink()ed -- then all its hardlinks point at nothing. The OS needs a database of all files that are hardlinked, with full reverse mappings, so that whenever a file with hardlinks is unlinked it has enough information to replace one of the hardlinks with the real file.
i don't know about that, maybe. to be honest it would not surprise me if apple just let that break.
Quoted 4 lines
(For efficiency I'd want a flag bit in the metadata of each file to indicate that it has been hardlinked, to avoid searching the table when deleting files that have no hardlinks. For even more efficiency, a direct pointer to the table entry.)
you cannot use the word efficient to describe this puke inducing kludge. the efficient way is to design the filesystem properly to begin with, which apple did not do with HFS+.
Signature · 2 lines
Ethan Benson http://www.alaska.net/~erbenson/
Quoted 8 lines · Ethan Benson
Quoted 4 lines · Timothy A. Seufert
The OS needs
a database of all files that are hardlinked, with full reverse mappings, so that whenever a file with hardlinks is unlinked it has enough information to replace one of the hardlinks with the real file.i don't know about that, maybe. to be honest it would not surprise me if apple just let that break.
Oh, come on. :) I just tested it, they didn't let it break.
Quoted 8 lines
Quoted 4 lines
(For efficiency I'd want a flag bit in the metadata of each file to indicate that it has been hardlinked, to avoid searching the table when deleting files that have no hardlinks. For even more efficiency, a direct pointer to the table entry.)
you cannot use the word efficient to describe this puke inducing kludge. the efficient way is to design the filesystem properly to begin with, which apple did not do with HFS+.
The kludge part is trying to retrofit features like hardlinks into a FS which wasn't designed to naturally support them (as classic UNIX inode FS designs do). Aside from that I see nothing wrong with the basic design of HFS+.
Signature · 1 line
Tim Seufert
Quoted 8 lines · Ethan Benson
Quoted 4 lines · Timothy A. Seufert
The OS needs
a database of all files that are hardlinked, with full reverse mappings, so that whenever a file with hardlinks is unlinked it has enough information to replace one of the hardlinks with the real file.i don't know about that, maybe. to be honest it would not surprise me if apple just let that break.
Oh, come on. :) I just tested it, they didn't let it break.
Quoted 8 lines
Quoted 4 lines
(For efficiency I'd want a flag bit in the metadata of each file to indicate that it has been hardlinked, to avoid searching the table when deleting files that have no hardlinks. For even more efficiency, a direct pointer to the table entry.)
you cannot use the word efficient to describe this puke inducing kludge. the efficient way is to design the filesystem properly to begin with, which apple did not do with HFS+.
The kludge part is trying to retrofit features like hardlinks into a FS which wasn't designed to naturally support them (as classic UNIX inode FS designs do). Aside from that I see nothing wrong with the basic design of HFS+.
--
Tim Seufert
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/