aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-27 17:23:27 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-27 17:23:27 -0500
commit5c676f6d359b0404d53f542f02e1359583cb2895 (patch)
tree8741011990ec0a3d0d41fee9f0d7abf6a16834cc /fs/gfs2/trans.c
parentf3b270a47882b958e9e3c5bd86894e3a7072899a (diff)
[GFS2] Macros removal in gfs2.h
As suggested by Pekka Enberg <penberg@cs.helsinki.fi>. The DIV_RU macro is renamed DIV_ROUND_UP and and moved to kernel.h The other macros are gone from gfs2.h as (although not requested by Pekka Enberg) are a number of included header file which are now included individually. The inode number comparison function is now an inline function. The DT2IF and IF2DT may be addressed in a future patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
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 0a0ea70eac4..2cce68aec13 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