aboutsummaryrefslogtreecommitdiffstats
path: root/fs/debugfs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:05:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:05:40 -0400
commita5e6b135bdff649e4330f98e2e80dbb1984f7e77 (patch)
tree475bfb1163c59d1370fd77415255afba768f9520 /fs/debugfs/inode.c
parent971f115a50afbe409825c9f3399d5a3b9aca4381 (diff)
parent9d90c8d9cde929cbc575098e825d7c29d9f45054 (diff)
Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (50 commits) printk: do not mangle valid userspace syslog prefixes efivars: Add Documentation efivars: Expose efivars functionality to external drivers. efivars: Parameterize operations. efivars: Split out variable registration efivars: parameterize efivars efivars: Make efivars bin_attributes dynamic efivars: move efivars globals into struct efivars drivers:misc: ti-st: fix debugging code kref: Fix typo in kref documentation UIO: add PRUSS UIO driver support Fix spelling mistakes in Documentation/zh_CN/SubmittingPatches firmware: Fix unaligned memory accesses in dmi-sysfs firmware: Add documentation for /sys/firmware/dmi firmware: Expose DMI type 15 System Event Log firmware: Break out system_event_log in dmi-sysfs firmware: Basic dmi-sysfs support firmware: Add DMI entry types to the headers Driver core: convert platform_{get,set}_drvdata to static inline functions Translate linux-2.6/Documentation/magic-number.txt into Chinese ...
Diffstat (limited to 'fs/debugfs/inode.c')
-rw-r--r--fs/debugfs/inode.c26
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}
311EXPORT_SYMBOL_GPL(debugfs_create_symlink); 308EXPORT_SYMBOL_GPL(debugfs_create_symlink);
312 309
313static void __debugfs_remove(struct dentry *dentry, struct dentry *parent) 310static 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)
351void debugfs_remove(struct dentry *dentry) 349void 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}
367EXPORT_SYMBOL_GPL(debugfs_remove); 367EXPORT_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
544static 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
553core_initcall(debugfs_init); 543core_initcall(debugfs_init);
554module_exit(debugfs_exit);
555MODULE_LICENSE("GPL");
556 544