summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Whitehouse <steve@chygwyn.com>2006-01-18 11:19:28 +0000
committerSteven Whitehouse <steve@chygwyn.com>2006-01-18 11:19:28 +0000
commitd4e9c4c3bf861ef2ac96e0de659c75a00da92b28 (patch)
tree925ececc725ad5180b9253f732b50c51bfa0754d
parentb96ca4fa4e3b510d528a093a5bac0befbc2ba46d (diff)
[GFS2] Add an additional argument to gfs2_trans_add_bh()
This adds an extra argument to gfs2_trans_add_bh() to indicate whether the bh being added to the transaction is metadata or data. Its currently unused since all existing callers set it to 1 (metadata) but following patches will make use of it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r--fs/gfs2/acl.c2
-rw-r--r--fs/gfs2/bmap.c24
-rw-r--r--fs/gfs2/dir.c32
-rw-r--r--fs/gfs2/eattr.c38
-rw-r--r--fs/gfs2/inode.c16
-rw-r--r--fs/gfs2/jdata.c8
-rw-r--r--fs/gfs2/meta_io.c2
-rw-r--r--fs/gfs2/ops_address.c2
-rw-r--r--fs/gfs2/ops_file.c10
-rw-r--r--fs/gfs2/ops_inode.c4
-rw-r--r--fs/gfs2/quota.c2
-rw-r--r--fs/gfs2/resize.c2
-rw-r--r--fs/gfs2/rgrp.c16
-rw-r--r--fs/gfs2/super.c6
-rw-r--r--fs/gfs2/trans.c3
-rw-r--r--fs/gfs2/trans.h2
-rw-r--r--fs/gfs2/unlinked.c2
17 files changed, 86 insertions, 85 deletions
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 33c465a2ab53..9482a677ea47 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -202,7 +202,7 @@ static int munge_mode(struct gfs2_inode *ip, mode_t mode)
gfs2_assert_withdraw(sdp,
(ip->i_di.di_mode & S_IFMT) == (mode & S_IFMT));
ip->i_di.di_mode = mode;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index bece3620f1c0..967cbc68195a 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -124,7 +124,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, gfs2_unstuffer_t unstuffer,
/* Set up the pointer to the new block */
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
@@ -223,7 +223,7 @@ static int build_height(struct gfs2_inode *ip, int height)
block = gfs2_alloc_meta(ip);
bh = gfs2_meta_new(ip->i_gl, block);
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_metatype_set(bh,
GFS2_METATYPE_IN,
GFS2_FORMAT_IN);
@@ -236,7 +236,7 @@ static int build_height(struct gfs2_inode *ip, int height)
/* Set up the new direct pointer and write it out to disk */
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
@@ -382,7 +382,7 @@ static void lookup_block(struct gfs2_inode *ip, struct buffer_head *bh,
else
*block = gfs2_alloc_meta(ip);
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
*ptr = cpu_to_be64(*block);
ip->i_di.di_blocks++;
@@ -490,7 +490,7 @@ int gfs2_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
if (*new) {
error = gfs2_meta_inode_buffer(ip, &bh);
if (!error) {
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_dinode_out(&ip->i_di, bh->b_data);
brelse(bh);
}
@@ -672,8 +672,8 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
down_write(&ip->i_rw_mutex);
- gfs2_trans_add_bh(ip->i_gl, dibh);
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
bstart = 0;
blen = 0;
@@ -795,7 +795,7 @@ static int do_grow(struct gfs2_inode *ip, uint64_t size)
if (error)
goto out_end_trans;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
@@ -833,7 +833,7 @@ static int truncator_journaled(struct gfs2_inode *ip, uint64_t size)
if (error)
return error;
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header) + off);
brelse(bh);
@@ -861,7 +861,7 @@ static int trunc_start(struct gfs2_inode *ip, uint64_t size,
if (gfs2_is_stuffed(ip)) {
ip->i_di.di_size = size;
ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode) + size);
error = 1;
@@ -879,7 +879,7 @@ static int trunc_start(struct gfs2_inode *ip, uint64_t size,
ip->i_di.di_size = size;
ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
ip->i_di.di_flags |= GFS2_DIF_TRUNC_IN_PROG;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
}
}
@@ -957,7 +957,7 @@ static int trunc_end(struct gfs2_inode *ip)
ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
ip->i_di.di_flags &= ~GFS2_DIF_TRUNC_IN_PROG;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index f6304e55dbc1..93d3704ac58c 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -201,7 +201,7 @@ static void dirent_del(struct gfs2_inode *dip, struct buffer_head *bh,
return;
}
- gfs2_trans_add_bh(dip->i_gl, bh);
+ gfs2_trans_add_bh(dip->i_gl, bh, 1);
/* If there is no prev entry, this is the first entry in the block.
The de_rec_len is already as big as it needs to be. Just zero
@@ -264,7 +264,7 @@ int gfs2_dirent_alloc(struct gfs2_inode *dip, struct buffer_head *bh,
return -EIO;
}
- gfs2_trans_add_bh(dip->i_gl, bh);
+ gfs2_trans_add_bh(dip->i_gl, bh, 1);
dent->de_rec_len = bh->b_size - offset;
dent->de_rec_len = cpu_to_be32(dent->de_rec_len);
@@ -282,7 +282,7 @@ int gfs2_dirent_alloc(struct gfs2_inode *dip, struct buffer_head *bh,
if ((!dent->de_inum.no_addr && cur_rec_len >= rec_len) ||
(cur_rec_len >= GFS2_DIRENT_SIZE(cur_name_len) + rec_len)) {
- gfs2_trans_add_bh(dip->i_gl, bh);
+ gfs2_trans_add_bh(dip->i_gl, bh, 1);
if (dent->de_inum.no_addr) {
new = (struct gfs2_dirent *)((char *)dent +
@@ -552,7 +552,7 @@ static int dir_make_exhash(struct gfs2_inode *dip)
/* Turn over a new leaf */
bh = gfs2_meta_new(dip->i_gl, bn);
- gfs2_trans_add_bh(dip->i_gl, bh);
+ gfs2_trans_add_bh(dip->i_gl, bh, 1);
gfs2_metatype_set(bh, GFS2_METATYPE_LF, GFS2_FORMAT_LF);
gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header));
@@ -596,7 +596,7 @@ static int dir_make_exhash(struct gfs2_inode *dip)
/* We're done with the new leaf block, now setup the new
hash table. */
- gfs2_trans_add_bh(dip->i_gl, dibh);
+ gfs2_trans_add_bh(dip->i_gl, dibh, 1);
gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
lp = (uint64_t *)(dibh->b_data + sizeof(struct gfs2_dinode));
@@ -647,7 +647,7 @@ static int dir_split_leaf(struct gfs2_inode *dip, uint32_t index,
/* Get the new leaf block */
nbh = gfs2_meta_new(dip->i_gl, bn);
- gfs2_trans_add_bh(dip->i_gl, nbh);
+ gfs2_trans_add_bh(dip->i_gl, nbh, 1);
gfs2_metatype_set(nbh, GFS2_METATYPE_LF, GFS2_FORMAT_LF);
gfs2_buffer_clear_tail(nbh, sizeof(struct gfs2_meta_header));
@@ -661,7 +661,7 @@ static int dir_split_leaf(struct gfs2_inode *dip, uint32_t index,
if (error)
goto fail;
- gfs2_trans_add_bh(dip->i_gl, obh);
+ gfs2_trans_add_bh(dip->i_gl, obh, 1);
oleaf = (struct gfs2_leaf *)obh->b_data;
@@ -1285,14 +1285,14 @@ static int dir_e_add(struct gfs2_inode *dip, struct qstr *filename,
bn = gfs2_alloc_meta(dip);
nbh = gfs2_meta_new(dip->i_gl, bn);
- gfs2_trans_add_bh(dip->i_gl, nbh);
+ gfs2_trans_add_bh(dip->i_gl, nbh, 1);
gfs2_metatype_set(nbh,
GFS2_METATYPE_LF,
GFS2_FORMAT_LF);
gfs2_buffer_clear_tail(nbh,
sizeof(struct gfs2_meta_header));
- gfs2_trans_add_bh(dip->i_gl, bh);
+ gfs2_trans_add_bh(dip->i_gl, bh, 1);
leaf->lf_next = cpu_to_be64(bn);
nleaf = (struct gfs2_leaf *)nbh->b_data;
@@ -1330,7 +1330,7 @@ static int dir_e_add(struct gfs2_inode *dip, struct qstr *filename,
dip->i_di.di_entries++;
dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(dip->i_gl, dibh);
+ gfs2_trans_add_bh(dip->i_gl, dibh, 1);
gfs2_dinode_out(&dip->i_di, dibh->b_data);
brelse(dibh);
@@ -1376,7 +1376,7 @@ static int dir_e_del(struct gfs2_inode *dip, struct qstr *filename)
dip->i_di.di_entries--;
dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(dip->i_gl, dibh);
+ gfs2_trans_add_bh(dip->i_gl, dibh, 1);
gfs2_dinode_out(&dip->i_di, dibh->b_data);
brelse(dibh);
@@ -1481,7 +1481,7 @@ static int dir_e_mvino(struct gfs2_inode *dip, struct qstr *filename,
if (error)
return error;
- gfs2_trans_add_bh(dip->i_gl, bh);
+ gfs2_trans_add_bh(dip->i_gl, bh, 1);
gfs2_inum_out(inum, (char *)&dent->de_inum);
dent->de_type = new_type;
@@ -1494,7 +1494,7 @@ static int dir_e_mvino(struct gfs2_inode *dip, struct qstr *filename,
dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(dip->i_gl, dibh);
+ gfs2_trans_add_bh(dip->i_gl, dibh, 1);
gfs2_dinode_out(&dip->i_di, dibh->b_data);
brelse(dibh);
@@ -1681,7 +1681,7 @@ static int dir_l_mvino(struct gfs2_inode *dip, struct qstr *filename,
if (error)
goto out;
- gfs2_trans_add_bh(dip->i_gl, dibh);
+ gfs2_trans_add_bh(dip->i_gl, dibh, 1);
gfs2_inum_out(inum, (char *)&dent->de_inum);
dent->de_type = new_type;
@@ -1976,7 +1976,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, uint32_t index, uint32_t len,
if (error)
goto out_end_trans;
- gfs2_trans_add_bh(dip->i_gl, dibh);
+ gfs2_trans_add_bh(dip->i_gl, dibh, 1);
gfs2_dinode_out(&dip->i_di, dibh->b_data);
brelse(dibh);
@@ -2030,7 +2030,7 @@ int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip)
error = gfs2_meta_inode_buffer(dip, &bh);
if (!error) {
- gfs2_trans_add_bh(dip->i_gl, bh);
+ gfs2_trans_add_bh(dip->i_gl, bh, 1);
((struct gfs2_dinode *)bh->b_data)->di_mode = cpu_to_be32(S_IFREG);
brelse(bh);
}
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index dec55dcb9dbc..02e45c4ecbec 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -268,7 +268,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
if (error)
goto out_gunlock;
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
dataptrs = GFS2_EA2DATAPTRS(ea);
for (x = 0; x < ea->ea_num_ptrs; x++, dataptrs++) {
@@ -309,7 +309,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
error = gfs2_meta_inode_buffer(ip, &dibh);
if (!error) {
ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -628,7 +628,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp)
block = gfs2_alloc_meta(ip);
*bhp = gfs2_meta_new(ip->i_gl, block);
- gfs2_trans_add_bh(ip->i_gl, *bhp);
+ gfs2_trans_add_bh(ip->i_gl, *bhp, 1);
gfs2_metatype_set(*bhp, GFS2_METATYPE_EA, GFS2_FORMAT_EA);
gfs2_buffer_clear_tail(*bhp, sizeof(struct gfs2_meta_header));
@@ -686,7 +686,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
block = gfs2_alloc_meta(ip);
bh = gfs2_meta_new(ip->i_gl, block);
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED);
ip->i_di.di_blocks++;
@@ -759,7 +759,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
ip->i_di.di_mode = er->er_mode;
}
ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -839,7 +839,7 @@ static void ea_set_remove_stuffed(struct gfs2_inode *ip,
struct gfs2_ea_header *prev = el->el_prev;
uint32_t len;
- gfs2_trans_add_bh(ip->i_gl, el->el_bh);
+ gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
if (!prev || !GFS2_EA_IS_STUFFED(ea)) {
ea->ea_type = GFS2_EATYPE_UNUSED;
@@ -877,7 +877,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh,
if (error)
return error;
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
if (es->ea_split)
ea = ea_split_ea(ea);
@@ -897,7 +897,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh,
ip->i_di.di_mode = er->er_mode;
}
ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
out:
@@ -913,7 +913,7 @@ static int ea_set_simple_alloc(struct gfs2_inode *ip,
struct gfs2_ea_header *ea = es->es_ea;
int error;
- gfs2_trans_add_bh(ip->i_gl, es->es_bh);
+ gfs2_trans_add_bh(ip->i_gl, es->es_bh, 1);
if (es->ea_split)
ea = ea_split_ea(ea);
@@ -1007,14 +1007,14 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
goto out;
}
- gfs2_trans_add_bh(ip->i_gl, indbh);
+ gfs2_trans_add_bh(ip->i_gl, indbh, 1);
} else {
uint64_t blk;
blk = gfs2_alloc_meta(ip);
indbh = gfs2_meta_new(ip->i_gl, blk);
- gfs2_trans_add_bh(ip->i_gl, indbh);
+ gfs2_trans_add_bh(ip->i_gl, indbh, 1);
gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
gfs2_buffer_clear_tail(indbh, mh_size);
@@ -1163,7 +1163,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el)
if (error)
return error;
- gfs2_trans_add_bh(ip->i_gl, el->el_bh);
+ gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
if (prev) {
uint32_t len;
@@ -1179,7 +1179,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el)
error = gfs2_meta_inode_buffer(ip, &dibh);
if (!error) {
ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -1288,7 +1288,7 @@ static int ea_acl_chmod_unstuffed(struct gfs2_inode *ip,
goto fail;
}
- gfs2_trans_add_bh(ip->i_gl, bh[x]);
+ gfs2_trans_add_bh(ip->i_gl, bh[x], 1);
memcpy(bh[x]->b_data + sizeof(struct gfs2_meta_header),
data,
@@ -1323,7 +1323,7 @@ int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el,
if (error)
return error;
- gfs2_trans_add_bh(ip->i_gl, el->el_bh);
+ gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
memcpy(GFS2_EA2DATA(el->el_ea),
data,
GFS2_EA_DATA_LEN(el->el_ea));
@@ -1338,7 +1338,7 @@ int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el,
error = inode_setattr(ip->i_vnode, attr);
gfs2_assert_warn(ip->i_sbd, !error);
gfs2_inode_attr_out(ip);
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -1416,7 +1416,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
if (error)
goto out_gunlock;
- gfs2_trans_add_bh(ip->i_gl, indbh);
+ gfs2_trans_add_bh(ip->i_gl, indbh, 1);
eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs2_meta_header));
bstart = 0;
@@ -1450,7 +1450,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
error = gfs2_meta_inode_buffer(ip, &dibh);
if (!error) {
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -1502,7 +1502,7 @@ static int ea_dealloc_block(struct gfs2_inode *ip)
error = gfs2_meta_inode_buffer(ip, &dibh);
if (!error) {
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index aa5311ef7ba7..9ed7c0541065 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -691,7 +691,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff)
ip->i_di.di_nlink = nlink;
ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
@@ -786,7 +786,7 @@ static int pick_formal_ino_1(struct gfs2_sbd *sdp, uint64_t *formal_ino)
if (ir.ir_length) {
*formal_ino = ir.ir_start++;
ir.ir_length--;
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_inum_range_out(&ir,
bh->b_data + sizeof(struct gfs2_dinode));
brelse(bh);
@@ -843,7 +843,7 @@ static int pick_formal_ino_2(struct gfs2_sbd *sdp, uint64_t *formal_ino)
if (x < y)
gfs2_consist_inode(m_ip);
x = cpu_to_be64(x);
- gfs2_trans_add_bh(m_ip->i_gl, m_bh);
+ gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
*(uint64_t *)(m_bh->b_data + sizeof(struct gfs2_dinode)) = x;
brelse(m_bh);
@@ -852,7 +852,7 @@ static int pick_formal_ino_2(struct gfs2_sbd *sdp, uint64_t *formal_ino)
*formal_ino = ir.ir_start++;
ir.ir_length--;
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_inum_range_out(&ir, bh->b_data + sizeof(struct gfs2_dinode));
out_brelse:
@@ -997,7 +997,7 @@ static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
struct buffer_head *dibh;
dibh = gfs2_meta_new(gl, inum->no_addr);
- gfs2_trans_add_bh(gl, dibh);
+ gfs2_trans_add_bh(gl, dibh, 1);
gfs2_metatype_set(dibh, GFS2_METATYPE_DI, GFS2_FORMAT_DI);
gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode));
di = (struct gfs2_dinode *)dibh->b_data;
@@ -1135,7 +1135,7 @@ static int link_dinode(struct gfs2_inode *dip, struct qstr *name,
if (error)
goto fail_end_trans;
ip->i_di.di_nlink = 1;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
@@ -1601,7 +1601,7 @@ int gfs2_glock_nq_atime(struct gfs2_holder *gh)
ip->i_di.di_atime = curtime;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
@@ -1776,7 +1776,7 @@ __gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr)
gfs2_assert_warn(ip->i_sbd, !error);
gfs2_inode_attr_out(ip);
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
diff --git a/fs/gfs2/jdata.c b/fs/gfs2/jdata.c
index d4adbf171ed3..6caa93e46ce0 100644
--- a/fs/gfs2/jdata.c
+++ b/fs/gfs2/jdata.c
@@ -30,7 +30,7 @@ int gfs2_jdata_get_buffer(struct gfs2_inode *ip, uint64_t block, int new,
if (new) {
bh = gfs2_meta_new(ip->i_gl, block);
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_metatype_set(bh, GFS2_METATYPE_JD, GFS2_FORMAT_JD);
gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header));
} else {
@@ -220,7 +220,7 @@ int gfs2_jdata_read(struct gfs2_inode *ip, char __user *buf, uint64_t offset,
int gfs2_copy_from_mem(struct gfs2_inode *ip, struct buffer_head *bh,
const char **buf, unsigned int offset, unsigned int size)
{
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
memcpy(bh->b_data + offset, *buf, size);
*buf += size;
@@ -243,7 +243,7 @@ int gfs2_copy_from_user(struct gfs2_inode *ip, struct buffer_head *bh,
{
int error = 0;
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
if (copy_from_user(bh->b_data + offset, *buf, size))
error = -EFAULT;
else
@@ -368,7 +368,7 @@ int gfs2_jdata_write(struct gfs2_inode *ip, const char __user *buf, uint64_t off
ip->i_di.di_size = offset + copied;
ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index 177b0246d194..8bbe11855223 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -786,7 +786,7 @@ int gfs2_meta_indirect_buffer(struct gfs2_inode *ip, int height, uint64_t num,
brelse(bh);
return -EIO;
}
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_metatype_set(bh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header));
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 0aa5f140ddb1..d352b3528f5e 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -368,7 +368,7 @@ static int gfs2_commit_write(struct file *file, struct page *page,
if (error)
goto fail;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
kaddr = kmap(page);
memcpy(dibh->b_data + sizeof(struct gfs2_dinode) + from,
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 563c19d0d406..0f356fc4690c 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -456,7 +456,7 @@ static ssize_t do_write_direct_alloc(struct file *file, const char __user *buf,
ip->i_di.di_mode &= (ip->i_di.di_mode & S_IXGRP) ?
(~(S_ISUID | S_ISGID)) : (~S_ISUID);
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -481,7 +481,7 @@ static ssize_t do_write_direct_alloc(struct file *file, const char __user *buf,
ip->i_di.di_size = inode->i_size;
ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
@@ -721,7 +721,7 @@ static ssize_t do_do_write_buf(struct file *file, const char __user *buf, size_t
ip->i_di.di_mode &= (ip->i_di.di_mode & S_IXGRP) ?
(~(S_ISUID | S_ISGID)) : (~S_ISUID);
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -752,7 +752,7 @@ static ssize_t do_do_write_buf(struct file *file, const char __user *buf, size_t
ip->i_di.di_size = inode->i_size;
ip->i_di.di_mtime = ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -1177,7 +1177,7 @@ static int gfs2_ioctl_flags(struct gfs2_inode *ip, unsigned int cmd, unsigned lo
ip->i_di.di_flags = flags;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index d0f90b88380c..89417a6cb723 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -839,7 +839,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
if (error)
goto out_end_trans;
ip->i_di.di_ctime = get_seconds();
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
}
@@ -1043,7 +1043,7 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
gfs2_assert_warn(sdp, !error);
gfs2_inode_attr_out(ip);
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index a0320f22b57b..5fb5a5305e0e 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -527,7 +527,7 @@ static void do_qc(struct gfs2_quota_data *qd, int64_t change)
int64_t x;
down(&sdp->sd_quota_mutex);
- gfs2_trans_add_bh(ip->i_gl, qd->qd_bh);
+ gfs2_trans_add_bh(ip->i_gl, qd->qd_bh, 1);
if (!test_bit(QDF_CHANGE, &qd->qd_flags)) {
qc->qc_change = 0;
diff --git a/fs/gfs2/resize.c b/fs/gfs2/resize.c
index 67d26b99a73c..a53096682500 100644
--- a/fs/gfs2/resize.c
+++ b/fs/gfs2/resize.c
@@ -255,7 +255,7 @@ int gfs2_rename2system(struct gfs2_inode *ip,
if (error)
goto out_trans;
ip->i_di.di_flags |= GFS2_DIF_SYSTEM;
- gfs2_trans_add_bh(ip->i_gl, dibh);
+ gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(&ip->i_di, dibh->b_data);
brelse(dibh);
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 8df6fba20fac..87c80bbce1cf 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -967,7 +967,7 @@ static uint32_t rgblk_search(struct gfs2_rgrpd *rgd, uint32_t goal,
if (gfs2_assert_withdraw(rgd->rd_sbd, x <= length))
blk = 0;
- gfs2_trans_add_bh(rgd->rd_gl, bi->bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, bi->bi_bh, 1);
gfs2_setbit(rgd,
bi->bi_bh->b_data + bi->bi_offset,
bi->bi_len, blk, new_state);
@@ -1027,7 +1027,7 @@ static struct gfs2_rgrpd *rgblk_free(struct gfs2_sbd *sdp, uint64_t bstart,
bi->bi_bh->b_data + bi->bi_offset,
bi->bi_len);
}
- gfs2_trans_add_bh(rgd->rd_gl, bi->bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, bi->bi_bh, 1);
gfs2_setbit(rgd,
bi->bi_bh->b_data + bi->bi_offset,
bi->bi_len, buf_blk, new_state);
@@ -1066,7 +1066,7 @@ uint64_t gfs2_alloc_data(struct gfs2_inode *ip)
gfs2_assert_withdraw(sdp, rgd->rd_rg.rg_free);
rgd->rd_rg.rg_free--;
- gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
gfs2_rgrp_out(&rgd->rd_rg, rgd->rd_bits[0].bi_bh->b_data);
al->al_alloced++;
@@ -1111,7 +1111,7 @@ uint64_t gfs2_alloc_meta(struct gfs2_inode *ip)
gfs2_assert_withdraw(sdp, rgd->rd_rg.rg_free);
rgd->rd_rg.rg_free--;
- gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
gfs2_rgrp_out(&rgd->rd_rg, rgd->rd_bits[0].bi_bh->b_data);
al->al_alloced++;
@@ -1153,7 +1153,7 @@ uint64_t gfs2_alloc_di(struct gfs2_inode *dip)
rgd->rd_rg.rg_free--;
rgd->rd_rg.rg_dinodes++;
- gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
gfs2_rgrp_out(&rgd->rd_rg, rgd->rd_bits[0].bi_bh->b_data);
al->al_alloced++;
@@ -1187,7 +1187,7 @@ void gfs2_free_data(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
rgd->rd_rg.rg_free += blen;
- gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
gfs2_rgrp_out(&rgd->rd_rg, rgd->rd_bits[0].bi_bh->b_data);
gfs2_trans_add_rg(rgd);
@@ -1216,7 +1216,7 @@ void gfs2_free_meta(struct gfs2_inode *ip, uint64_t bstart, uint32_t blen)
rgd->rd_rg.rg_free += blen;
- gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
gfs2_rgrp_out(&rgd->rd_rg, rgd->rd_bits[0].bi_bh->b_data);
gfs2_trans_add_rg(rgd);
@@ -1242,7 +1242,7 @@ void gfs2_free_uninit_di(struct gfs2_rgrpd *rgd, uint64_t blkno)
rgd->rd_rg.rg_dinodes--;
rgd->rd_rg.rg_free++;
- gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh);
+ gfs2_trans_add_bh(rgd->rd_gl, rgd->rd_bits[0].bi_bh, 1);
gfs2_rgrp_out(&rgd->rd_rg, rgd->rd_bits[0].bi_bh->b_data);
gfs2_statfs_change(sdp, 0, +1, -1);
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index d37f203e133b..cab7ab5fb506 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -608,7 +608,7 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, int64_t total, int64_t free,
return;
down(&sdp->sd_statfs_mutex);
- gfs2_trans_add_bh(l_ip->i_gl, l_bh);
+ gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
up(&sdp->sd_statfs_mutex);
spin_lock(&sdp->sd_statfs_spin);
@@ -659,7 +659,7 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
goto out_bh2;
down(&sdp->sd_statfs_mutex);
- gfs2_trans_add_bh(l_ip->i_gl, l_bh);
+ gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
up(&sdp->sd_statfs_mutex);
spin_lock(&sdp->sd_statfs_spin);
@@ -671,7 +671,7 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
0, sizeof(struct gfs2_statfs_change));
spin_unlock(&sdp->sd_statfs_spin);
- gfs2_trans_add_bh(m_ip->i_gl, m_bh);
+ gfs2_trans_add_bh(m_ip->i_gl, m_bh, 1);
gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode));
gfs2_trans_end(sdp);
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index afa5408c0008..82952fb64830 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -138,10 +138,11 @@ void gfs2_trans_add_gl(struct gfs2_glock *gl)
* gfs2_trans_add_bh - Add a to-be-modified buffer to the current transaction
* @gl: the glock the buffer belongs to
* @bh: The buffer to add
+ * @meta: True in the case of adding metadata
*
*/
-void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh)
+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;
diff --git a/fs/gfs2/trans.h b/fs/gfs2/trans.h
index ac615e9e8521..5a7da1e853c9 100644
--- a/fs/gfs2/trans.h
+++ b/fs/gfs2/trans.h
@@ -31,7 +31,7 @@ int gfs2_trans_begin_i(struct gfs2_sbd *sdp,
void gfs2_trans_end(struct gfs2_sbd *sdp);
void gfs2_trans_add_gl(struct gfs2_glock *gl);
-void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh);
+void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta);
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, uint64_t blkno);
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, uint64_t blkno);
void gfs2_trans_add_rg(struct gfs2_rgrpd *rgd);
diff --git a/fs/gfs2/unlinked.c b/fs/gfs2/unlinked.c
index 4a993af58c1a..b8d836e3a5c0 100644
--- a/fs/gfs2/unlinked.c
+++ b/fs/gfs2/unlinked.c
@@ -47,7 +47,7 @@ static int munge_ondisk(struct gfs2_sbd *sdp, unsigned int slot,
}
down(&sdp->sd_unlinked_mutex);
- gfs2_trans_add_bh(ip->i_gl, bh);
+ gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_unlinked_tag_out(ut, bh->b_data +
sizeof(struct gfs2_meta_header) +
offset * sizeof(struct gfs2_unlinked_tag));