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 = 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 = 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 * journal_recover - recovers a on-disk journal
215 * @journal: the journal to recover
225 int 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 journal_clear_revoke(journal);
265 sync_blockdev(journal->j_fs_dev);
270 * journal_skip_recovery - Start journal and wipe exiting records
271 * @journal: journal to startup
273 * Locate any valid recovery information from the journal and set up the
274 * journal structures in memory to ignore it (presumably because the
278 * We perform one pass over the journal to allow us to tell the user how
280 * the journal transaction sequence numbers to the next unused ID.
282 int journal_skip_recovery(journal_t *journal)
290 sb = journal->j_superblock;
292 err = do_one_pass(journal, &info, PASS_SCAN);
295 printk(KERN_ERR "JBD: error %d scanning journal\n", err);
296 ++journal->j_transaction_sequence;
302 "JBD: ignoring %d transaction%s from the journal.\n",
304 journal->j_transaction_sequence = ++info.end_transaction;
307 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);
369 MAX_BLOCKS_PER_DESC = ((journal->j_blocksize-sizeof(journal_header_t))
378 sb = journal->j_superblock;
413 next_commit_ID, next_log_block, journal->j_last);
420 err = jread(&bh, journal, next_log_block);
425 wrap(journal, next_log_block);
462 JFS_HAS_COMPAT_FEATURE(journal,
465 if (calc_chksums(journal, bh,
474 next_log_block += count_tags(journal, bh);
475 wrap(journal, next_log_block);
486 <= journal->j_blocksize) {
493 wrap(journal, next_log_block);
494 err = jread(&obh, journal, io_block);
513 (journal, blocknr,
522 nbh = __getblk(journal->j_fs_dev,
524 journal->j_blocksize);
537 journal->j_blocksize);
570 * and journal corruption ?
605 JFS_HAS_COMPAT_FEATURE(journal,
618 journal->j_failed_commit =
636 * get a situation where the journal flag has
649 if (!JFS_HAS_INCOMPAT_FEATURE(journal,
651 journal->j_failed_commit =
671 err = scan_revoke_records(journal, bh,
718 static int scan_revoke_records(journal_t *journal, struct buffer_head *bh,
734 err = journal_set_revoke(journal, blocknr, sequence);