diff options
author | Jan Kara <jack@suse.cz> | 2016-02-23 07:19:09 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-02-23 07:19:09 +0300 |
commit | 1101cd4d13ba2f42c5da4c1b9081f35a73b5df31 (patch) | |
tree | c7808f5f15396fba6e5e3e68209bbe4bf4cd073f /fs/jbd2/commit.c | |
parent | 32ab671599a89534f37e97d146c27690e371b661 (diff) | |
download | linux-1101cd4d13ba2f42c5da4c1b9081f35a73b5df31.tar.xz |
jbd2: unify revoke and tag block checksum handling
Revoke and tag descriptor blocks are just different kinds of descriptor
blocks and thus have checksum in the same place. Unify computation and
checking of checksums for these.
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/commit.c')
-rw-r--r-- | fs/jbd2/commit.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index cf221f3d955a..ae832cd44dd8 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -317,22 +317,6 @@ static void write_tag_block(journal_t *j, journal_block_tag_t *tag, tag->t_blocknr_high = cpu_to_be32((block >> 31) >> 1); } -static void jbd2_descr_block_csum_set(journal_t *j, - struct buffer_head *bh) -{ - struct jbd2_journal_block_tail *tail; - __u32 csum; - - if (!jbd2_journal_has_csum_v2or3(j)) - return; - - tail = (struct jbd2_journal_block_tail *)(bh->b_data + j->j_blocksize - - sizeof(struct jbd2_journal_block_tail)); - tail->t_checksum = 0; - csum = jbd2_chksum(j, j->j_csum_seed, bh->b_data, j->j_blocksize); - tail->t_checksum = cpu_to_be32(csum); -} - static void jbd2_block_tag_csum_set(journal_t *j, journal_block_tag_t *tag, struct buffer_head *bh, __u32 sequence) { @@ -714,7 +698,7 @@ void jbd2_journal_commit_transaction(journal_t *journal) tag->t_flags |= cpu_to_be16(JBD2_FLAG_LAST_TAG); - jbd2_descr_block_csum_set(journal, descriptor); + jbd2_descriptor_block_csum_set(journal, descriptor); start_journal_io: for (i = 0; i < bufs; i++) { struct buffer_head *bh = wbuf[i]; |