debugfs_create_symlink(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so real talk, this is debugfs_create_symlink(9) from the Kernel API Manual and it's literally your go-to for dropping a symbolic link into debugfs. no cap. πŸŽ€


✨ SYNOPSIS ✨

struct dentry * debugfs_create_symlink (const char *name , struct dentry
*parent , const char *target );

three args, one dentry pointer back. she's lowkey simple, highkey essential 🫢


🌸 ARGUMENTS 🌸

  • name β€” a pointer to a string holding the name of the symbolic link you're creating. like, what are we calling this thing, bestie? πŸ’–
  • parent β€” a pointer to the parent dentry for this symbolic link. this should be a directory dentry if you set it. and if this parameter is NULL? then the symbolic link gets created in the root of the debugfs filesystem. iconic default behaviour, honestly πŸ‘‘
  • target β€” a pointer to a string containing the path to the target of the symbolic link. i.e. where the link actually points. the destination. the main character it's vibing toward πŸ¦‹

πŸ’€ DESCRIPTION πŸ’€

this function creates a symbolic link with the given name in debugfs that links to the given target path. simple as that, fr fr.

now listen carefully because this part matters πŸ™ˆ β€” this function will return a pointer to a dentry if it succeeds. and that pointer must be passed to the debugfs_remove function when the symbolic link is to be removed. and no, there is no automatic cleanup if your module is unloaded β€” you are responsible here. that's on you, bestie. the kernel is not gonna pick up after you πŸ’…

if an error occurs, ERR_PTR(-ERROR) will be returned. classic error-pointer situation, watch for it ⭐

and one more: if debugfs is not enabled in the kernel, the value -ENODEV will be returned. so if you're getting -ENODEV, that's your vibe check telling you debugfs isn't even in the building 😭


πŸ”₯ SEE ALSO πŸ”₯

go read the whole squad, they all ate πŸ’–βœ¨


and that's the whole page, bestie β€” no notes, periodt. 🌈 this came out of ./fs/debugfs, dated October 2026, and she's filed under debugfs_create_symlink(9). mwah πŸ’‹ πŸŽ€

πŸ“¦ where this page comes from