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/ext4 | |
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/ext4')
-rw-r--r-- | fs/ext4/super.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 26147746c272..7f47c366bf15 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2831,15 +2831,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2831 | * Test whether we have more sectors than will fit in sector_t, | 2831 | * Test whether we have more sectors than will fit in sector_t, |
2832 | * and whether the max offset is addressable by the page cache. | 2832 | * and whether the max offset is addressable by the page cache. |
2833 | */ | 2833 | */ |
2834 | if ((ext4_blocks_count(es) > | 2834 | ret = generic_check_addressable(sb->s_blocksize_bits, |
2835 | (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) || | 2835 | ext4_blocks_count(es)); |
2836 | (ext4_blocks_count(es) > | 2836 | if (ret) { |
2837 | (pgoff_t)(~0ULL) >> (PAGE_CACHE_SHIFT - sb->s_blocksize_bits))) { | ||
2838 | ext4_msg(sb, KERN_ERR, "filesystem" | 2837 | ext4_msg(sb, KERN_ERR, "filesystem" |
2839 | " too large to mount safely on this system"); | 2838 | " too large to mount safely on this system"); |
2840 | if (sizeof(sector_t) < 8) | 2839 | if (sizeof(sector_t) < 8) |
2841 | ext4_msg(sb, KERN_WARNING, "CONFIG_LBDAF not enabled"); | 2840 | ext4_msg(sb, KERN_WARNING, "CONFIG_LBDAF not enabled"); |
2842 | ret = -EFBIG; | ||
2843 | goto failed_mount; | 2841 | goto failed_mount; |
2844 | } | 2842 | } |
2845 | 2843 | ||