Skip to contentSkip to conversation

debugfs: update commits of debugfs_remove

PATCH In review Tan Xiaojun 1 participant 2 messages Oct 14, 2015 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debugfs: update commits of debugfs_remove

This function debugfs_remove can't remove a directory if it is not empty. The commits make misunderstood and cause misuse easily, so update it.

---
 fs/debugfs/inode.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/debugfs/inode.c +5 -1
index c711be8..350754e 100644
@@ -531,7 +531,8 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
 }
 
 /**
- * debugfs_remove - removes a file or directory from the debugfs filesystem
+ * debugfs_remove - removes a file or an empty directory from the debugfs
+ *		    filesystem
  * @dentry: a pointer to a the dentry of the file or directory to be
  *          removed.
  *
@@ -542,6 +543,9 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
  * 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.
+ *
+ * For removing directory, if you are not sure it is empty or not, use
+ * debugfs_remove_recursive instead.
  */
 void debugfs_remove(struct dentry *dentry)
 {
Signature · 1 line
2.5.3
#1 lore raw

Please ignore this patch, I make a spelling mistake.

Quoted 34 lines · Tan Xiaojun

This function debugfs_remove can't remove a directory if it is not empty. The commits make misunderstood and cause misuse easily, so update it.

---
 fs/debugfs/inode.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
fs/debugfs/inode.c +5 -1
index c711be8..350754e 100644
@@ -531,7 +531,8 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
 }
 
 /**
- * debugfs_remove - removes a file or directory from the debugfs filesystem
+ * debugfs_remove - removes a file or an empty directory from the debugfs
+ *		    filesystem
  * @dentry: a pointer to a the dentry of the file or directory to be
  *          removed.
  *
@@ -542,6 +543,9 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
  * 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.
+ *
+ * For removing directory, if you are not sure it is empty or not, use
+ * debugfs_remove_recursive instead.
  */
 void debugfs_remove(struct dentry *dentry)
 {