diff options
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r-- | fs/jbd2/journal.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 81e622681c82..28d05bd9a588 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -805,10 +805,13 @@ int jbd2_journal_bmap(journal_t *journal, unsigned long blocknr, | |||
805 | * But we don't bother doing that, so there will be coherency problems with | 805 | * But we don't bother doing that, so there will be coherency problems with |
806 | * mmaps of blockdevs which hold live JBD-controlled filesystems. | 806 | * mmaps of blockdevs which hold live JBD-controlled filesystems. |
807 | */ | 807 | */ |
808 | struct buffer_head *jbd2_journal_get_descriptor_buffer(journal_t *journal) | 808 | struct buffer_head * |
809 | jbd2_journal_get_descriptor_buffer(transaction_t *transaction, int type) | ||
809 | { | 810 | { |
811 | journal_t *journal = transaction->t_journal; | ||
810 | struct buffer_head *bh; | 812 | struct buffer_head *bh; |
811 | unsigned long long blocknr; | 813 | unsigned long long blocknr; |
814 | journal_header_t *header; | ||
812 | int err; | 815 | int err; |
813 | 816 | ||
814 | err = jbd2_journal_next_log_block(journal, &blocknr); | 817 | err = jbd2_journal_next_log_block(journal, &blocknr); |
@@ -821,6 +824,10 @@ struct buffer_head *jbd2_journal_get_descriptor_buffer(journal_t *journal) | |||
821 | return NULL; | 824 | return NULL; |
822 | lock_buffer(bh); | 825 | lock_buffer(bh); |
823 | memset(bh->b_data, 0, journal->j_blocksize); | 826 | memset(bh->b_data, 0, journal->j_blocksize); |
827 | header = (journal_header_t *)bh->b_data; | ||
828 | header->h_magic = cpu_to_be32(JBD2_MAGIC_NUMBER); | ||
829 | header->h_blocktype = cpu_to_be32(type); | ||
830 | header->h_sequence = cpu_to_be32(transaction->t_tid); | ||
824 | set_buffer_uptodate(bh); | 831 | set_buffer_uptodate(bh); |
825 | unlock_buffer(bh); | 832 | unlock_buffer(bh); |
826 | BUFFER_TRACE(bh, "return this buffer"); | 833 | BUFFER_TRACE(bh, "return this buffer"); |