Skip to content

Commit e99efa8

Browse files
ttabigregkh
authored andcommitted
docs: debugfs: do not recommend debugfs_remove_recursive
Update the debugfs documentation to indicate that debugfs_remove() should be used to clean up debugfs entries. In commit a3d1e7e ("simple_recursive_removal(): kernel-side rm -rf for ramfs-style filesystems"), function debugfs_remove_recursive() was made into an alias for debugfs_remove(): #define debugfs_remove_recursive debugfs_remove Therefore, drivers should just use debugfs_remove() going forward. Signed-off-by: Timur Tabi <ttabi@nvidia.com> Link: https://lore.kernel.org/r/20250429173958.3973958-1-ttabi@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0e4965c commit e99efa8

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

Documentation/filesystems/debugfs.rst

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,22 +229,15 @@ module is unloaded without explicitly removing debugfs entries, the result
229229
will be a lot of stale pointers and no end of highly antisocial behavior.
230230
So all debugfs users - at least those which can be built as modules - must
231231
be prepared to remove all files and directories they create there. A file
232-
can be removed with::
232+
or directory can be removed with::
233233

234234
void debugfs_remove(struct dentry *dentry);
235235

236236
The dentry value can be NULL or an error value, in which case nothing will
237-
be removed.
238-
239-
Once upon a time, debugfs users were required to remember the dentry
240-
pointer for every debugfs file they created so that all files could be
241-
cleaned up. We live in more civilized times now, though, and debugfs users
242-
can call::
243-
244-
void debugfs_remove_recursive(struct dentry *dentry);
245-
246-
If this function is passed a pointer for the dentry corresponding to the
247-
top-level directory, the entire hierarchy below that directory will be
248-
removed.
237+
be removed. Note that this function will recursively remove all files and
238+
directories underneath it. Previously, debugfs_remove_recursive() was used
239+
to perform that task, but this function is now just an alias to
240+
debugfs_remove(). debugfs_remove_recursive() should be considered
241+
deprecated.
249242

250243
.. [1] http://lwn.net/Articles/309298/

Documentation/process/debugging/driver_development_debugging_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ The general idea is:
155155
``my_variable``
156156

157157
- Clean up the directory when removing the device
158-
(``debugfs_remove_recursive(parent);``)
158+
(``debugfs_remove(parent);``)
159159

160160
For the full documentation see :doc:`/filesystems/debugfs`.
161161

0 commit comments

Comments
 (0)