summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-03-29 14:36:49 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-03-29 14:36:49 -0500
commitd0dc80dbafb5c10ad2084831a61bbf945484a139 (patch)
treef7434367a66e4e4be0885daefe5e59ab43502a7f /fs/gfs2/trans.c
parent484adff8a06cb5d952832f5487ae863f54c0fb69 (diff)
[GFS2] Update debugging code
Update the debugging code in trans.c and at the same time improve the debugging code for gfs2_holders. The new code should be pretty fast during the normal case and provide just as much information in case of errors (or more). One small function from glock.c has moved to glock.h as a static inline so that its return address won't get in the way of the debugging. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/trans.c')
-rw-r--r--fs/gfs2/trans.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index aa1a619f085..3fae3d4e9ae 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -13,6 +13,7 @@
#include <linux/completion.h>
#include <linux/buffer_head.h>
#include <linux/gfs2_ondisk.h>
+#include <linux/kallsyms.h>
#include <asm/semaphore.h>
#include "gfs2.h"
@@ -25,24 +26,20 @@
#include "trans.h"
#include "util.h"
-int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
- unsigned int revokes, char *file, unsigned int line)
+int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
+ unsigned int revokes)
{
struct gfs2_trans *tr;
int error;
- if (gfs2_assert_warn(sdp, !current->journal_info) ||
- gfs2_assert_warn(sdp, blocks || revokes)) {
- fs_warn(sdp, "(%s, %u)\n", file, line);
- return -EINVAL;
- }
+ BUG_ON(current->journal_info);
+ BUG_ON(blocks == 0 && revokes == 0);
tr = kzalloc(sizeof(struct gfs2_trans), GFP_NOFS);
if (!tr)
return -ENOMEM;
- tr->tr_file = file;
- tr->tr_line = line;
+ tr->tr_ip = (unsigned long)__builtin_return_address(0);
tr->tr_blocks = blocks;
tr->tr_revokes = revokes;
tr->tr_reserved = 1;
@@ -104,16 +101,15 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
return;
}
- if (gfs2_assert_withdraw(sdp, tr->tr_num_buf <= tr->tr_blocks))
- fs_err(sdp, "tr_num_buf = %u, tr_blocks = %u "
- "tr_file = %s, tr_line = %u\n",
- tr->tr_num_buf, tr->tr_blocks,
- tr->tr_file, tr->tr_line);
+ if (gfs2_assert_withdraw(sdp, tr->tr_num_buf <= tr->tr_blocks)) {
+ fs_err(sdp, "tr_num_buf = %u, tr_blocks = %u ",
+ tr->tr_num_buf, tr->tr_blocks);
+ print_symbol(KERN_WARNING "GFS2: Transaction created at: %s\n", tr->tr_ip);
+ }
if (gfs2_assert_withdraw(sdp, tr->tr_num_revoke <= tr->tr_revokes))
- fs_err(sdp, "tr_num_revoke = %u, tr_revokes = %u "
- "tr_file = %s, tr_line = %u\n",
- tr->tr_num_revoke, tr->tr_revokes,
- tr->tr_file, tr->tr_line);
+ fs_err(sdp, "tr_num_revoke = %u, tr_revokes = %u ",
+ tr->tr_num_revoke, tr->tr_revokes);
+ print_symbol(KERN_WARNING "GFS2: Transaction created at: %s\n", tr->tr_ip);
gfs2_log_commit(sdp, tr);