diff options
Diffstat (limited to 'fs/gfs2/eattr.c')
-rw-r--r-- | fs/gfs2/eattr.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c index 0e79cd543496..76ead1acfcc7 100644 --- a/fs/gfs2/eattr.c +++ b/fs/gfs2/eattr.c | |||
@@ -277,10 +277,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, | |||
277 | } | 277 | } |
278 | 278 | ||
279 | *dataptrs = 0; | 279 | *dataptrs = 0; |
280 | if (!ip->i_di.di_blocks) | 280 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
281 | gfs2_consist_inode(ip); | ||
282 | ip->i_di.di_blocks--; | ||
283 | gfs2_set_inode_blocks(&ip->i_inode); | ||
284 | } | 281 | } |
285 | if (bstart) | 282 | if (bstart) |
286 | gfs2_free_meta(ip, bstart, blen); | 283 | gfs2_free_meta(ip, bstart, blen); |
@@ -598,8 +595,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp) | |||
598 | ea->ea_flags = GFS2_EAFLAG_LAST; | 595 | ea->ea_flags = GFS2_EAFLAG_LAST; |
599 | ea->ea_num_ptrs = 0; | 596 | ea->ea_num_ptrs = 0; |
600 | 597 | ||
601 | ip->i_di.di_blocks++; | 598 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
602 | gfs2_set_inode_blocks(&ip->i_inode); | ||
603 | 599 | ||
604 | return 0; | 600 | return 0; |
605 | } | 601 | } |
@@ -651,8 +647,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, | |||
651 | gfs2_trans_add_bh(ip->i_gl, bh, 1); | 647 | gfs2_trans_add_bh(ip->i_gl, bh, 1); |
652 | gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED); | 648 | gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED); |
653 | 649 | ||
654 | ip->i_di.di_blocks++; | 650 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
655 | gfs2_set_inode_blocks(&ip->i_inode); | ||
656 | 651 | ||
657 | copy = data_len > sdp->sd_jbsize ? sdp->sd_jbsize : | 652 | copy = data_len > sdp->sd_jbsize ? sdp->sd_jbsize : |
658 | data_len; | 653 | data_len; |
@@ -980,8 +975,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
980 | *eablk = cpu_to_be64(ip->i_di.di_eattr); | 975 | *eablk = cpu_to_be64(ip->i_di.di_eattr); |
981 | ip->i_di.di_eattr = blk; | 976 | ip->i_di.di_eattr = blk; |
982 | ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; | 977 | ip->i_di.di_flags |= GFS2_DIF_EA_INDIRECT; |
983 | ip->i_di.di_blocks++; | 978 | gfs2_add_inode_blocks(&ip->i_inode, 1); |
984 | gfs2_set_inode_blocks(&ip->i_inode); | ||
985 | 979 | ||
986 | eablk++; | 980 | eablk++; |
987 | } | 981 | } |
@@ -1389,10 +1383,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip) | |||
1389 | } | 1383 | } |
1390 | 1384 | ||
1391 | *eablk = 0; | 1385 | *eablk = 0; |
1392 | if (!ip->i_di.di_blocks) | 1386 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
1393 | gfs2_consist_inode(ip); | ||
1394 | ip->i_di.di_blocks--; | ||
1395 | gfs2_set_inode_blocks(&ip->i_inode); | ||
1396 | } | 1387 | } |
1397 | if (bstart) | 1388 | if (bstart) |
1398 | gfs2_free_meta(ip, bstart, blen); | 1389 | gfs2_free_meta(ip, bstart, blen); |
@@ -1444,10 +1435,7 @@ static int ea_dealloc_block(struct gfs2_inode *ip) | |||
1444 | gfs2_free_meta(ip, ip->i_di.di_eattr, 1); | 1435 | gfs2_free_meta(ip, ip->i_di.di_eattr, 1); |
1445 | 1436 | ||
1446 | ip->i_di.di_eattr = 0; | 1437 | ip->i_di.di_eattr = 0; |
1447 | if (!ip->i_di.di_blocks) | 1438 | gfs2_add_inode_blocks(&ip->i_inode, -1); |
1448 | gfs2_consist_inode(ip); | ||
1449 | ip->i_di.di_blocks--; | ||
1450 | gfs2_set_inode_blocks(&ip->i_inode); | ||
1451 | 1439 | ||
1452 | error = gfs2_meta_inode_buffer(ip, &dibh); | 1440 | error = gfs2_meta_inode_buffer(ip, &dibh); |
1453 | if (!error) { | 1441 | if (!error) { |