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 = jbd2_journal_bmap(journal, next, &blocknr); in do_readahead()
98 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in do_readahead()
132 static int jread(struct buffer_head **bhp, journal_t *journal, in jread() argument
141 if (offset >= journal->j_maxlen) { in jread()
146 err = jbd2_journal_bmap(journal, offset, &blocknr); in jread()
154 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in jread()
162 do_readahead(journal, offset); in jread()
182 static int count_tags(journal_t *journal, struct buffer_head *bh) in count_tags() argument
186 int nr = 0, size = journal->j_blocksize; in count_tags()
187 int tag_bytes = journal_tag_bytes(journal); in count_tags()
208 #define wrap(journal, var) \ argument
210 if (var >= (journal)->j_last) \
211 var -= ((journal)->j_last - (journal)->j_first); \
226 int jbd2_journal_recover(journal_t *journal) in jbd2_journal_recover() argument
234 sb = journal->j_superblock; in jbd2_journal_recover()
245 journal->j_transaction_sequence = be32_to_cpu(sb->s_sequence) + 1; in jbd2_journal_recover()
249 err = do_one_pass(journal, &info, PASS_SCAN); in jbd2_journal_recover()
251 err = do_one_pass(journal, &info, PASS_REVOKE); in jbd2_journal_recover()
253 err = do_one_pass(journal, &info, PASS_REPLAY); in jbd2_journal_recover()
263 journal->j_transaction_sequence = ++info.end_transaction; in jbd2_journal_recover()
265 jbd2_journal_clear_revoke(journal); in jbd2_journal_recover()
266 err2 = sync_blockdev(journal->j_fs_dev); in jbd2_journal_recover()
270 if (journal->j_flags & JBD2_BARRIER) in jbd2_journal_recover()
271 blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); in jbd2_journal_recover()
288 int jbd2_journal_skip_recovery(journal_t *journal) in jbd2_journal_skip_recovery() argument
296 err = do_one_pass(journal, &info, PASS_SCAN); in jbd2_journal_skip_recovery()
300 ++journal->j_transaction_sequence; in jbd2_journal_skip_recovery()
304 be32_to_cpu(journal->j_superblock->s_sequence); in jbd2_journal_skip_recovery()
309 journal->j_transaction_sequence = ++info.end_transaction; in jbd2_journal_skip_recovery()
312 journal->j_tail = 0; in jbd2_journal_skip_recovery()
328 static int calc_chksums(journal_t *journal, struct buffer_head *bh, in calc_chksums() argument
335 num_blks = count_tags(journal, bh); in calc_chksums()
341 wrap(journal, *next_log_block); in calc_chksums()
342 err = jread(&obh, journal, io_block); in calc_chksums()
356 static int do_one_pass(journal_t *journal, in do_one_pass() argument
367 int tag_bytes = journal_tag_bytes(journal); in do_one_pass()
376 sb = journal->j_superblock; in do_one_pass()
411 next_commit_ID, next_log_block, journal->j_last); in do_one_pass()
418 err = jread(&bh, journal, next_log_block); in do_one_pass()
423 wrap(journal, next_log_block); in do_one_pass()
460 JBD2_HAS_COMPAT_FEATURE(journal, in do_one_pass()
463 if (calc_chksums(journal, bh, in do_one_pass()
472 next_log_block += count_tags(journal, bh); in do_one_pass()
473 wrap(journal, next_log_block); in do_one_pass()
484 <= journal->j_blocksize) { in do_one_pass()
491 wrap(journal, next_log_block); in do_one_pass()
492 err = jread(&obh, journal, io_block); in do_one_pass()
512 (journal, blocknr, in do_one_pass()
521 nbh = __getblk(journal->j_fs_dev, in do_one_pass()
523 journal->j_blocksize); in do_one_pass()
536 journal->j_blocksize); in do_one_pass()
602 JBD2_HAS_COMPAT_FEATURE(journal, in do_one_pass()
613 journal->j_failed_commit = in do_one_pass()
643 if (!JBD2_HAS_INCOMPAT_FEATURE(journal, in do_one_pass()
645 journal->j_failed_commit = in do_one_pass()
665 err = scan_revoke_records(journal, bh, in do_one_pass()
712 static int scan_revoke_records(journal_t *journal, struct buffer_head *bh, in scan_revoke_records() argument
723 if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) in scan_revoke_records()
735 err = jbd2_journal_set_revoke(journal, blocknr, sequence); in scan_revoke_records()