(Illustration by Gaich Muramatsu)
Hi,
I just got coda working on Solaris 7 on the i386 platform. In doing that I discovered an interesting can of worms .... and would like to visit the topic.
Here is what is happening:
NetBSD/FreeBSD -> just use the OSes VOP_READDIR code to do the job. Solaris/sparc -> just happens to have the structure on disk as written by venus be the local format and uses VOP_READDIR to read. (BSD format has one extra field but type sizes make the entries have the same size.) Linux -> has a incompatible format due to field types and an extra field in the BSD format and must convert the on-disk format to the correct format for the readdir call. Solaris/x86 -> Due to being little endian, the disk layout does not look like the native OS format. To do this without any changes to venus would require a similar thing to Linux. (two bytes are swapped from the correct format.) c) All of these have very similar directory entry structures. With the exception of the d_type field, they all have the same fields in the same order, but the types vary for some of the fields. long vs short vs char ....
d) I got Solaris/x86 working by:
What do you think?
Should venus convert to Linux version dirent also? From my reading code in NetBSD libc, it looks like the only common format is from the readdir libc code and that does a final conversion from the local OS dirent to the final format. Why should we force yet another conversion from BSD -> local OS format?
-- Phil Nelson NetBSD: http://www.netbsd.org e-mail: phil@cs.wwu.edu Coda: http://www.coda.cs.cmu.edu http://www.cs.wwu.edu/~philReceived on 2000-02-02 14:36:18