diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-02-12 09:17:27 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:40:55 -0400 |
commit | 77658aad226866fb94097236d14d41a88aaab2ec (patch) | |
tree | 2849313fccb193bd3c4f93f241fd5fb98ad871ca /fs/gfs2/dir.c | |
parent | 30cbf189cd2a1ba13ff3c8c8ee2103dbdb18578a (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/dir.c')
-rw-r--r-- | fs/gfs2/dir.c | 15 |
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); |