Lines Matching refs:journal
42 static int do_one_pass(journal_t *journal,
70 static int do_readahead(journal_t *journal, unsigned int start) in do_readahead() argument
80 max = start + (128 * 1024 / journal->j_blocksize); in do_readahead()
81 if (max > journal->j_maxlen) in do_readahead()
82 max = journal->j_maxlen; in do_readahead()
90 err = journal_bmap(journal, next, &blocknr); in do_readahead()
98 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in do_readahead()
153 static int jread(struct buffer_head **bhp, journal_t *journal, in jread() argument
162 if (offset >= journal->j_maxlen) { in jread()
167 err = journal_bmap(journal, offset, &blocknr); in jread()
175 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in jread()
183 do_readahead(journal, offset); in jread()
222 static int count_tags(journal_t *journal, struct buffer_head *bh) in count_tags() argument
226 int nr = 0, size = journal->j_blocksize; in count_tags()
227 int tag_bytes = journal_tag_bytes(journal); in count_tags()
229 if (journal_has_csum_v2or3(journal)) in count_tags()
251 #define wrap(journal, var) \ argument
253 if (var >= (journal)->j_last) \
254 var -= ((journal)->j_last - (journal)->j_first); \
269 int journal_recover(journal_t *journal) in journal_recover() argument
277 sb = journal->j_superblock; in journal_recover()
288 journal->j_transaction_sequence = ext2fs_be32_to_cpu(sb->s_sequence) + 1; in journal_recover()
292 err = do_one_pass(journal, &info, PASS_SCAN); in journal_recover()
294 err = do_one_pass(journal, &info, PASS_REVOKE); in journal_recover()
296 err = do_one_pass(journal, &info, PASS_REPLAY); in journal_recover()
306 journal->j_transaction_sequence = ++info.end_transaction; in journal_recover()
308 journal_clear_revoke(journal); in journal_recover()
309 err2 = sync_blockdev(journal->j_fs_dev); in journal_recover()
313 if (journal->j_flags & JFS_BARRIER) { in journal_recover()
314 err2 = blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); in journal_recover()
334 int journal_skip_recovery(journal_t *journal) in journal_skip_recovery() argument
342 err = do_one_pass(journal, &info, PASS_SCAN); in journal_skip_recovery()
346 ++journal->j_transaction_sequence; in journal_skip_recovery()
350 ext2fs_be32_to_cpu(journal->j_superblock->s_sequence); in journal_skip_recovery()
355 journal->j_transaction_sequence = ++info.end_transaction; in journal_skip_recovery()
358 journal->j_tail = 0; in journal_skip_recovery()
362 static inline unsigned long long read_tag_block(journal_t *journal, in read_tag_block() argument
366 if (jfs_has_feature_64bit(journal)) in read_tag_block()
375 static int calc_chksums(journal_t *journal, struct buffer_head *bh, in calc_chksums() argument
382 num_blks = count_tags(journal, bh); in calc_chksums()
388 wrap(journal, *next_log_block); in calc_chksums()
389 err = jread(&obh, journal, io_block); in calc_chksums()
441 static int do_one_pass(journal_t *journal, in do_one_pass() argument
452 int tag_bytes = journal_tag_bytes(journal); in do_one_pass()
463 sb = journal->j_superblock; in do_one_pass()
498 next_commit_ID, next_log_block, journal->j_last); in do_one_pass()
505 err = jread(&bh, journal, next_log_block); in do_one_pass()
510 wrap(journal, next_log_block); in do_one_pass()
542 if (journal_has_csum_v2or3(journal)) in do_one_pass()
546 !jbd2_descr_block_csum_verify(journal, in do_one_pass()
559 jfs_has_feature_checksum(journal) && in do_one_pass()
561 if (calc_chksums(journal, bh, in do_one_pass()
570 next_log_block += count_tags(journal, bh); in do_one_pass()
571 wrap(journal, next_log_block); in do_one_pass()
582 <= journal->j_blocksize - descr_csum_size) { in do_one_pass()
589 wrap(journal, next_log_block); in do_one_pass()
590 err = jread(&obh, journal, io_block); in do_one_pass()
603 blocknr = read_tag_block(journal, in do_one_pass()
610 (journal, blocknr, in do_one_pass()
619 journal, tag, obh->b_data, in do_one_pass()
633 nbh = __getblk(journal->j_fs_dev, in do_one_pass()
635 journal->j_blocksize); in do_one_pass()
648 journal->j_blocksize); in do_one_pass()
715 jfs_has_feature_checksum(journal)) { in do_one_pass()
725 journal->j_failed_commit = in do_one_pass()
755 if (!jfs_has_feature_async_commit(journal)){ in do_one_pass()
756 journal->j_failed_commit = in do_one_pass()
765 !jbd2_commit_block_csum_verify(journal, in do_one_pass()
769 if (!jfs_has_feature_async_commit(journal)) { in do_one_pass()
770 journal->j_failed_commit = in do_one_pass()
788 err = scan_revoke_records(journal, bh, in do_one_pass()
855 static int scan_revoke_records(journal_t *journal, struct buffer_head *bh, in scan_revoke_records() argument
868 if (!jbd2_revoke_block_csum_verify(journal, header)) in scan_revoke_records()
871 if (journal_has_csum_v2or3(journal)) in scan_revoke_records()
873 if (rcount > journal->j_blocksize - csum_size) in scan_revoke_records()
877 if (jfs_has_feature_64bit(journal)) in scan_revoke_records()
889 err = journal_set_revoke(journal, blocknr, sequence); in scan_revoke_records()