shmem_file_setup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ 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_BIT suppresses 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