]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ocfs2: use s_maxbytes directly in ocfs2_change_file_space()
authorMark Fasheh <mark.fasheh@oracle.com>
Fri, 20 Jul 2007 18:28:30 +0000 (11:28 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Fri, 10 Aug 2007 00:25:07 +0000 (17:25 -0700)
There's no need to recalculate things via ocfs2_max_file_offset() as we've
already done that to fill s_maxbytes, so use that instead. We can also
un-export ocfs2_max_file_offset() then.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/file.c
fs/ocfs2/super.c
fs/ocfs2/super.h

index 992eb567cb4da90d7ded401cc3068ec7315b60d3..7e508e2942cac11baee7041a9c0a985d33be4dea 100644 (file)
@@ -1533,7 +1533,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
        struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
        struct buffer_head *di_bh = NULL;
        handle_t *handle;
-       unsigned long long max_off = ocfs2_max_file_offset(inode->i_sb->s_blocksize_bits);
+       unsigned long long max_off = inode->i_sb->s_maxbytes;
 
        if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
                return -EROFS;
index 200c7d4790dc187a7a6e60b30ff4a36b9f55cc59..a100b488533e00dcd01a2d4c8aa78e1fd6aed24c 100644 (file)
@@ -319,7 +319,7 @@ static void ocfs2_destroy_inode(struct inode *inode)
 /* From xfs_super.c:xfs_max_file_offset
  * Copyright (c) 2000-2004 Silicon Graphics, Inc.
  */
-unsigned long long ocfs2_max_file_offset(unsigned int blockshift)
+static unsigned long long ocfs2_max_file_offset(unsigned int blockshift)
 {
        unsigned int pagefactor = 1;
        unsigned int bitshift = BITS_PER_LONG - 1;
index 3b9cb3d0b0081e5835306e5eafe36ba2da7f0399..783f5270f2a165c3c90ef1d54d014e9662174b00 100644 (file)
@@ -45,6 +45,4 @@ void __ocfs2_abort(struct super_block *sb,
 
 #define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##args)
 
-unsigned long long ocfs2_max_file_offset(unsigned int blockshift);
-
 #endif /* OCFS2_SUPER_H */