debugfs_lookup(9)
π debugfs_lookup β the Kernel API Manual, but make it cute
okay so bestie, you're poking around in debugfs and you need to find a file that already exists in there. That's literally what debugfs_lookup is for and it's giving "main character energy" for real. This page lives in the kernel API manual (debugfs_lookup(9)) and it's short, sweet, and slays. π
β¨ SYNOPSIS β¨
struct dentry * debugfs_lookup (const char *name , struct dentry *parent
);
yes the formatting is a little chaotic, no cap, but that's the signature and you should copy it exactly π«Ά
π ARGUMENTS π
nameβ a pointer to a string holding the name of the file you wanna look up. that's it, that's the vibe.parentβ a pointer to the parent dentry of the file. so like, where it lives. its home. its nest. πͺΊ
π¦ DESCRIPTION π¦
so here's the tea, bestie:
This function will return a pointer to a dentry if it succeeds. Slay. π
If the file doesn't exist or an error occurs, NULL will be returned. Not slay, but like, that's the deal.
β οΈ important, do not skip this: the returned dentry must be passed to dput when it is no longer needed. Like, please. Don't leave him hanging. Clean up after yourself. The kernel is watching. π
And if debugfs is not enabled in the kernel, the value -ENODEV will be returned. So if you get that, it's not you, it's the kernel config. π
πΈ SEE ALSO πΈ
Kernel file ./fs/debugfs/inode.c and honestly the whole friend group:
debugfs_create_file_unsafe(9)debugfs_create_file_size(9)debugfs_create_dir(9)debugfs_create_automount(9)debugfs_create_symlink(9)debugfs_remove(9)debugfs_lookup_and_remove(9)debugfs_change_name(9)debugfs_initialized(9)
iykyk. go read them. they're all hanging out in ./fs/debugfs, October 2026 edition, supervised under the debugfs_lookup(9) header. π§β¨
okay bye bestie, go dput that dentry. periodt. πππ
sign-off: this page is from ./fs/debugfs, dated October 2026, and it's the debugfs_lookup(9) page of the Kernel API Manual. 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