diff options
Diffstat (limited to 'fs/gfs2/inode.h')
-rw-r--r-- | fs/gfs2/inode.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 300ada3f21de..6720d7d5fbc6 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
@@ -19,6 +19,8 @@ extern int gfs2_releasepage(struct page *page, gfp_t gfp_mask); | |||
19 | extern int gfs2_internal_read(struct gfs2_inode *ip, | 19 | extern int gfs2_internal_read(struct gfs2_inode *ip, |
20 | struct file_ra_state *ra_state, | 20 | struct file_ra_state *ra_state, |
21 | char *buf, loff_t *pos, unsigned size); | 21 | char *buf, loff_t *pos, unsigned size); |
22 | extern void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page, | ||
23 | unsigned int from, unsigned int to); | ||
22 | extern void gfs2_set_aops(struct inode *inode); | 24 | extern void gfs2_set_aops(struct inode *inode); |
23 | 25 | ||
24 | static inline int gfs2_is_stuffed(const struct gfs2_inode *ip) | 26 | static inline int gfs2_is_stuffed(const struct gfs2_inode *ip) |
@@ -80,6 +82,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); | 82 | dent->de_inum.no_addr = cpu_to_be64(ip->i_no_addr); |
81 | } | 83 | } |
82 | 84 | ||
85 | static inline int gfs2_check_internal_file_size(struct inode *inode, | ||
86 | u64 minsize, u64 maxsize) | ||
87 | { | ||
88 | u64 size = i_size_read(inode); | ||
89 | if (size < minsize || size > maxsize) | ||
90 | goto err; | ||
91 | if (size & ((1 << inode->i_blkbits) - 1)) | ||
92 | goto err; | ||
93 | return 0; | ||
94 | err: | ||
95 | gfs2_consist_inode(GFS2_I(inode)); | ||
96 | return -EIO; | ||
97 | } | ||
83 | 98 | ||
84 | extern void gfs2_set_iop(struct inode *inode); | 99 | extern void gfs2_set_iop(struct inode *inode); |
85 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, | 100 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, |