Hello,
I am working on a defrag tool for UFS2/FFSv2 as Google Summer of Code
Project.
The size of a directory offset is of type int32_t (see
src/sys/ufs/ufs/dir.h), which is a signed integer. So the maximum size
can be (2^31)-1.
When testing, the maximum number of subdirectories was 32767, which is
(2^15)-1, when trying to add a 32767th directory, I got the error
message: "Too many links".
When my tools reads only the single indirect blocks, it get all 32767
subdirectories.
In some Oracle documentation[1] of UFS2 says, this is the defined
maximum of subdirectories. But this is another implementation.
When studying the sourcecode of dump(8), I found out that in traverse.c
there is a function dirindir(), which iterates recursively through all
indirect blocks of directories, even through triple indirect blocks.
My question is:
Is the number of subdirectories really limited by (2^15)-1?