aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/trans.c')
-rw-r--r--fs/gfs2/trans.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 0a0ea70eac4c..2cce68aec134 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -12,14 +12,18 @@
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
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 <asm/semaphore.h> 16#include <asm/semaphore.h>
16 17
17#include "gfs2.h" 18#include "gfs2.h"
19#include "lm_interface.h"
20#include "incore.h"
18#include "glock.h" 21#include "glock.h"
19#include "log.h" 22#include "log.h"
20#include "lops.h" 23#include "lops.h"
21#include "meta_io.h" 24#include "meta_io.h"
22#include "trans.h" 25#include "trans.h"
26#include "util.h"
23 27
24int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks, 28int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
25 unsigned int revokes, char *file, unsigned int line) 29 unsigned int revokes, char *file, unsigned int line)
@@ -27,7 +31,7 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
27 struct gfs2_trans *tr; 31 struct gfs2_trans *tr;
28 int error; 32 int error;
29 33
30 if (gfs2_assert_warn(sdp, !get_transaction) || 34 if (gfs2_assert_warn(sdp, !current->journal_info) ||
31 gfs2_assert_warn(sdp, blocks || revokes)) { 35 gfs2_assert_warn(sdp, blocks || revokes)) {
32 fs_warn(sdp, "(%s, %u)\n", file, line); 36 fs_warn(sdp, "(%s, %u)\n", file, line);
33 return -EINVAL; 37 return -EINVAL;
@@ -69,7 +73,7 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
69 if (error) 73 if (error)
70 goto fail_gunlock; 74 goto fail_gunlock;
71 75
72 set_transaction(tr); 76 current->journal_info = tr;
73 77
74 return 0; 78 return 0;
75 79
@@ -90,8 +94,8 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
90 struct gfs2_trans *tr; 94 struct gfs2_trans *tr;
91 struct gfs2_holder *t_gh; 95 struct gfs2_holder *t_gh;
92 96
93 tr = get_transaction; 97 tr = current->journal_info;
94 set_transaction(NULL); 98 current->journal_info = NULL;
95 99
96 if (gfs2_assert_warn(sdp, tr)) 100 if (gfs2_assert_warn(sdp, tr))
97 return; 101 return;
@@ -147,12 +151,12 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
147 struct gfs2_sbd *sdp = gl->gl_sbd; 151 struct gfs2_sbd *sdp = gl->gl_sbd;
148 struct gfs2_bufdata *bd; 152 struct gfs2_bufdata *bd;
149 153
150 bd = get_v2bd(bh); 154 bd = bh->b_private;
151 if (bd) 155 if (bd)
152 gfs2_assert(sdp, bd->bd_gl == gl); 156 gfs2_assert(sdp, bd->bd_gl == gl);
153 else { 157 else {
154 gfs2_attach_bufdata(gl, bh, meta); 158 gfs2_attach_bufdata(gl, bh, meta);
155 bd = get_v2bd(bh); 159 bd = bh->b_private;
156 } 160 }
157 lops_add(sdp, &bd->bd_le); 161 lops_add(sdp, &bd->bd_le);
158} 162}
@@ -186,8 +190,9 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, uint64_t blkno)
186 gfs2_log_unlock(sdp); 190 gfs2_log_unlock(sdp);
187 191
188 if (found) { 192 if (found) {
193 struct gfs2_trans *tr = current->journal_info;
189 kfree(rv); 194 kfree(rv);
190 get_transaction->tr_num_revoke_rm++; 195 tr->tr_num_revoke_rm++;
191 } 196 }
192} 197}
193 198