Actually, this is wrong. The ext2 inode limit is 2^32 512-byte sectors,
not 2^32 blocksize blocks. Yes this is a wart and Ted wants to fix it, as
soon as we have something else important enough to require an incompatible
change to ext2. As it is, we are limited to 2TB files for now, which is no
loss because we only support 2TB devices in 2.4 anyways. When we change to
2^32 filesystem blocks, we will again be limited by indirect blocks, except
for 8kB block filesystems on Alpha/ia64 at 32TB.
+/*
+ * Maximal file size. There is a direct, and {,double-,triple-}indirect
+ * block limit, and also a limit of (2^32 - 1) 512-byte sectors in i_blocks.
+ * We need to be 1 filesystem block less than the 2^32 sector limit.
+ */
+static loff_t ext2_max_size(int bits)
+{
+ loff_t res = EXT2_NDIR_BLOCKS;
+ res += 1LL << (bits-2);
+ res += 1LL << (2*(bits-2));
+ res += 1LL << (3*(bits-2));
+ res << bits;
+ if (res > (512LL << 32) - (1 << bits))
+ res = (512LL << 32) - (1 << bits);
+ return res;
+}
Cheers, Andreas
-- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/