[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>
This commit is contained in:
Steven Whitehouse
2006-02-27 17:23:27 -05:00
parent f3b270a478
commit 5c676f6d35
40 changed files with 416 additions and 272 deletions

View File

@ -12,14 +12,18 @@
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/buffer_head.h>
#include <linux/gfs2_ondisk.h>
#include <asm/semaphore.h>
#include "gfs2.h"
#include "lm_interface.h"
#include "incore.h"
#include "glock.h"
#include "log.h"
#include "lops.h"
#include "meta_io.h"
#include "trans.h"
#include "util.h"
int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
unsigned int revokes, char *file, unsigned int line)
@ -27,7 +31,7 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
struct gfs2_trans *tr;
int error;
if (gfs2_assert_warn(sdp, !get_transaction) ||
if (gfs2_assert_warn(sdp, !current->journal_info) ||
gfs2_assert_warn(sdp, blocks || revokes)) {
fs_warn(sdp, "(%s, %u)\n", file, line);
return -EINVAL;
@ -69,7 +73,7 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp, unsigned int blocks,
if (error)
goto fail_gunlock;
set_transaction(tr);
current->journal_info = tr;
return 0;
@ -90,8 +94,8 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
struct gfs2_trans *tr;
struct gfs2_holder *t_gh;
tr = get_transaction;
set_transaction(NULL);
tr = current->journal_info;
current->journal_info = NULL;
if (gfs2_assert_warn(sdp, tr))
return;
@ -147,12 +151,12 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
struct gfs2_sbd *sdp = gl->gl_sbd;
struct gfs2_bufdata *bd;
bd = get_v2bd(bh);
bd = bh->b_private;
if (bd)
gfs2_assert(sdp, bd->bd_gl == gl);
else {
gfs2_attach_bufdata(gl, bh, meta);
bd = get_v2bd(bh);
bd = bh->b_private;
}
lops_add(sdp, &bd->bd_le);
}
@ -186,8 +190,9 @@ void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, uint64_t blkno)
gfs2_log_unlock(sdp);
if (found) {
struct gfs2_trans *tr = current->journal_info;
kfree(rv);
get_transaction->tr_num_revoke_rm++;
tr->tr_num_revoke_rm++;
}
}