aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorAvantika Mathur <mathur@us.ibm.com>2008-01-28 23:58:27 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-01-28 23:58:27 -0500
commitfd2d42912f9f09e5250cb3b024ee0625704e9cb7 (patch)
tree23e85123e8cc06d518fd7cff665f93429e19e4e2 /fs/ext4/super.c
parentbba907433b85ba2adae1bb3b6fd29b4e5f35c468 (diff)
ext4: add ext4_group_t, and change all group variables to this type.
In many places variables for block group are of type int, which limits the maximum number of block groups to 2^31. Each block group can have up to 2^15 blocks, with a 4K block size, and the max filesystem size is limited to 2^31 * (2^15 * 2^12) = 2^58 -- or 256 PB This patch introduces a new type ext4_group_t, of type unsigned long, to represent block group numbers in ext4. All occurrences of block group variables are converted to type ext4_group_t. Signed-off-by: Avantika Mathur <mathur@us.ibm.com>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6302b036c121..df8842b43544 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1364,7 +1364,7 @@ static int ext4_check_descriptors (struct super_block * sb)
1364 struct ext4_group_desc * gdp = NULL; 1364 struct ext4_group_desc * gdp = NULL;
1365 int desc_block = 0; 1365 int desc_block = 0;
1366 int flexbg_flag = 0; 1366 int flexbg_flag = 0;
1367 int i; 1367 ext4_group_t i;
1368 1368
1369 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) 1369 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))
1370 flexbg_flag = 1; 1370 flexbg_flag = 1;
@@ -1386,7 +1386,7 @@ static int ext4_check_descriptors (struct super_block * sb)
1386 if (block_bitmap < first_block || block_bitmap > last_block) 1386 if (block_bitmap < first_block || block_bitmap > last_block)
1387 { 1387 {
1388 ext4_error (sb, "ext4_check_descriptors", 1388 ext4_error (sb, "ext4_check_descriptors",
1389 "Block bitmap for group %d" 1389 "Block bitmap for group %lu"
1390 " not in group (block %llu)!", 1390 " not in group (block %llu)!",
1391 i, block_bitmap); 1391 i, block_bitmap);
1392 return 0; 1392 return 0;
@@ -1395,7 +1395,7 @@ static int ext4_check_descriptors (struct super_block * sb)
1395 if (inode_bitmap < first_block || inode_bitmap > last_block) 1395 if (inode_bitmap < first_block || inode_bitmap > last_block)
1396 { 1396 {
1397 ext4_error (sb, "ext4_check_descriptors", 1397 ext4_error (sb, "ext4_check_descriptors",
1398 "Inode bitmap for group %d" 1398 "Inode bitmap for group %lu"
1399 " not in group (block %llu)!", 1399 " not in group (block %llu)!",
1400 i, inode_bitmap); 1400 i, inode_bitmap);
1401 return 0; 1401 return 0;
@@ -1405,17 +1405,16 @@ static int ext4_check_descriptors (struct super_block * sb)
1405 inode_table + sbi->s_itb_per_group - 1 > last_block) 1405 inode_table + sbi->s_itb_per_group - 1 > last_block)
1406 { 1406 {
1407 ext4_error (sb, "ext4_check_descriptors", 1407 ext4_error (sb, "ext4_check_descriptors",
1408 "Inode table for group %d" 1408 "Inode table for group %lu"
1409 " not in group (block %llu)!", 1409 " not in group (block %llu)!",
1410 i, inode_table); 1410 i, inode_table);
1411 return 0; 1411 return 0;
1412 } 1412 }
1413 if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { 1413 if (!ext4_group_desc_csum_verify(sbi, i, gdp)) {
1414 ext4_error(sb, __FUNCTION__, 1414 ext4_error(sb, __FUNCTION__,
1415 "Checksum for group %d failed (%u!=%u)\n", i, 1415 "Checksum for group %lu failed (%u!=%u)\n",
1416 le16_to_cpu(ext4_group_desc_csum(sbi, i, 1416 i, le16_to_cpu(ext4_group_desc_csum(sbi, i,
1417 gdp)), 1417 gdp)), le16_to_cpu(gdp->bg_checksum));
1418 le16_to_cpu(gdp->bg_checksum));
1419 return 0; 1418 return 0;
1420 } 1419 }
1421 if (!flexbg_flag) 1420 if (!flexbg_flag)
@@ -1429,7 +1428,6 @@ static int ext4_check_descriptors (struct super_block * sb)
1429 return 1; 1428 return 1;
1430} 1429}
1431 1430
1432
1433/* ext4_orphan_cleanup() walks a singly-linked list of inodes (starting at 1431/* ext4_orphan_cleanup() walks a singly-linked list of inodes (starting at
1434 * the superblock) which were deleted from all directories, but held open by 1432 * the superblock) which were deleted from all directories, but held open by
1435 * a process at the time of a crash. We walk the list and try to delete these 1433 * a process at the time of a crash. We walk the list and try to delete these
@@ -1570,7 +1568,7 @@ static ext4_fsblk_t descriptor_loc(struct super_block *sb,
1570 ext4_fsblk_t logical_sb_block, int nr) 1568 ext4_fsblk_t logical_sb_block, int nr)
1571{ 1569{
1572 struct ext4_sb_info *sbi = EXT4_SB(sb); 1570 struct ext4_sb_info *sbi = EXT4_SB(sb);
1573 unsigned long bg, first_meta_bg; 1571 ext4_group_t bg, first_meta_bg;
1574 int has_super = 0; 1572 int has_super = 0;
1575 1573
1576 first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg); 1574 first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg);
@@ -2678,7 +2676,7 @@ static int ext4_statfs (struct dentry * dentry, struct kstatfs * buf)
2678 if (test_opt(sb, MINIX_DF)) { 2676 if (test_opt(sb, MINIX_DF)) {
2679 sbi->s_overhead_last = 0; 2677 sbi->s_overhead_last = 0;
2680 } else if (sbi->s_blocks_last != ext4_blocks_count(es)) { 2678 } else if (sbi->s_blocks_last != ext4_blocks_count(es)) {
2681 unsigned long ngroups = sbi->s_groups_count, i; 2679 ext4_group_t ngroups = sbi->s_groups_count, i;
2682 ext4_fsblk_t overhead = 0; 2680 ext4_fsblk_t overhead = 0;
2683 smp_rmb(); 2681 smp_rmb();
2684 2682