Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89511
b: refs/heads/master
c: 5731be5
h: refs/heads/master
i:
  89509: b1f1551
  89507: 09f4b04
  89503: 8ce8af7
v: v3
  • Loading branch information
Steven Whitehouse committed Mar 31, 2008
1 parent 3775ac0 commit 29303e4
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac576cc5bed0dd7759e2b196468c7df93d6aeeee
refs/heads/master: 5731be53e3d82aedd06e02574f833a57b07a08d2
7 changes: 5 additions & 2 deletions trunk/fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)

if (isdir) {
block = gfs2_alloc_meta(ip);

gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1);
error = gfs2_dir_get_new_buffer(ip, block, &bh);
if (error)
goto out_brelse;
Expand Down Expand Up @@ -206,6 +206,7 @@ static int build_height(struct inode *inode, struct metapath *mp, unsigned heigh

for(n = 0; n < new_height; n++) {
bn = gfs2_alloc_meta(ip);
gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1);
mp->mp_bh[n] = gfs2_meta_new(ip->i_gl, bn);
gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[n], 1);
}
Expand Down Expand Up @@ -370,8 +371,10 @@ static int lookup_block(struct gfs2_inode *ip, unsigned int height,

if (height == ip->i_height - 1 && !gfs2_is_dir(ip))
*block = gfs2_alloc_data(ip);
else
else {
*block = gfs2_alloc_meta(ip);
gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), *block, 1);
}

gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1);

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh,
struct qstr name = { .name = "", .len = 0, .hash = 0 };
if (!bh)
return NULL;

gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1);
gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_metatype_set(bh, GFS2_METATYPE_LF, GFS2_FORMAT_LF);
leaf = (struct gfs2_leaf *)bh->b_data;
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/gfs2/eattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp)
u64 block;

block = gfs2_alloc_meta(ip);

gfs2_trans_add_unrevoke(sdp, block, 1);
*bhp = gfs2_meta_new(ip->i_gl, block);
gfs2_trans_add_bh(ip->i_gl, *bhp, 1);
gfs2_metatype_set(*bhp, GFS2_METATYPE_EA, GFS2_FORMAT_EA);
Expand Down Expand Up @@ -644,7 +644,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
int mh_size = sizeof(struct gfs2_meta_header);

block = gfs2_alloc_meta(ip);

gfs2_trans_add_unrevoke(sdp, block, 1);
bh = gfs2_meta_new(ip->i_gl, block);
gfs2_trans_add_bh(ip->i_gl, bh, 1);
gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED);
Expand Down Expand Up @@ -968,7 +968,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
u64 blk;

blk = gfs2_alloc_meta(ip);

gfs2_trans_add_unrevoke(sdp, blk, 1);
indbh = gfs2_meta_new(ip->i_gl, blk);
gfs2_trans_add_bh(ip->i_gl, indbh, 1);
gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,6 @@ u64 gfs2_alloc_meta(struct gfs2_inode *ip)

gfs2_statfs_change(sdp, 0, -1, 0);
gfs2_quota_change(ip, +1, ip->i_inode.i_uid, ip->i_inode.i_gid);
gfs2_trans_add_unrevoke(sdp, block);

spin_lock(&sdp->sd_rindex_spin);
rgd->rd_free_clone--;
Expand Down Expand Up @@ -1528,7 +1527,7 @@ u64 gfs2_alloc_di(struct gfs2_inode *dip, u64 *generation)
al->al_alloced++;

gfs2_statfs_change(sdp, 0, -1, +1);
gfs2_trans_add_unrevoke(sdp, block);
gfs2_trans_add_unrevoke(sdp, block, 1);

spin_lock(&sdp->sd_rindex_spin);
rgd->rd_free_clone--;
Expand Down
25 changes: 10 additions & 15 deletions trunk/fs/gfs2/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,30 +146,25 @@ void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
lops_add(sdp, &bd->bd_le);
}

void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno)
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len)
{
struct gfs2_bufdata *bd;
int found = 0;
struct gfs2_bufdata *bd, *tmp;
struct gfs2_trans *tr = current->journal_info;
unsigned int n = len;

gfs2_log_lock(sdp);

list_for_each_entry(bd, &sdp->sd_log_le_revoke, bd_le.le_list) {
if (bd->bd_blkno == blkno) {
list_for_each_entry_safe(bd, tmp, &sdp->sd_log_le_revoke, bd_le.le_list) {
if ((bd->bd_blkno >= blkno) && (bd->bd_blkno < (blkno + len))) {
list_del_init(&bd->bd_le.le_list);
gfs2_assert_withdraw(sdp, sdp->sd_log_num_revoke);
sdp->sd_log_num_revoke--;
found = 1;
break;
kmem_cache_free(gfs2_bufdata_cachep, bd);
tr->tr_num_revoke_rm++;
if (--n == 0)
break;
}
}

gfs2_log_unlock(sdp);

if (found) {
struct gfs2_trans *tr = current->journal_info;
kmem_cache_free(gfs2_bufdata_cachep, bd);
tr->tr_num_revoke_rm++;
}
}

void gfs2_trans_add_rg(struct gfs2_rgrpd *rgd)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/gfs2/trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void gfs2_trans_end(struct gfs2_sbd *sdp);

void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta);
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd);
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno);
void gfs2_trans_add_unrevoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len);
void gfs2_trans_add_rg(struct gfs2_rgrpd *rgd);

#endif /* __TRANS_DOT_H__ */

0 comments on commit 29303e4

Please sign in to comment.