lkml.org 
[lkml]   [2015]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] debugfs: update commits of debugfs_remove
Date
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@huawei.com>
---
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


\
 
 \ /
  Last update: 2015-10-14 05:21    [W:0.040 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site