aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <alexandre.ratchov@bull.net>2006-10-11 04:21:14 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:18 -0400
commit0d1ee42f27d30eed1659f3e85bcbbc7b3711f61f (patch)
tree9477b1b1813e67e9a0a06af13c91a34c23c42bc8 /fs/ext4/super.c
parent18eba7aae080d4a5c0d850ea810e83d11f0a8d77 (diff)
[PATCH] ext4: allow larger descriptor size
make block group descriptor larger. Signed-off-by: Alexandre Ratchov <alexandre.ratchov@bull.net> Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d844175e60e8..bc8848bff2f1 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1268,7 +1268,8 @@ static int ext4_check_descriptors (struct super_block * sb)
1268 return 0; 1268 return 0;
1269 } 1269 }
1270 first_block += EXT4_BLOCKS_PER_GROUP(sb); 1270 first_block += EXT4_BLOCKS_PER_GROUP(sb);
1271 gdp++; 1271 gdp = (struct ext4_group_desc *)
1272 ((__u8 *)gdp + EXT4_DESC_SIZE(sb));
1272 } 1273 }
1273 1274
1274 ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); 1275 ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb));
@@ -1619,7 +1620,18 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1619 sbi->s_frag_size, blocksize); 1620 sbi->s_frag_size, blocksize);
1620 goto failed_mount; 1621 goto failed_mount;
1621 } 1622 }
1622 sbi->s_frags_per_block = 1; 1623 sbi->s_desc_size = le16_to_cpu(es->s_desc_size);
1624 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT)) {
1625 if (sbi->s_desc_size < EXT4_MIN_DESC_SIZE ||
1626 sbi->s_desc_size > EXT4_MAX_DESC_SIZE ||
1627 sbi->s_desc_size & (sbi->s_desc_size - 1)) {
1628 printk(KERN_ERR
1629 "EXT4-fs: unsupported descriptor size %ld\n",
1630 sbi->s_desc_size);
1631 goto failed_mount;
1632 }
1633 } else
1634 sbi->s_desc_size = EXT4_MIN_DESC_SIZE;
1623 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group); 1635 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group);
1624 sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group); 1636 sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group);
1625 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group); 1637 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
@@ -1630,7 +1642,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1630 goto cantfind_ext4; 1642 goto cantfind_ext4;
1631 sbi->s_itb_per_group = sbi->s_inodes_per_group / 1643 sbi->s_itb_per_group = sbi->s_inodes_per_group /
1632 sbi->s_inodes_per_block; 1644 sbi->s_inodes_per_block;
1633 sbi->s_desc_per_block = blocksize / sizeof(struct ext4_group_desc); 1645 sbi->s_desc_per_block = blocksize / EXT4_DESC_SIZE(sb);
1634 sbi->s_sbh = bh; 1646 sbi->s_sbh = bh;
1635 sbi->s_mount_state = le16_to_cpu(es->s_state); 1647 sbi->s_mount_state = le16_to_cpu(es->s_state);
1636 sbi->s_addr_per_block_bits = log2(EXT4_ADDR_PER_BLOCK(sb)); 1648 sbi->s_addr_per_block_bits = log2(EXT4_ADDR_PER_BLOCK(sb));