aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2010-08-11 04:53:11 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2010-09-20 06:18:29 -0400
commita2e0f79939e09e74698564b88dee709db208e1e2 (patch)
tree0018e445e3d47c4558901153733899ef672f789e /fs/gfs2/ops_inode.c
parentff8f33c8b30d7b7efdcf2548c7f6e64db6a89b29 (diff)
GFS2: Remove i_disksize
With the update of the truncate code, ip->i_disksize and inode->i_size are merely copies of each other. This means we can remove ip->i_disksize and use inode->i_size exclusively reducing the size of a GFS2 inode by 8 bytes. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r--fs/gfs2/ops_inode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 1d3f2fb466bd..ee6ffd590418 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -406,7 +406,6 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry,
406 406
407 ip = ghs[1].gh_gl->gl_object; 407 ip = ghs[1].gh_gl->gl_object;
408 408
409 ip->i_disksize = size;
410 i_size_write(inode, size); 409 i_size_write(inode, size);
411 410
412 error = gfs2_meta_inode_buffer(ip, &dibh); 411 error = gfs2_meta_inode_buffer(ip, &dibh);
@@ -461,7 +460,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode)
461 ip = ghs[1].gh_gl->gl_object; 460 ip = ghs[1].gh_gl->gl_object;
462 461
463 ip->i_inode.i_nlink = 2; 462 ip->i_inode.i_nlink = 2;
464 ip->i_disksize = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode); 463 i_size_write(inode, sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode));
465 ip->i_diskflags |= GFS2_DIF_JDATA; 464 ip->i_diskflags |= GFS2_DIF_JDATA;
466 ip->i_entries = 2; 465 ip->i_entries = 2;
467 466
@@ -990,7 +989,7 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
990 struct gfs2_inode *ip = GFS2_I(dentry->d_inode); 989 struct gfs2_inode *ip = GFS2_I(dentry->d_inode);
991 struct gfs2_holder i_gh; 990 struct gfs2_holder i_gh;
992 struct buffer_head *dibh; 991 struct buffer_head *dibh;
993 unsigned int x; 992 unsigned int x, size;
994 char *buf; 993 char *buf;
995 int error; 994 int error;
996 995
@@ -1002,7 +1001,8 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
1002 return NULL; 1001 return NULL;
1003 } 1002 }
1004 1003
1005 if (!ip->i_disksize) { 1004 size = (unsigned int)i_size_read(&ip->i_inode);
1005 if (size == 0) {
1006 gfs2_consist_inode(ip); 1006 gfs2_consist_inode(ip);
1007 buf = ERR_PTR(-EIO); 1007 buf = ERR_PTR(-EIO);
1008 goto out; 1008 goto out;
@@ -1014,7 +1014,7 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
1014 goto out; 1014 goto out;
1015 } 1015 }
1016 1016
1017 x = ip->i_disksize + 1; 1017 x = size + 1;
1018 buf = kmalloc(x, GFP_NOFS); 1018 buf = kmalloc(x, GFP_NOFS);
1019 if (!buf) 1019 if (!buf)
1020 buf = ERR_PTR(-ENOMEM); 1020 buf = ERR_PTR(-ENOMEM);