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);
}
/* 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));
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);
/* 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));
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++;
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);
}
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;
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);
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);
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;
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);
}
}
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);
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
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);
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 +
/* 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));
/* 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));
/* 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));
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;
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;
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);
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);
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;
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);
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;
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);
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);
}
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++) {
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);
}
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));
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++;
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);
}
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;
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);
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:
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);
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);
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;
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);
}
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,
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));
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);
}
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;
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);
}
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);
}
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);
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);
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);
*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:
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;
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);
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);
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);
}
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 {
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;
{
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
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);
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));
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,
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);
}
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);
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);
}
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);
}
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);
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);
}
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);
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;
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);
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);
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);
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++;
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++;
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++;
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);
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);
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);
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);
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);
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);
* 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;
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);
}
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));