debugfs_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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