debugfs: update commits of debugfs_remove
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.
Signed-off-by Tan Xiaojun <[email protected]>
--- fs/debugfs/inode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/debugfs/inode.c +5 -1
@@ -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
Please ignore this patch, I make a spelling mistake.
Quoted 34 lines · Tan Xiaojun
This function
debugfs_removecan'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 <[email protected]>--- fs/debugfs/inode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)fs/debugfs/inode.c +5
-1@@ -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) {