aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r--fs/gfs2/dir.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 93a2e6afbd81..862aa3228f7a 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -906,8 +906,7 @@ static int dir_make_exhash(struct inode *inode)
906 *lp = cpu_to_be64(bn); 906 *lp = cpu_to_be64(bn);
907 907
908 dip->i_di.di_size = sdp->sd_sb.sb_bsize / 2; 908 dip->i_di.di_size = sdp->sd_sb.sb_bsize / 2;
909 dip->i_di.di_blocks++; 909 gfs2_add_inode_blocks(&dip->i_inode, 1);
910 gfs2_set_inode_blocks(&dip->i_inode);
911 dip->i_di.di_flags |= GFS2_DIF_EXHASH; 910 dip->i_di.di_flags |= GFS2_DIF_EXHASH;
912 911
913 for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ; 912 for (x = sdp->sd_hash_ptrs, y = -1; x; x >>= 1, y++) ;
@@ -1045,8 +1044,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
1045 error = gfs2_meta_inode_buffer(dip, &dibh); 1044 error = gfs2_meta_inode_buffer(dip, &dibh);
1046 if (!gfs2_assert_withdraw(GFS2_SB(&dip->i_inode), !error)) { 1045 if (!gfs2_assert_withdraw(GFS2_SB(&dip->i_inode), !error)) {
1047 gfs2_trans_add_bh(dip->i_gl, dibh, 1); 1046 gfs2_trans_add_bh(dip->i_gl, dibh, 1);
1048 dip->i_di.di_blocks++; 1047 gfs2_add_inode_blocks(&dip->i_inode, 1);
1049 gfs2_set_inode_blocks(&dip->i_inode);
1050 gfs2_dinode_out(dip, dibh->b_data); 1048 gfs2_dinode_out(dip, dibh->b_data);
1051 brelse(dibh); 1049 brelse(dibh);
1052 } 1050 }
@@ -1580,8 +1578,7 @@ static int dir_new_leaf(struct inode *inode, const struct qstr *name)
1580 if (error) 1578 if (error)
1581 return error; 1579 return error;
1582 gfs2_trans_add_bh(ip->i_gl, bh, 1); 1580 gfs2_trans_add_bh(ip->i_gl, bh, 1);
1583 ip->i_di.di_blocks++; 1581 gfs2_add_inode_blocks(&ip->i_inode, 1);
1584 gfs2_set_inode_blocks(&ip->i_inode);
1585 gfs2_dinode_out(ip, bh->b_data); 1582 gfs2_dinode_out(ip, bh->b_data);
1586 brelse(bh); 1583 brelse(bh);
1587 return 0; 1584 return 0;
@@ -1922,11 +1919,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len,
1922 brelse(bh); 1919 brelse(bh);
1923 1920
1924 gfs2_free_meta(dip, blk, 1); 1921 gfs2_free_meta(dip, blk, 1);
1925 1922 gfs2_add_inode_blocks(&dip->i_inode, -1);
1926 if (!dip->i_di.di_blocks)
1927 gfs2_consist_inode(dip);
1928 dip->i_di.di_blocks--;
1929 gfs2_set_inode_blocks(&dip->i_inode);
1930 } 1923 }
1931 1924
1932 error = gfs2_dir_write_data(dip, ht, index * sizeof(u64), size); 1925 error = gfs2_dir_write_data(dip, ht, index * sizeof(u64), size);