shmem_file_setup(9)
π shmem_file_setup β ok bestie, let's get you an unlinked file that lives in tmpfs π
So this is a Kernel API Manual page, bestie, and it's all about shmem_file_setup β literally the function that gets you an unlinked file living in tmpfs. No cap. β¨
πΈ NAME πΈ
shmem_file_setup β get an unlinked file living in tmpfs π«Ά
π¦ SYNOPSIS π¦
Here's the vibe check, character for character:
struct file * shmem_file_setup (const char *name , loff_t size ,
vma_flags_t flags );
π ARGUMENTS π
Okay so these are the three things you gotta hand over, and each one has main character energy:
nameβ this is the name for the dentry, and yes it's lowkey famous because it's the thing you'll see chilling in/proc/<pid>/mapsπsizeβ the size you want set for the file. That's it, that's the whole job πflagsβ the flag zone π and specifically:VMA_NORESERVE_BITsuppresses pre-accounting of the entire object size. Fr fr, that's what it does.
π₯ SEE ALSO π₯
Go off, read the related lore, iykyk:
Kernel file ./mm/shmem.c and honestly the whole friend group: shmem_recalc_inode(9), shmem_writeout(9), shmem_get_folio(9), shmem_kernel_file_setup(9), shmem_file_setup_with_mnt(9), shmem_zero_setup(9), shmem_zero_setup_desc(9), shmem_read_folio_gfp(9) β
And that's the page, bestie π this absolute icon comes to you from ./mm and it's dated October 2026 β periodt, go slay your tmpfs setup ππ
π¦ 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