diff options
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r-- | fs/gfs2/bmap.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 6780aa5841b2..e27e66046f0a 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -161,9 +161,8 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page) | |||
161 | 161 | ||
162 | if (ip->i_di.di_size) { | 162 | if (ip->i_di.di_size) { |
163 | *(__be64 *)(di + 1) = cpu_to_be64(block); | 163 | *(__be64 *)(di + 1) = cpu_to_be64(block); |
164 | ip->i_di.di_blocks++; | 164 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
165 | gfs2_set_inode_blocks(&ip->i_inode); | 165 | di->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); |
166 | di->di_blocks = cpu_to_be64(ip->i_di.di_blocks); | ||
167 | } | 166 | } |
168 | 167 | ||
169 | ip->i_height = 1; | 168 | ip->i_height = 1; |
@@ -238,10 +237,9 @@ static int build_height(struct inode *inode, struct metapath *mp, unsigned heigh | |||
238 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); | 237 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); |
239 | *(__be64 *)(di + 1) = cpu_to_be64(bn); | 238 | *(__be64 *)(di + 1) = cpu_to_be64(bn); |
240 | ip->i_height += new_height; | 239 | ip->i_height += new_height; |
241 | ip->i_di.di_blocks += new_height; | 240 | gfs2_add_inode_blocks(&ip->i_inode, new_height); |
242 | gfs2_set_inode_blocks(&ip->i_inode); | ||
243 | di->di_height = cpu_to_be16(ip->i_height); | 241 | di->di_height = cpu_to_be16(ip->i_height); |
244 | di->di_blocks = cpu_to_be64(ip->i_di.di_blocks); | 242 | di->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode)); |
245 | brelse(dibh); | 243 | brelse(dibh); |
246 | return error; | 244 | return error; |
247 | } | 245 | } |
@@ -380,8 +378,7 @@ static int lookup_block(struct gfs2_inode *ip, unsigned int height, | |||
380 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); | 378 | gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); |
381 | 379 | ||
382 | *ptr = cpu_to_be64(*block); | 380 | *ptr = cpu_to_be64(*block); |
383 | ip->i_di.di_blocks++; | 381 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
384 | gfs2_set_inode_blocks(&ip->i_inode); | ||
385 | 382 | ||
386 | *new = 1; | 383 | *new = 1; |
387 | return 0; | 384 | return 0; |
@@ -779,10 +776,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
779 | } | 776 | } |
780 | 777 | ||
781 | *p = 0; | 778 | *p = 0; |
782 | if (!ip->i_di.di_blocks) | 779 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
783 | gfs2_consist_inode(ip); | ||
784 | ip->i_di.di_blocks--; | ||
785 | gfs2_set_inode_blocks(&ip->i_inode); | ||
786 | } | 780 | } |
787 | if (bstart) { | 781 | if (bstart) { |
788 | if (metadata) | 782 | if (metadata) |