aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/balloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2012-04-29 18:45:10 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-04-29 18:45:10 -0400
commitfeb0ab32a57e4e6c8b24f6fb68f0ce08efe4603c (patch)
tree6438fc46013c2f5d60e78060c66e2809c6056f1a /fs/ext4/balloc.c
parentcc8e94fd126ab2d2e4bcb1b65c7316196f0cec8c (diff)
ext4: make block group checksums use metadata_csum algorithm
metadata_csum supersedes uninit_bg. Convert the ROCOMPAT uninit_bg flag check to a helper function that covers both, and make the checksum calculation algorithm use either crc16 or the metadata_csum chosen algorithm depending on which flag is set. Print a warning if we try to mount a filesystem with both feature flags set. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r--fs/ext4/balloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 0a64e4d5dbad..5745d53c67e8 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -168,7 +168,7 @@ void ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
168 168
169 /* If checksum is bad mark all blocks used to prevent allocation 169 /* If checksum is bad mark all blocks used to prevent allocation
170 * essentially implementing a per-group read-only flag. */ 170 * essentially implementing a per-group read-only flag. */
171 if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { 171 if (!ext4_group_desc_csum_verify(sb, block_group, gdp)) {
172 ext4_error(sb, "Checksum bad for group %u", block_group); 172 ext4_error(sb, "Checksum bad for group %u", block_group);
173 ext4_free_group_clusters_set(sb, gdp, 0); 173 ext4_free_group_clusters_set(sb, gdp, 0);
174 ext4_free_inodes_set(sb, gdp, 0); 174 ext4_free_inodes_set(sb, gdp, 0);
@@ -214,7 +214,7 @@ void ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
214 sb->s_blocksize * 8, bh->b_data); 214 sb->s_blocksize * 8, bh->b_data);
215 ext4_block_bitmap_csum_set(sb, block_group, gdp, bh, 215 ext4_block_bitmap_csum_set(sb, block_group, gdp, bh,
216 EXT4_BLOCKS_PER_GROUP(sb) / 8); 216 EXT4_BLOCKS_PER_GROUP(sb) / 8);
217 gdp->bg_checksum = ext4_group_desc_csum(sbi, block_group, gdp); 217 ext4_group_desc_csum_set(sb, block_group, gdp);
218} 218}
219 219
220/* Return the number of free blocks in a block group. It is used when 220/* Return the number of free blocks in a block group. It is used when