NILFS_MAX_VOLUME_NAME(9)
π NILFS_MAX_VOLUME_NAME(9) β a little kernel-API moment, from the Kernel API Manual β¨
okay so bestie, come sit with me, because today's main character is a macro and honestly? she's iconic in the most lowkey way π
πΈ NAME πΈ
NILFS_MAX_VOLUME_NAME β the maximum number of characters (bytes) that can fit in a file system volume name π¦
β¨ SYNOPSIS β¨
NILFS_MAX_VOLUME_NAME
that's it. that's the whole vibe. no args, no drama, just a constant living her life π
π DESCRIPTION π
so where does this number even come from? it's defined by the size of the volume name field in the on-disk superblocks β aka the actual space reserved on disk, no cap π
and here's the part you cannot skip, bestie: this volume name does not include the terminating NULL byte if the string length matches the field size. read that again. the NULL is not included when the string is exactly as long as the field. rude? maybe. true? absolutely π
so if you're building a buffer that actually needs a NULL byte termination, you gotta do the little +1 dance and use (NILFS_MAX_VOLUME_NAME + 1) as your buffer size. one extra byte, zero extra stress, periodt π
bestie warning fr fr: forget the +1 and your buffer's NULL terminator has nowhere to live. it's giving "undefined behavior at 3am" π
π SEE ALSO π
- Kernel file
./fs/nilfs2/nilfs.hstruct nilfs_inode_info(9),struct nilfs_transaction_info(9)β go look at the source, it's cute over there π«Ά
and that's the page, bestie! π this lil' gem comes from ./fs/nilfs2 and it's dated October 2026 β okay slay, see you in the next NILFS_MAX_VOLUME_NAME(9) moment β¨π¦πΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms