vfs_symlink(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, you've stumbled into the Kernel API Manual and we're talking about vfs_symlink(9) β€” the kernel-level glow-up that makes a symlink happen ✨ grab a strawberry drink, this one's actually not that deep πŸ“


🌸 NAME 🌸

vfs_symlink β€” literally just: create symlink πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int vfs_symlink (struct mnt_idmap *idmap , struct inode *dir , struct
dentry *dentry , const char *oldname , struct delegated_inode
*delegated_inode );

πŸŽ€ ARGUMENTS πŸŽ€

  • idmap β€” the idmap of the mount the inode was found from πŸ—ΊοΈ
  • dir β€” the inode of the parent directory (the mom of the situation, fr)
  • dentry β€” the dentry of the child symlink file πŸ‘Ά
  • oldname β€” the name of the file to link to. that's your target, the main character the symlink points at πŸ‘‘
  • delegated_inode β€” returns the victim inode, if the inode is delegated πŸ’€ yes, "victim" is the actual word, ngl that's giving dramatic

✨ DESCRIPTION ✨

Create a symlink. that's it. that's the whole vibe check. 🫢

but okay, here's the part where you actually gotta pay attention, so no scrolling past me:

If the inode has been found through an idmapped mount, the idmap of the vfsmount must be passed through idmap. This function will then take care to map the inode according to idmap before checking permissions πŸ‘€ like it handles the translation for you, very generous of it.

On non-idmapped mounts β€” or if permission checking is to be performed on the raw inode β€” simply pass nop_mnt_idmap. no cap, that's the move πŸ™Œ

bestie pls don't pass the wrong idmap. it's not giving "oopsie", it's giving "permission checking on the wrong inode" 😭

🌈 SEE ALSO 🌈

Kernel file ./fs/namei.c β€” and the whole friend group, in order, because we don't do partial lists here πŸ’–


okay that's the whole page, you ate that πŸ† this little gem lives in ./fs, October 2026, and yes β€” it's vfs_symlink(9), no notes, iconic behavior, periodt πŸ’œπŸ¦‹ mwah, go create some symlinks responsibly ✨

πŸ“¦ where this page comes from