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
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+1−1
@@ -155,7 +155,7 @@ The general idea is: · 154 unmodified lines
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

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