diff options
Diffstat (limited to 'fs/debugfs/inode.c')
-rw-r--r-- | fs/debugfs/inode.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 37a8ca7c1222..e7a7a2f07324 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
@@ -13,9 +13,6 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* uncomment to get debug messages from the debug filesystem, ah the irony. */ | ||
17 | /* #define DEBUG */ | ||
18 | |||
19 | #include <linux/module.h> | 16 | #include <linux/module.h> |
20 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
21 | #include <linux/mount.h> | 18 | #include <linux/mount.h> |
@@ -310,7 +307,7 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, | |||
310 | } | 307 | } |
311 | EXPORT_SYMBOL_GPL(debugfs_create_symlink); | 308 | EXPORT_SYMBOL_GPL(debugfs_create_symlink); |
312 | 309 | ||
313 | static void __debugfs_remove(struct dentry *dentry, struct dentry *parent) | 310 | static int __debugfs_remove(struct dentry *dentry, struct dentry *parent) |
314 | { | 311 | { |
315 | int ret = 0; | 312 | int ret = 0; |
316 | 313 | ||
@@ -333,6 +330,7 @@ static void __debugfs_remove(struct dentry *dentry, struct dentry *parent) | |||
333 | dput(dentry); | 330 | dput(dentry); |
334 | } | 331 | } |
335 | } | 332 | } |
333 | return ret; | ||
336 | } | 334 | } |
337 | 335 | ||
338 | /** | 336 | /** |
@@ -351,7 +349,8 @@ static void __debugfs_remove(struct dentry *dentry, struct dentry *parent) | |||
351 | void debugfs_remove(struct dentry *dentry) | 349 | void debugfs_remove(struct dentry *dentry) |
352 | { | 350 | { |
353 | struct dentry *parent; | 351 | struct dentry *parent; |
354 | 352 | int ret; | |
353 | |||
355 | if (!dentry) | 354 | if (!dentry) |
356 | return; | 355 | return; |
357 | 356 | ||
@@ -360,9 +359,10 @@ void debugfs_remove(struct dentry *dentry) | |||
360 | return; | 359 | return; |
361 | 360 | ||
362 | mutex_lock(&parent->d_inode->i_mutex); | 361 | mutex_lock(&parent->d_inode->i_mutex); |
363 | __debugfs_remove(dentry, parent); | 362 | ret = __debugfs_remove(dentry, parent); |
364 | mutex_unlock(&parent->d_inode->i_mutex); | 363 | mutex_unlock(&parent->d_inode->i_mutex); |
365 | simple_release_fs(&debugfs_mount, &debugfs_mount_count); | 364 | if (!ret) |
365 | simple_release_fs(&debugfs_mount, &debugfs_mount_count); | ||
366 | } | 366 | } |
367 | EXPORT_SYMBOL_GPL(debugfs_remove); | 367 | EXPORT_SYMBOL_GPL(debugfs_remove); |
368 | 368 | ||
@@ -540,17 +540,5 @@ static int __init debugfs_init(void) | |||
540 | 540 | ||
541 | return retval; | 541 | return retval; |
542 | } | 542 | } |
543 | |||
544 | static void __exit debugfs_exit(void) | ||
545 | { | ||
546 | debugfs_registered = false; | ||
547 | |||
548 | simple_release_fs(&debugfs_mount, &debugfs_mount_count); | ||
549 | unregister_filesystem(&debug_fs_type); | ||
550 | kobject_put(debug_kobj); | ||
551 | } | ||
552 | |||
553 | core_initcall(debugfs_init); | 543 | core_initcall(debugfs_init); |
554 | module_exit(debugfs_exit); | ||
555 | MODULE_LICENSE("GPL"); | ||
556 | 544 | ||