[PATCH] debugfs: update commits of debugfs_remove

From: Tan Xiaojun
Date: Tue Oct 13 2015 - 22:48:03 EST


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.

Signed-off-by: Tan Xiaojun <tanxiaojun@xxxxxxxxxx>
---
fs/debugfs/inode.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index c711be8..350754e 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -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)
{
--
2.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/