aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.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/bmap.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/bmap.c')
-rw-r--r--fs/gfs2/bmap.c18
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)