debugfs_remove(9)
π 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 isNULLor 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
- Kernel file
./fs/debugfs/inode.cdebugfs_lookup(9) debugfs_create_file_unsafe(9)debugfs_create_file_size(9)debugfs_create_dir(9)debugfs_create_automount(9)debugfs_create_symlink(9)debugfs_lookup_and_remove(9)debugfs_change_name(9)debugfs_initialized(9)
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
- 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