• Home
  • Raw
  • Download

Lines Matching refs:journal

39 static int do_one_pass(journal_t *journal,
67 static int do_readahead(journal_t *journal, unsigned int start) in do_readahead() argument
77 max = start + (128 * 1024 / journal->j_blocksize); in do_readahead()
78 if (max > journal->j_maxlen) in do_readahead()
79 max = journal->j_maxlen; in do_readahead()
87 err = jbd2_journal_bmap(journal, next, &blocknr); in do_readahead()
95 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in do_readahead()
129 static int jread(struct buffer_head **bhp, journal_t *journal, in jread() argument
138 if (offset >= journal->j_maxlen) { in jread()
143 err = jbd2_journal_bmap(journal, offset, &blocknr); in jread()
151 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in jread()
159 do_readahead(journal, offset); in jread()
197 static int count_tags(journal_t *journal, struct buffer_head *bh) in count_tags() argument
201 int nr = 0, size = journal->j_blocksize; in count_tags()
202 int tag_bytes = journal_tag_bytes(journal); in count_tags()
204 if (jbd2_journal_has_csum_v2or3(journal)) in count_tags()
226 #define wrap(journal, var) \ argument
228 if (var >= (journal)->j_last) \
229 var -= ((journal)->j_last - (journal)->j_first); \
244 int jbd2_journal_recover(journal_t *journal) in jbd2_journal_recover() argument
254 sb = journal->j_superblock; in jbd2_journal_recover()
265 journal->j_transaction_sequence = be32_to_cpu(sb->s_sequence) + 1; in jbd2_journal_recover()
270 mapping = journal->j_fs_dev->bd_inode->i_mapping; in jbd2_journal_recover()
272 err = do_one_pass(journal, &info, PASS_SCAN); in jbd2_journal_recover()
274 err = do_one_pass(journal, &info, PASS_REVOKE); in jbd2_journal_recover()
276 err = do_one_pass(journal, &info, PASS_REPLAY); in jbd2_journal_recover()
286 journal->j_transaction_sequence = ++info.end_transaction; in jbd2_journal_recover()
288 jbd2_journal_clear_revoke(journal); in jbd2_journal_recover()
289 err2 = sync_blockdev(journal->j_fs_dev); in jbd2_journal_recover()
296 if (journal->j_flags & JBD2_BARRIER) { in jbd2_journal_recover()
297 err2 = blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); in jbd2_journal_recover()
317 int jbd2_journal_skip_recovery(journal_t *journal) in jbd2_journal_skip_recovery() argument
325 err = do_one_pass(journal, &info, PASS_SCAN); in jbd2_journal_skip_recovery()
329 ++journal->j_transaction_sequence; in jbd2_journal_skip_recovery()
333 be32_to_cpu(journal->j_superblock->s_sequence); in jbd2_journal_skip_recovery()
338 journal->j_transaction_sequence = ++info.end_transaction; in jbd2_journal_skip_recovery()
341 journal->j_tail = 0; in jbd2_journal_skip_recovery()
345 static inline unsigned long long read_tag_block(journal_t *journal, in read_tag_block() argument
349 if (jbd2_has_feature_64bit(journal)) in read_tag_block()
358 static int calc_chksums(journal_t *journal, struct buffer_head *bh, in calc_chksums() argument
365 num_blks = count_tags(journal, bh); in calc_chksums()
371 wrap(journal, *next_log_block); in calc_chksums()
372 err = jread(&obh, journal, io_block); in calc_chksums()
424 static int do_one_pass(journal_t *journal, in do_one_pass() argument
435 int tag_bytes = journal_tag_bytes(journal); in do_one_pass()
446 sb = journal->j_superblock; in do_one_pass()
481 next_commit_ID, next_log_block, journal->j_last); in do_one_pass()
488 err = jread(&bh, journal, next_log_block); in do_one_pass()
493 wrap(journal, next_log_block); in do_one_pass()
525 if (jbd2_journal_has_csum_v2or3(journal)) in do_one_pass()
529 !jbd2_descriptor_block_csum_verify(journal, in do_one_pass()
545 jbd2_has_feature_checksum(journal) && in do_one_pass()
547 if (calc_chksums(journal, bh, in do_one_pass()
556 next_log_block += count_tags(journal, bh); in do_one_pass()
557 wrap(journal, next_log_block); in do_one_pass()
568 <= journal->j_blocksize - descr_csum_size) { in do_one_pass()
575 wrap(journal, next_log_block); in do_one_pass()
576 err = jread(&obh, journal, io_block); in do_one_pass()
589 blocknr = read_tag_block(journal, in do_one_pass()
596 (journal, blocknr, in do_one_pass()
605 journal, tag, obh->b_data, in do_one_pass()
619 nbh = __getblk(journal->j_fs_dev, in do_one_pass()
621 journal->j_blocksize); in do_one_pass()
634 journal->j_blocksize); in do_one_pass()
700 jbd2_has_feature_checksum(journal)) { in do_one_pass()
710 journal->j_failed_commit = in do_one_pass()
740 if (!jbd2_has_feature_async_commit(journal)) { in do_one_pass()
741 journal->j_failed_commit = in do_one_pass()
750 !jbd2_commit_block_csum_verify(journal, in do_one_pass()
754 if (!jbd2_has_feature_async_commit(journal)) { in do_one_pass()
755 journal->j_failed_commit = in do_one_pass()
773 err = scan_revoke_records(journal, bh, in do_one_pass()
820 static int scan_revoke_records(journal_t *journal, struct buffer_head *bh, in scan_revoke_records() argument
833 if (!jbd2_descriptor_block_csum_verify(journal, header)) in scan_revoke_records()
836 if (jbd2_journal_has_csum_v2or3(journal)) in scan_revoke_records()
838 if (rcount > journal->j_blocksize - csum_size) in scan_revoke_records()
842 if (jbd2_has_feature_64bit(journal)) in scan_revoke_records()
854 err = jbd2_journal_set_revoke(journal, blocknr, sequence); in scan_revoke_records()