aboutsummaryrefslogtreecommitdiffstats
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 aa1a619f0854..3fae3d4e9ae4 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -13,6 +13,7 @@
13#include <linux/completion.h> 13#include <linux/completion.h>
14#include <linux/buffer_head.h> 14#include <linux/buffer_head.h>
15#include <linux/gfs2_ondisk.h> 15#include <linux/gfs2_ondisk.h>
16#include <linux/kallsyms.h>
16#include <asm/semaphore.h> 17#include <asm/semaphore.h>
17 18
18#include "gfs2.h" 19#include "gfs2.h"
@@ -25,24 +26,20 @@
25#include "trans.h" 26#include "trans.h"
26#include "util.h" 27#include "util.h"
27 28
28int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks, 29int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
29 unsigned int revokes, char *file, unsigned int line) 30 unsigned int revokes)
30{ 31{
31 struct gfs2_trans *tr; 32 struct gfs2_trans *tr;
32 int error; 33 int error;
33 34
34 if (gfs2_assert_warn(sdp, !current->journal_info) || 35 BUG_ON(current->journal_info);
35 gfs2_assert_warn(sdp, blocks || revokes)) { 36 BUG_ON(blocks == 0 && revokes == 0);
36 fs_warn(sdp, "(%s, %u)\n", file, line);
37 return -EINVAL;
38 }
39 37
40 tr = kzalloc(sizeof(struct gfs2_trans), GFP_NOFS); 38 tr = kzalloc(sizeof(struct gfs2_trans), GFP_NOFS);
41 if (!tr) 39 if (!tr)
42 return -ENOMEM; 40 return -ENOMEM;
43 41
44 tr->tr_file = file; 42 tr->tr_ip = (unsigned long)__builtin_return_address(0);
45 tr->tr_line = line;
46 tr->tr_blocks = blocks; 43 tr->tr_blocks = blocks;
47 tr->tr_revokes = revokes; 44 tr->tr_revokes = revokes;
48 tr->tr_reserved = 1; 45 tr->tr_reserved = 1;
@@ -104,16 +101,15 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
104 return; 101 return;
105 } 102 }
106 103
107 if (gfs2_assert_withdraw(sdp, tr->tr_num_buf <= tr->tr_blocks)) 104 if (gfs2_assert_withdraw(sdp, tr->tr_num_buf <= tr->tr_blocks)) {
108 fs_err(sdp, "tr_num_buf = %u, tr_blocks = %u " 105 fs_err(sdp, "tr_num_buf = %u, tr_blocks = %u ",
109 "tr_file = %s, tr_line = %u\n", 106 tr->tr_num_buf, tr->tr_blocks);
110 tr->tr_num_buf, tr->tr_blocks, 107 print_symbol(KERN_WARNING "GFS2: Transaction created at: %s\n", tr->tr_ip);
111 tr->tr_file, tr->tr_line); 108 }
112 if (gfs2_assert_withdraw(sdp, tr->tr_num_revoke <= tr->tr_revokes)) 109 if (gfs2_assert_withdraw(sdp, tr->tr_num_revoke <= tr->tr_revokes))
113 fs_err(sdp, "tr_num_revoke = %u, tr_revokes = %u " 110 fs_err(sdp, "tr_num_revoke = %u, tr_revokes = %u ",
114 "tr_file = %s, tr_line = %u\n", 111 tr->tr_num_revoke, tr->tr_revokes);
115 tr->tr_num_revoke, tr->tr_revokes, 112 print_symbol(KERN_WARNING "GFS2: Transaction created at: %s\n", tr->tr_ip);
116 tr->tr_file, tr->tr_line);
117 113
118 gfs2_log_commit(sdp, tr); 114 gfs2_log_commit(sdp, tr);
119 115