Messages in this thread Patch in this message | | | From | Tan Xiaojun <> | Subject | [PATCH] debugfs: update commits of debugfs_remove | Date | Wed, 14 Oct 2015 10:53:57 +0800 |
| |
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
| |