debugfs_create_symlink(9)
π debugfs_create_symlink β bestie, let's make a symlink in debugfs β¨
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 isNULL? 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 π₯
- Kernel file
./fs/debugfs/inode.c debugfs_lookup(9)debugfs_create_file_unsafe(9)debugfs_create_file_size(9)debugfs_create_dir(9)debugfs_create_automount(9)debugfs_remove(9)debugfs_lookup_and_remove(9)debugfs_change_name(9)debugfs_initialized(9)
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
- 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