History

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 a3d1e7eb5abe ("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.

Timur Tabi committed 1 year ago

Commit e99efa81 parent 0e4965c2 files · +7 −14Browse files

Unified · Split

2 files
  1. Documentation/filesystems/debugfs.rst +6 −13
  2. Documentation/process/debugging/driver_development_debugging_guide.rst +1 −1
Documentation/filesystems/debugfs.rst+6−13
@@ -229,22 +229,15 @@ module is unloaded without explicitly removing debugfs entries, the result · 228 unmodified lines
229will be a lot of stale pointers and no end of highly antisocial behavior.229will be a lot of stale pointers and no end of highly antisocial behavior.
230So all debugfs users - at least those which can be built as modules - must230So all debugfs users - at least those which can be built as modules - must
231be prepared to remove all files and directories they create there. A file231be prepared to remove all files and directories they create there. A file
232can be removed with::232or directory can be removed with::
233 233
234 void debugfs_remove(struct dentry *dentry);234 void debugfs_remove(struct dentry *dentry);
235 235
236The dentry value can be NULL or an error value, in which case nothing will236The dentry value can be NULL or an error value, in which case nothing will
237be removed.237be removed. Note that this function will recursively remove all files and
238 238directories underneath it. Previously, debugfs_remove_recursive() was used
239Once upon a time, debugfs users were required to remember the dentry239to perform that task, but this function is now just an alias to
240pointer for every debugfs file they created so that all files could be240debugfs_remove(). debugfs_remove_recursive() should be considered
241cleaned up. We live in more civilized times now, though, and debugfs users241deprecated.
242can call::
243
244 void debugfs_remove_recursive(struct dentry *dentry);
245
246If this function is passed a pointer for the dentry corresponding to the
247top-level directory, the entire hierarchy below that directory will be
248removed.
249 242
250.. [1] http://lwn.net/Articles/309298/243.. [1] http://lwn.net/Articles/309298/
Documentation/process/debugging/driver_development_debugging_guide.rst+1−1
@@ -155,7 +155,7 @@ The general idea is: · 154 unmodified lines
155 ``my_variable``155 ``my_variable``
156 156
157- Clean up the directory when removing the device157- Clean up the directory when removing the device
158 (``debugfs_remove_recursive(parent);``)158 (``debugfs_remove(parent);``)
159 159
160For the full documentation see :doc:`/filesystems/debugfs`.160For the full documentation see :doc:`/filesystems/debugfs`.
161 161

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t