aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.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/inode.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/inode.c')
-rw-r--r--fs/gfs2/inode.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index c3fe8aa03c4e..5f50dd53bf63 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -273,8 +273,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
273 ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink); 273 ip->i_inode.i_nlink = be32_to_cpu(str->di_nlink);
274 di->di_size = be64_to_cpu(str->di_size); 274 di->di_size = be64_to_cpu(str->di_size);
275 i_size_write(&ip->i_inode, di->di_size); 275 i_size_write(&ip->i_inode, di->di_size);
276 di->di_blocks = be64_to_cpu(str->di_blocks); 276 gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks));
277 gfs2_set_inode_blocks(&ip->i_inode);
278 ip->i_inode.i_atime.tv_sec = be64_to_cpu(str->di_atime); 277 ip->i_inode.i_atime.tv_sec = be64_to_cpu(str->di_atime);
279 ip->i_inode.i_atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); 278 ip->i_inode.i_atime.tv_nsec = be32_to_cpu(str->di_atime_nsec);
280 ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); 279 ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime);
@@ -344,7 +343,7 @@ int gfs2_dinode_dealloc(struct gfs2_inode *ip)
344 struct gfs2_rgrpd *rgd; 343 struct gfs2_rgrpd *rgd;
345 int error; 344 int error;
346 345
347 if (ip->i_di.di_blocks != 1) { 346 if (gfs2_get_inode_blocks(&ip->i_inode) != 1) {
348 if (gfs2_consist_inode(ip)) 347 if (gfs2_consist_inode(ip))
349 gfs2_dinode_print(ip); 348 gfs2_dinode_print(ip);
350 return -EIO; 349 return -EIO;
@@ -1398,7 +1397,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
1398 str->di_gid = cpu_to_be32(ip->i_inode.i_gid); 1397 str->di_gid = cpu_to_be32(ip->i_inode.i_gid);
1399 str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink); 1398 str->di_nlink = cpu_to_be32(ip->i_inode.i_nlink);
1400 str->di_size = cpu_to_be64(di->di_size); 1399 str->di_size = cpu_to_be64(di->di_size);
1401 str->di_blocks = cpu_to_be64(di->di_blocks); 1400 str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(&ip->i_inode));
1402 str->di_atime = cpu_to_be64(ip->i_inode.i_atime.tv_sec); 1401 str->di_atime = cpu_to_be64(ip->i_inode.i_atime.tv_sec);
1403 str->di_mtime = cpu_to_be64(ip->i_inode.i_mtime.tv_sec); 1402 str->di_mtime = cpu_to_be64(ip->i_inode.i_mtime.tv_sec);
1404 str->di_ctime = cpu_to_be64(ip->i_inode.i_ctime.tv_sec); 1403 str->di_ctime = cpu_to_be64(ip->i_inode.i_ctime.tv_sec);
@@ -1430,8 +1429,8 @@ void gfs2_dinode_print(const struct gfs2_inode *ip)
1430 printk(KERN_INFO " no_addr = %llu\n", 1429 printk(KERN_INFO " no_addr = %llu\n",
1431 (unsigned long long)ip->i_no_addr); 1430 (unsigned long long)ip->i_no_addr);
1432 printk(KERN_INFO " di_size = %llu\n", (unsigned long long)di->di_size); 1431 printk(KERN_INFO " di_size = %llu\n", (unsigned long long)di->di_size);
1433 printk(KERN_INFO " di_blocks = %llu\n", 1432 printk(KERN_INFO " blocks = %llu\n",
1434 (unsigned long long)di->di_blocks); 1433 (unsigned long long)gfs2_get_inode_blocks(&ip->i_inode));
1435 printk(KERN_INFO " i_goal = %llu\n", 1434 printk(KERN_INFO " i_goal = %llu\n",
1436 (unsigned long long)ip->i_goal); 1435 (unsigned long long)ip->i_goal);
1437 printk(KERN_INFO " di_flags = 0x%.8X\n", di->di_flags); 1436 printk(KERN_INFO " di_flags = 0x%.8X\n", di->di_flags);