|
25 | 25 | #include "util.h"
|
26 | 26 | #include "trace_gfs2.h"
|
27 | 27 |
|
| 28 | +static void gfs2_print_trans(struct gfs2_sbd *sdp, const struct gfs2_trans *tr) |
| 29 | +{ |
| 30 | + fs_warn(sdp, "Transaction created at: %pSR\n", (void *)tr->tr_ip); |
| 31 | + fs_warn(sdp, "blocks=%u revokes=%u reserved=%u touched=%u\n", |
| 32 | + tr->tr_blocks, tr->tr_revokes, tr->tr_reserved, |
| 33 | + test_bit(TR_TOUCHED, &tr->tr_flags)); |
| 34 | + fs_warn(sdp, "Buf %u/%u Databuf %u/%u Revoke %u/%u\n", |
| 35 | + tr->tr_num_buf_new, tr->tr_num_buf_rm, |
| 36 | + tr->tr_num_databuf_new, tr->tr_num_databuf_rm, |
| 37 | + tr->tr_num_revoke, tr->tr_num_revoke_rm); |
| 38 | +} |
| 39 | + |
28 | 40 | int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
|
29 | 41 | unsigned int revokes)
|
30 | 42 | {
|
31 | 43 | struct gfs2_trans *tr;
|
32 | 44 | int error;
|
33 | 45 |
|
34 |
| - BUG_ON(current->journal_info); |
| 46 | + if (current->journal_info) { |
| 47 | + gfs2_print_trans(sdp, current->journal_info); |
| 48 | + BUG(); |
| 49 | + } |
35 | 50 | BUG_ON(blocks == 0 && revokes == 0);
|
36 | 51 |
|
37 | 52 | if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags))
|
@@ -72,18 +87,6 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
|
72 | 87 | return error;
|
73 | 88 | }
|
74 | 89 |
|
75 |
| -static void gfs2_print_trans(struct gfs2_sbd *sdp, const struct gfs2_trans *tr) |
76 |
| -{ |
77 |
| - fs_warn(sdp, "Transaction created at: %pSR\n", (void *)tr->tr_ip); |
78 |
| - fs_warn(sdp, "blocks=%u revokes=%u reserved=%u touched=%u\n", |
79 |
| - tr->tr_blocks, tr->tr_revokes, tr->tr_reserved, |
80 |
| - test_bit(TR_TOUCHED, &tr->tr_flags)); |
81 |
| - fs_warn(sdp, "Buf %u/%u Databuf %u/%u Revoke %u/%u\n", |
82 |
| - tr->tr_num_buf_new, tr->tr_num_buf_rm, |
83 |
| - tr->tr_num_databuf_new, tr->tr_num_databuf_rm, |
84 |
| - tr->tr_num_revoke, tr->tr_num_revoke_rm); |
85 |
| -} |
86 |
| - |
87 | 90 | void gfs2_trans_end(struct gfs2_sbd *sdp)
|
88 | 91 | {
|
89 | 92 | struct gfs2_trans *tr = current->journal_info;
|
|
0 commit comments