aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-02-12 09:17:27 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-03-31 05:40:55 -0400
commit77658aad226866fb94097236d14d41a88aaab2ec (patch)
tree2849313fccb193bd3c4f93f241fd5fb98ad871ca /fs/gfs2/eattr.c
parent30cbf189cd2a1ba13ff3c8c8ee2103dbdb18578a (diff)
[GFS2] Eliminate (almost) duplicate field from gfs2_inode
The blocks counter is almost a duplicate of the i_blocks field in the VFS inode. The only difference is that i_blocks can be only 32bits long for 32bit arch without large single file support. Since GFS2 doesn't handle the non-large single file case (for 32 bit anyway) this adds a new config dependency on 64BIT || LSF. This has always been the case, however we've never explicitly said so before. Even if we do add support for the non-LSF case, we will still not require this field to be duplicated since we will not be able to access oversized files anyway. So the net result of all this is that we shave 8 bytes from a gfs2_inode and get our config deps correct. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/eattr.c')
-rw-r--r--fs/gfs2/eattr.c24
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) {