On Wed, Aug 13, 2008 at 04:36:59PM -0700, Daniel Phillips wrote: > > Many years ago we had a discussion about whether or not the . and .. > directory entries had to be physically present in htree, and I remember > the conclusion was that they had to be, but I forget the argument and > lost track of the email thread. I think the VFS will happily supply > the . and .. entries to getdents on its own. So what was the issue? > Something about telldir? . and .. are needed for backwards compatibility. If you aren't going to do backwards compatibility, then you might as well not bother putting the btree in the directory nodes. Just use physically block numbers directly. The other reason why '..' is useful is that it helps to knit the fliesystem back together in case of corruption. (For example, e2fsck uses the '..' so we can display full pathnames which is very helpful to system administrators.) The '.' pointer is slightly less useful, but it is helpful as an additional sanity check. If I were doing things all over in a completely incompatible way, I'd probably put at the beginning of the first directory block (a) a magic number, (b) the current inode number (as a sanity check), (c) the parent inode number (i.e., '..'), and (d) a pointer to a physical block which is the root of the index tree. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html