aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.h
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/inode.h
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/inode.h')
-rw-r--r--fs/gfs2/inode.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h
index 300ada3f21de..15ff4df20aab 100644
--- a/fs/gfs2/inode.h
+++ b/fs/gfs2/inode.h
@@ -80,6 +80,19 @@ static inline void gfs2_inum_out(const struct gfs2_inode *ip,
80 dent->de_inum.no_addr = cpu_to_be64(ip->i_no_addr); 80 dent->de_inum.no_addr = cpu_to_be64(ip->i_no_addr);
81} 81}
82 82
83static inline int gfs2_check_internal_file_size(struct inode *inode,
84 u64 minsize, u64 maxsize)
85{
86 u64 size = i_size_read(inode);
87 if (size < minsize || size > maxsize)
88 goto err;
89 if (size & ((1 << inode->i_blkbits) - 1))
90 goto err;
91 return 0;
92err:
93 gfs2_consist_inode(GFS2_I(inode));
94 return -EIO;
95}
83 96
84extern void gfs2_set_iop(struct inode *inode); 97extern void gfs2_set_iop(struct inode *inode);
85extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, 98extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type,