diff options
-rw-r--r-- | fs/gfs2/glock.c | 26 | ||||
-rw-r--r-- | fs/gfs2/incore.h | 3 | ||||
-rw-r--r-- | fs/gfs2/ops_fstype.c | 1 |
3 files changed, 21 insertions, 9 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index b075f9359c60..7988715b7a07 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -1774,7 +1774,7 @@ static void gfs2_print_symbol(struct glock_iter *gi, const char *fmt, | |||
1774 | 1774 | ||
1775 | if (gi) { | 1775 | if (gi) { |
1776 | memset(buffer, 0, sizeof(buffer)); | 1776 | memset(buffer, 0, sizeof(buffer)); |
1777 | sprintf(buffer, "%p", address); | 1777 | sprintf(buffer, "0x%08lx", address); |
1778 | print_dbg(gi, fmt, buffer); | 1778 | print_dbg(gi, fmt, buffer); |
1779 | } | 1779 | } |
1780 | else | 1780 | else |
@@ -2146,11 +2146,14 @@ static const struct file_operations gfs2_debug_fops = { | |||
2146 | 2146 | ||
2147 | int gfs2_create_debugfs_file(struct gfs2_sbd *sdp) | 2147 | int gfs2_create_debugfs_file(struct gfs2_sbd *sdp) |
2148 | { | 2148 | { |
2149 | sdp->debugfs_dentry = debugfs_create_file(sdp->sd_table_name, | 2149 | sdp->debugfs_dir = debugfs_create_dir(sdp->sd_table_name, gfs2_root); |
2150 | S_IFREG | S_IRUGO, | 2150 | if (!sdp->debugfs_dir) |
2151 | gfs2_root, sdp, | 2151 | return -ENOMEM; |
2152 | &gfs2_debug_fops); | 2152 | sdp->debugfs_dentry_glocks = debugfs_create_file("glocks", |
2153 | if (!sdp->debugfs_dentry) | 2153 | S_IFREG | S_IRUGO, |
2154 | sdp->debugfs_dir, sdp, | ||
2155 | &gfs2_debug_fops); | ||
2156 | if (!sdp->debugfs_dentry_glocks) | ||
2154 | return -ENOMEM; | 2157 | return -ENOMEM; |
2155 | 2158 | ||
2156 | return 0; | 2159 | return 0; |
@@ -2158,8 +2161,14 @@ int gfs2_create_debugfs_file(struct gfs2_sbd *sdp) | |||
2158 | 2161 | ||
2159 | void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp) | 2162 | void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp) |
2160 | { | 2163 | { |
2161 | if (sdp && sdp->debugfs_dentry) | 2164 | if (sdp && sdp->debugfs_dir) { |
2162 | debugfs_remove(sdp->debugfs_dentry); | 2165 | if (sdp->debugfs_dentry_glocks) { |
2166 | debugfs_remove(sdp->debugfs_dentry_glocks); | ||
2167 | sdp->debugfs_dentry_glocks = NULL; | ||
2168 | } | ||
2169 | debugfs_remove(sdp->debugfs_dir); | ||
2170 | sdp->debugfs_dir = NULL; | ||
2171 | } | ||
2163 | } | 2172 | } |
2164 | 2173 | ||
2165 | int gfs2_register_debugfs(void) | 2174 | int gfs2_register_debugfs(void) |
@@ -2171,4 +2180,5 @@ int gfs2_register_debugfs(void) | |||
2171 | void gfs2_unregister_debugfs(void) | 2180 | void gfs2_unregister_debugfs(void) |
2172 | { | 2181 | { |
2173 | debugfs_remove(gfs2_root); | 2182 | debugfs_remove(gfs2_root); |
2183 | gfs2_root = NULL; | ||
2174 | } | 2184 | } |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index fdf04705906f..d995441373ab 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -609,7 +609,8 @@ struct gfs2_sbd { | |||
609 | 609 | ||
610 | unsigned long sd_last_warning; | 610 | unsigned long sd_last_warning; |
611 | struct vfsmount *sd_gfs2mnt; | 611 | struct vfsmount *sd_gfs2mnt; |
612 | struct dentry *debugfs_dentry; /* for debugfs */ | 612 | struct dentry *debugfs_dir; /* debugfs directory */ |
613 | struct dentry *debugfs_dentry_glocks; /* for debugfs */ | ||
613 | }; | 614 | }; |
614 | 615 | ||
615 | #endif /* __INCORE_DOT_H__ */ | 616 | #endif /* __INCORE_DOT_H__ */ |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index ecb8b18de0ee..2c5f8e7def0d 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -756,6 +756,7 @@ fail_lm: | |||
756 | fail_sys: | 756 | fail_sys: |
757 | gfs2_sys_fs_del(sdp); | 757 | gfs2_sys_fs_del(sdp); |
758 | fail: | 758 | fail: |
759 | gfs2_delete_debugfs_file(sdp); | ||
759 | kfree(sdp); | 760 | kfree(sdp); |
760 | sb->s_fs_info = NULL; | 761 | sb->s_fs_info = NULL; |
761 | return error; | 762 | return error; |