diff options
author | Patrick J. LoPresti <lopresti@gmail.com> | 2010-07-22 18:03:41 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-09-10 11:41:42 -0400 |
commit | 30ca22c70e3ef0a96ff84de69cd7e8561b416cb2 (patch) | |
tree | 0da339bf657ae19a39baf3c4d31ebfb0ae6c09ce /fs/ext3 | |
parent | 729963a1ff8d069d05dab6a024bfd59805ac622c (diff) |
ext3/ext4: Factor out disk addressability check
As part of adding support for OCFS2 to mount huge volumes, we need to
check that the sector_t and page cache of the system are capable of
addressing the entire volume.
An identical check already appears in ext3 and ext4. This patch moves
the addressability check into its own function in fs/libfs.c and
modifies ext3 and ext4 to invoke it.
[Edited to -EINVAL instead of BUG_ON() for bad blocksize_bits -- Joel]
Signed-off-by: Patrick LoPresti <lopresti@gmail.com>
Cc: linux-ext4@vger.kernel.org
Acked-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/super.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 5dbf4dba03c4..a367dd044280 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -1849,8 +1849,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
1849 | goto failed_mount; | 1849 | goto failed_mount; |
1850 | } | 1850 | } |
1851 | 1851 | ||
1852 | if (le32_to_cpu(es->s_blocks_count) > | 1852 | if (generic_check_addressable(sb->s_blocksize_bits, |
1853 | (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) { | 1853 | le32_to_cpu(es->s_blocks_count))) { |
1854 | ext3_msg(sb, KERN_ERR, | 1854 | ext3_msg(sb, KERN_ERR, |
1855 | "error: filesystem is too large to mount safely"); | 1855 | "error: filesystem is too large to mount safely"); |
1856 | if (sizeof(sector_t) < 8) | 1856 | if (sizeof(sector_t) < 8) |