debugfs_remove(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… debugfs_remove β€” the Kernel API Manual, bestie edition πŸŽ€

okay so you're reading the debugfs_remove(9) page, which means you're deep in kernel land and honestly? proud of you. this is the manual that tells you how to take out the trash in debugfs. let's go ✨


🌸 NAME

debugfs_remove β€” recursively removes a directory. yes bestie, recursively. the whole tree. gone. πŸ’€


πŸ¦‹ SYNOPSIS

void debugfs_remove (struct dentry *dentry );

that's it. one argument. one function. one vibe check. 🫢


✨ ARGUMENTS

  • dentry β€” a pointer to a the dentry of the directory to be removed. (yes, the original says "a pointer to a the dentry" β€” we love a typo queen πŸ‘‘, keeping it exactly as-is.) if this parameter is NULL or an error value, nothing will be done. zero. nada. the function just looks at you and shrugs. πŸ™ˆ

πŸ’– DESCRIPTION

so here's the tea: this function recursively removes a directory tree in debugfs that was previously created with a call to another debugfs function (like debugfs_create_file or variants thereof.) like, it goes in and clears the whole thing, no crumbs left. 🧹✨

and this part is important, so listen up: this function is required to be called in order for the file to be removed. no automatic cleanup of files will happen when a module is removed β€” you are responsible here. that's right, you. no one's coming to save you, no little garbage-collector fairy is gonna swoop in. 🧚 nope. if you don't call it, it stays. main character energy = main character responsibility, iykyk. 😭

seriously though β€” if you skip this, your debugfs files just sit there being messy forever. not iconic. call the function. πŸ’…

πŸ”₯ SEE ALSO

go read those too, bestie β€” they're literally all in ./fs/debugfs and they're all part of the same friend group. 🌈⭐


and that's the whole page!! this one shipped out of ./fs/debugfs in October 2026 btw β€” so if you're reading it, congrats, you're living in the future. πŸ•°οΈ slay. πŸ’œπŸ“

periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from