UFS files in a directory limit?

Peter Jeremy peterjeremy at acm.org
Wed Mar 24 06:30:28 UTC 2010


On 2010-Mar-24 06:53:22 +1100, Bruce Evans <brde at optusnet.com.au> wrote:
>On Sun, 21 Mar 2010, Kirk McKusick wrote:
>> The only limit on the size of a directory is the number of files that
>> you can have in the filesystem. There is a limit of 2^16 directories
>                                                       2^15-1
>> within a directory due to the limit on the number of hard links.

If we're going to be pedantic, it's 2^15-3 sub-directories: There's a
maximum of 2^15-1 hardlinks.  One is used for the directory's name in
its parent directory, one is used for the '.' entry in the directory
itself and one-per-sub-directory is needed for the '..' entry in each
sub-directory.

(And a single file could theoretically have up to 2^15-1 hardlinks
within a single directory - though this would not be particularly
sensible).

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20100324/6cd615c9/attachment.pgp


More information about the freebsd-fs mailing list