Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a00cce35 authored by Mark Fasheh's avatar Mark Fasheh
Browse files

ocfs2: use s_maxbytes directly in ocfs2_change_file_space()



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: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent c11e9faf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+0 −2
Original line number Diff line number Diff line
@@ -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 */