Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54472
b: refs/heads/master
c: 5f88209
h: refs/heads/master
v: v3
  • Loading branch information
Robert Peterson authored and Steven Whitehouse committed May 1, 2007
1 parent 5fde2a3 commit 1b92ffc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bdd19a22f85a7039e01accd8717eaec4addd9dfd
refs/heads/master: 5f8820960cf4fb621483d4a37c24939ad831bfe7
26 changes: 18 additions & 8 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ static void gfs2_print_symbol(struct glock_iter *gi, const char *fmt,

if (gi) {
memset(buffer, 0, sizeof(buffer));
sprintf(buffer, "%p", address);
sprintf(buffer, "0x%08lx", address);
print_dbg(gi, fmt, buffer);
}
else
Expand Down Expand Up @@ -2146,20 +2146,29 @@ static const struct file_operations gfs2_debug_fops = {

int gfs2_create_debugfs_file(struct gfs2_sbd *sdp)
{
sdp->debugfs_dentry = debugfs_create_file(sdp->sd_table_name,
S_IFREG | S_IRUGO,
gfs2_root, sdp,
&gfs2_debug_fops);
if (!sdp->debugfs_dentry)
sdp->debugfs_dir = debugfs_create_dir(sdp->sd_table_name, gfs2_root);
if (!sdp->debugfs_dir)
return -ENOMEM;
sdp->debugfs_dentry_glocks = debugfs_create_file("glocks",
S_IFREG | S_IRUGO,
sdp->debugfs_dir, sdp,
&gfs2_debug_fops);
if (!sdp->debugfs_dentry_glocks)
return -ENOMEM;

return 0;
}

void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp)
{
if (sdp && sdp->debugfs_dentry)
debugfs_remove(sdp->debugfs_dentry);
if (sdp && sdp->debugfs_dir) {
if (sdp->debugfs_dentry_glocks) {
debugfs_remove(sdp->debugfs_dentry_glocks);
sdp->debugfs_dentry_glocks = NULL;
}
debugfs_remove(sdp->debugfs_dir);
sdp->debugfs_dir = NULL;
}
}

int gfs2_register_debugfs(void)
Expand All @@ -2171,4 +2180,5 @@ int gfs2_register_debugfs(void)
void gfs2_unregister_debugfs(void)
{
debugfs_remove(gfs2_root);
gfs2_root = NULL;
}
3 changes: 2 additions & 1 deletion trunk/fs/gfs2/incore.h
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,8 @@ struct gfs2_sbd {

unsigned long sd_last_warning;
struct vfsmount *sd_gfs2mnt;
struct dentry *debugfs_dentry; /* for debugfs */
struct dentry *debugfs_dir; /* debugfs directory */
struct dentry *debugfs_dentry_glocks; /* for debugfs */
};

#endif /* __INCORE_DOT_H__ */
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ static int fill_super(struct super_block *sb, void *data, int silent)
fail_sys:
gfs2_sys_fs_del(sdp);
fail:
gfs2_delete_debugfs_file(sdp);
kfree(sdp);
sb->s_fs_info = NULL;
return error;
Expand Down

0 comments on commit 1b92ffc

Please sign in to comment.