diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-27 17:23:27 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-27 17:23:27 -0500 |
commit | 5c676f6d359b0404d53f542f02e1359583cb2895 (patch) | |
tree | 8741011990ec0a3d0d41fee9f0d7abf6a16834cc /fs/gfs2/glops.c | |
parent | f3b270a47882b958e9e3c5bd86894e3a7072899a (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/glops.c')
-rw-r--r-- | fs/gfs2/glops.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 27374306ecde..d9334eb72df8 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -12,9 +12,12 @@ | |||
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 "bmap.h" | 21 | #include "bmap.h" |
19 | #include "glock.h" | 22 | #include "glock.h" |
20 | #include "glops.h" | 23 | #include "glops.h" |
@@ -24,6 +27,7 @@ | |||
24 | #include "page.h" | 27 | #include "page.h" |
25 | #include "recovery.h" | 28 | #include "recovery.h" |
26 | #include "rgrp.h" | 29 | #include "rgrp.h" |
30 | #include "util.h" | ||
27 | 31 | ||
28 | /** | 32 | /** |
29 | * meta_go_sync - sync out the metadata for this glock | 33 | * meta_go_sync - sync out the metadata for this glock |
@@ -193,7 +197,7 @@ static int inode_go_demote_ok(struct gfs2_glock *gl) | |||
193 | struct gfs2_sbd *sdp = gl->gl_sbd; | 197 | struct gfs2_sbd *sdp = gl->gl_sbd; |
194 | int demote = 0; | 198 | int demote = 0; |
195 | 199 | ||
196 | if (!get_gl2ip(gl) && !gl->gl_aspace->i_mapping->nrpages) | 200 | if (!gl->gl_object && !gl->gl_aspace->i_mapping->nrpages) |
197 | demote = 1; | 201 | demote = 1; |
198 | else if (!sdp->sd_args.ar_localcaching && | 202 | else if (!sdp->sd_args.ar_localcaching && |
199 | time_after_eq(jiffies, gl->gl_stamp + | 203 | time_after_eq(jiffies, gl->gl_stamp + |
@@ -214,7 +218,7 @@ static int inode_go_demote_ok(struct gfs2_glock *gl) | |||
214 | static int inode_go_lock(struct gfs2_holder *gh) | 218 | static int inode_go_lock(struct gfs2_holder *gh) |
215 | { | 219 | { |
216 | struct gfs2_glock *gl = gh->gh_gl; | 220 | struct gfs2_glock *gl = gh->gh_gl; |
217 | struct gfs2_inode *ip = get_gl2ip(gl); | 221 | struct gfs2_inode *ip = gl->gl_object; |
218 | int error = 0; | 222 | int error = 0; |
219 | 223 | ||
220 | if (!ip) | 224 | if (!ip) |
@@ -246,7 +250,7 @@ static int inode_go_lock(struct gfs2_holder *gh) | |||
246 | static void inode_go_unlock(struct gfs2_holder *gh) | 250 | static void inode_go_unlock(struct gfs2_holder *gh) |
247 | { | 251 | { |
248 | struct gfs2_glock *gl = gh->gh_gl; | 252 | struct gfs2_glock *gl = gh->gh_gl; |
249 | struct gfs2_inode *ip = get_gl2ip(gl); | 253 | struct gfs2_inode *ip = gl->gl_object; |
250 | 254 | ||
251 | if (ip && test_bit(GLF_DIRTY, &gl->gl_flags)) | 255 | if (ip && test_bit(GLF_DIRTY, &gl->gl_flags)) |
252 | gfs2_inode_attr_in(ip); | 256 | gfs2_inode_attr_in(ip); |
@@ -264,7 +268,7 @@ static void inode_go_unlock(struct gfs2_holder *gh) | |||
264 | static void inode_greedy(struct gfs2_glock *gl) | 268 | static void inode_greedy(struct gfs2_glock *gl) |
265 | { | 269 | { |
266 | struct gfs2_sbd *sdp = gl->gl_sbd; | 270 | struct gfs2_sbd *sdp = gl->gl_sbd; |
267 | struct gfs2_inode *ip = get_gl2ip(gl); | 271 | struct gfs2_inode *ip = gl->gl_object; |
268 | unsigned int quantum = gfs2_tune_get(sdp, gt_greedy_quantum); | 272 | unsigned int quantum = gfs2_tune_get(sdp, gt_greedy_quantum); |
269 | unsigned int max = gfs2_tune_get(sdp, gt_greedy_max); | 273 | unsigned int max = gfs2_tune_get(sdp, gt_greedy_max); |
270 | unsigned int new_time; | 274 | unsigned int new_time; |
@@ -311,7 +315,7 @@ static int rgrp_go_demote_ok(struct gfs2_glock *gl) | |||
311 | 315 | ||
312 | static int rgrp_go_lock(struct gfs2_holder *gh) | 316 | static int rgrp_go_lock(struct gfs2_holder *gh) |
313 | { | 317 | { |
314 | return gfs2_rgrp_bh_get(get_gl2rgd(gh->gh_gl)); | 318 | return gfs2_rgrp_bh_get(gh->gh_gl->gl_object); |
315 | } | 319 | } |
316 | 320 | ||
317 | /** | 321 | /** |
@@ -324,7 +328,7 @@ static int rgrp_go_lock(struct gfs2_holder *gh) | |||
324 | 328 | ||
325 | static void rgrp_go_unlock(struct gfs2_holder *gh) | 329 | static void rgrp_go_unlock(struct gfs2_holder *gh) |
326 | { | 330 | { |
327 | gfs2_rgrp_bh_put(get_gl2rgd(gh->gh_gl)); | 331 | gfs2_rgrp_bh_put(gh->gh_gl->gl_object); |
328 | } | 332 | } |
329 | 333 | ||
330 | /** | 334 | /** |
@@ -358,13 +362,14 @@ static void trans_go_xmote_th(struct gfs2_glock *gl, unsigned int state, | |||
358 | static void trans_go_xmote_bh(struct gfs2_glock *gl) | 362 | static void trans_go_xmote_bh(struct gfs2_glock *gl) |
359 | { | 363 | { |
360 | struct gfs2_sbd *sdp = gl->gl_sbd; | 364 | struct gfs2_sbd *sdp = gl->gl_sbd; |
361 | struct gfs2_glock *j_gl = get_v2ip(sdp->sd_jdesc->jd_inode)->i_gl; | 365 | struct gfs2_inode *ip = sdp->sd_jdesc->jd_inode->u.generic_ip; |
366 | struct gfs2_glock *j_gl = ip->i_gl; | ||
362 | struct gfs2_log_header head; | 367 | struct gfs2_log_header head; |
363 | int error; | 368 | int error; |
364 | 369 | ||
365 | if (gl->gl_state != LM_ST_UNLOCKED && | 370 | if (gl->gl_state != LM_ST_UNLOCKED && |
366 | test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { | 371 | test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) { |
367 | gfs2_meta_cache_flush(get_v2ip(sdp->sd_jdesc->jd_inode)); | 372 | gfs2_meta_cache_flush(sdp->sd_jdesc->jd_inode->u.generic_ip); |
368 | j_gl->gl_ops->go_inval(j_gl, DIO_METADATA | DIO_DATA); | 373 | j_gl->gl_ops->go_inval(j_gl, DIO_METADATA | DIO_DATA); |
369 | 374 | ||
370 | error = gfs2_find_jhead(sdp->sd_jdesc, &head); | 375 | error = gfs2_find_jhead(sdp->sd_jdesc, &head); |