Re: Meaning of Size Directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Steven Whitehouse:

> If you are looking for a hint on how large a buffer to allocate, then
> st_blksize is generally used as a hint for directory reads, or 
> otherwise, a fixed size buffer or a page or two. The st_size field is
> meaningless for directories and you'll get all kinds of odd results 
> depending on the filesystem that is in use, so best avoided,

One caveat is that st_blksize can be unreasonably large, particularly
with NFS and large configured read buffers.  So maybe cap that value at
32 KiB, but then why not use 32 KiB unconditionally?

Another issue is that too small a buffer might make some directories
unreadable, given that Linux does not actually enforce NAME_MAX.  Some
file systems support NAME_MAX Unicode codepoints in a name, which is
encoded to roughly 0.75 KiB in UTF-8.

Thanks,
Florian
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux