aboutsummaryrefslogtreecommitdiffstats
path: root/debugfs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2019-11-08 20:26:05 -0500
committerTheodore Ts'o <tytso@mit.edu>2019-11-09 01:55:14 -0500
commit1942e33c812a030ba0a0a9bff2e8527159d44749 (patch)
treeeeaa5dbf1a6705056023a78178d3a35feb603aed /debugfs
parentbe259fa50a908df8db016e3e3796d24cdc12884f (diff)
downloade2fsprogs-1942e33c812a030ba0a0a9bff2e8527159d44749.tar.gz
Sync kernel's unification of jbd2 revoke and tag block checksum handling
Commit 1101cd4d13ba ("jbd2: unify revoke and tag block checksum handling") cleans up the fact that the jbd2_journal_revoke_tail and jbd2_journal_block_tail structures are basically the same. So it drops the definition of struct jbd2_journal_revoke_tail and unifies the functions which calculates and verifies the checksums for revoke blocks and tag blocks. Make the same changes in e2fsprogs so eliminate unnecessary differences in e2fsck/recovery.c and e2fsck/revoke.c. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'debugfs')
-rw-r--r--debugfs/do_journal.c4
-rw-r--r--debugfs/journal.c12
2 files changed, 3 insertions, 13 deletions
diff --git a/debugfs/do_journal.c b/debugfs/do_journal.c
index ee6d16bfa..48b2149c3 100644
--- a/debugfs/do_journal.c
+++ b/debugfs/do_journal.c
@@ -181,7 +181,7 @@ static errcode_t journal_add_revoke_to_trans(journal_transaction_t *trans,
/* Do we need to leave space at the end for a checksum? */
if (jbd2_journal_has_csum_v2or3(trans->journal))
- csum_size = sizeof(struct journal_revoke_tail);
+ csum_size = sizeof(struct jbd2_journal_block_tail);
curr_blk = trans->block;
@@ -419,7 +419,7 @@ static blk64_t journal_guess_blocks(journal_t *journal, blk64_t data_blocks,
/* Estimate # of revoke blocks */
bs = journal->j_blocksize;
if (jbd2_journal_has_csum_v2or3(journal))
- bs -= sizeof(struct journal_revoke_tail);
+ bs -= sizeof(struct jbd2_journal_block_tail);
sz = jbd2_has_feature_64bit(journal) ? sizeof(__u64) : sizeof(__u32);
ret += revoke_blocks * sz / bs;
diff --git a/debugfs/journal.c b/debugfs/journal.c
index fd4ccf2bb..7908e98aa 100644
--- a/debugfs/journal.c
+++ b/debugfs/journal.c
@@ -889,17 +889,7 @@ void jbd2_commit_block_csum_set(journal_t *j, struct buffer_head *bh)
void jbd2_revoke_csum_set(journal_t *j, struct buffer_head *bh)
{
- struct journal_revoke_tail *tail;
- __u32 csum;
-
- if (!jbd2_journal_has_csum_v2or3(j))
- return;
-
- tail = (struct journal_revoke_tail *)(bh->b_data + j->j_blocksize -
- sizeof(struct journal_revoke_tail));
- tail->r_checksum = 0;
- csum = jbd2_chksum(j, j->j_csum_seed, bh->b_data, j->j_blocksize);
- tail->r_checksum = ext2fs_cpu_to_be32(csum);
+ jbd2_descr_block_csum_set(j, bh);
}
void jbd2_descr_block_csum_set(journal_t *j, struct buffer_head *bh)