• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/fs/jbd2/

Lines Matching refs:journal

41 static int do_one_pass(journal_t *journal,
57 * When reading from the journal, we are going through the block device
69 static int do_readahead(journal_t *journal, unsigned int start)
79 max = start + (128 * 1024 / journal->j_blocksize);
80 if (max > journal->j_maxlen)
81 max = journal->j_maxlen;
89 err = jbd2_journal_bmap(journal, next, &blocknr);
97 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
128 * Read a block from the journal
131 static int jread(struct buffer_head **bhp, journal_t *journal,
140 if (offset >= journal->j_maxlen) {
141 printk(KERN_ERR "JBD: corrupted journal superblock\n");
145 err = jbd2_journal_bmap(journal, offset, &blocknr);
153 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
161 do_readahead(journal, offset);
178 * Count the number of in-use tags in a journal descriptor block.
181 static int count_tags(journal_t *journal, struct buffer_head *bh)
185 int nr = 0, size = journal->j_blocksize;
186 int tag_bytes = journal_tag_bytes(journal);
207 #define wrap(journal, var) \
209 if (var >= (journal)->j_last) \
210 var -= ((journal)->j_last - (journal)->j_first); \
214 * jbd2_journal_recover - recovers a on-disk journal
215 * @journal: the journal to recover
225 int jbd2_journal_recover(journal_t *journal)
233 sb = journal->j_superblock;
236 * The journal superblock's s_start field (the current log head)
237 * is always zero if, and only if, the journal was cleanly
244 journal->j_transaction_sequence = be32_to_cpu(sb->s_sequence) + 1;
248 err = do_one_pass(journal, &info, PASS_SCAN);
250 err = do_one_pass(journal, &info, PASS_REVOKE);
252 err = do_one_pass(journal, &info, PASS_REPLAY);
262 journal->j_transaction_sequence = ++info.end_transaction;
264 jbd2_journal_clear_revoke(journal);
265 err2 = sync_blockdev(journal->j_fs_dev);
273 * jbd2_journal_skip_recovery - Start journal and wipe exiting records
274 * @journal: journal to startup
276 * Locate any valid recovery information from the journal and set up the
277 * journal structures in memory to ignore it (presumably because the
281 * We perform one pass over the journal to allow us to tell the user how
283 * the journal transaction sequence numbers to the next unused ID.
285 int jbd2_journal_skip_recovery(journal_t *journal)
293 err = do_one_pass(journal, &info, PASS_SCAN);
296 printk(KERN_ERR "JBD: error %d scanning journal\n", err);
297 ++journal->j_transaction_sequence;
301 be32_to_cpu(journal->j_superblock->s_sequence);
304 "JBD: ignoring %d transaction%s from the journal.\n",
306 journal->j_transaction_sequence = ++info.end_transaction;
309 journal->j_tail = 0;
325 static int calc_chksums(journal_t *journal, struct buffer_head *bh,
332 num_blks = count_tags(journal, bh);
338 wrap(journal, *next_log_block);
339 err = jread(&obh, journal, io_block);
353 static int do_one_pass(journal_t *journal,
364 int tag_bytes = journal_tag_bytes(journal);
373 sb = journal->j_superblock;
408 next_commit_ID, next_log_block, journal->j_last);
415 err = jread(&bh, journal, next_log_block);
420 wrap(journal, next_log_block);
457 JBD2_HAS_COMPAT_FEATURE(journal,
460 if (calc_chksums(journal, bh,
469 next_log_block += count_tags(journal, bh);
470 wrap(journal, next_log_block);
481 <= journal->j_blocksize) {
488 wrap(journal, next_log_block);
489 err = jread(&obh, journal, io_block);
509 (journal, blocknr,
518 nbh = __getblk(journal->j_fs_dev,
520 journal->j_blocksize);
533 journal->j_blocksize);
564 * and journal corruption ?
599 JBD2_HAS_COMPAT_FEATURE(journal,
610 journal->j_failed_commit =
628 * get a situation where the journal flag has
640 if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
642 journal->j_failed_commit =
662 err = scan_revoke_records(journal, bh,
709 static int scan_revoke_records(journal_t *journal, struct buffer_head *bh,
720 if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT))
732 err = jbd2_journal_set_revoke(journal, blocknr, sequence);