50static void journal_brelse_array(
struct buffer_head *
b[],
int n)
74 unsigned long blocknr;
80 max =
start + (128 * 1024 / journal->j_blocksize);
81 if (
max > journal->j_maxlen)
82 max = journal->j_maxlen;
98 bh =
__getblk(journal->j_dev, blocknr, journal->j_blocksize);
104 if (!buffer_uptodate(bh) && !buffer_locked(bh)) {
106 if (nbufs == MAXBUF) {
108 journal_brelse_array(
bufs, nbufs);
121 journal_brelse_array(
bufs, nbufs);
136 unsigned long blocknr;
141 if (
offset >= journal->j_maxlen) {
154 bh =
__getblk(journal->j_dev, blocknr, journal->j_blocksize);
158 if (!buffer_uptodate(bh)) {
166 if (!buffer_uptodate(bh)) {
207#define wrap(journal, var) \
209 if (var >= (journal)->j_last) \
210 var -= ((journal)->j_last - (journal)->j_first); \
233 sb = journal->j_superblock;
242 jbd_debug(1,
"No recovery required, last transaction %d\n",
244 journal->j_transaction_sequence =
be32_to_cpu(
sb->s_sequence) + 1;
254 jbd_debug(1,
"JBD: recovery, exit status %d, "
255 "recovered transactions %u to %u\n",
256 err,
info.start_transaction,
info.end_transaction);
257 jbd_debug(1,
"JBD: Replayed %d and revoked %d/%d blocks\n",
262 journal->j_transaction_sequence = ++
info.end_transaction;
290 sb = journal->j_superblock;
296 ++journal->j_transaction_sequence;
298#ifdef CONFIG_JBD_DEBUG
301 "JBD: ignoring %d transaction%s from the journal.\n",
304 journal->j_transaction_sequence = ++
info.end_transaction;
314 unsigned int first_commit_ID, next_commit_ID;
315 unsigned long next_log_block;
324 int MAX_BLOCKS_PER_DESC;
334 sb = journal->j_superblock;
338 first_commit_ID = next_commit_ID;
340 info->start_transaction = first_commit_ID;
342 jbd_debug(1,
"Starting recovery pass %d\n",
pass);
365 if (
tid_geq(next_commit_ID,
info->end_transaction))
368 jbd_debug(2,
"Scanning for sequence ID %u at %lu/%lu\n",
369 next_commit_ID, next_log_block, journal->j_last);
375 jbd_debug(3,
"JBD: checking block %ld\n", next_log_block);
376 err =
jread(&bh, journal, next_log_block);
381 wrap(journal, next_log_block);
398 jbd_debug(3,
"Found magic %d, sequence %d\n",
418 wrap(journal, next_log_block);
429 <= journal->j_blocksize) {
430 unsigned long io_block;
435 io_block = next_log_block++;
436 wrap(journal, next_log_block);
437 err =
jread(&obh, journal, io_block);
443 "JBD: IO error %d recovering "
444 "block %ld in log\n",
447 unsigned long blocknr;
449 J_ASSERT(obh !=
NULL);
459 ++
info->nr_revoke_hits;
467 journal->j_blocksize);
470 "JBD: Out of memory "
471 "during recovery.\n");
480 journal->j_blocksize);
486 BUFFER_TRACE(nbh,
"marking dirty");
487 set_buffer_uptodate(nbh);
489 BUFFER_TRACE(nbh,
"marking uptodate");
526 next_commit_ID,
info);
533 jbd_debug(3,
"Unrecognised magic %d, end of scan.\n",
549 info->end_transaction = next_commit_ID;
553 if (
info->end_transaction != next_commit_ID) {
555 "transaction %u, expected %u\n",
556 pass, next_commit_ID,
info->end_transaction);
582 unsigned long blocknr;
static int scan_revoke_records(journal_t *, struct buffer_head *, tid_t, struct recovery_info *)
static int count_tags(struct buffer_head *bh, int size)
int journal_skip_recovery(journal_t *journal)
#define wrap(journal, var)
int journal_recover(journal_t *journal)
static int jread(struct buffer_head **bhp, journal_t *journal, unsigned int offset)
static int do_one_pass(journal_t *journal, struct recovery_info *info, enum passtype pass)
GLboolean GLboolean GLboolean b
#define JFS_FLAG_LAST_TAG
struct journal_block_tag_s journal_block_tag_t
#define JFS_DESCRIPTOR_BLOCK
#define JFS_FLAG_SAME_UUID
struct journal_header_s journal_header_t
static int tid_geq(tid_t x, tid_t y)
#define memcpy(s1, s2, n)
static int cond_resched()
static void lock_buffer(struct buffer_head *bh)
void unlock_buffer(struct buffer_head *bh)
struct buffer_head * __getblk(struct block_device *bdev, sector_t block, unsigned long size)
static void wait_on_buffer(struct buffer_head *bh)
void ll_rw_block(int, int, struct buffer_head *bh[])
static void brelse(struct buffer_head *bh)
int sync_blockdev(struct block_device *bdev)
void mark_buffer_dirty(struct buffer_head *bh)
static unsigned __int64 next
int journal_bmap(journal_t *journal, unsigned long blocknr, unsigned long *retp)
void journal_clear_revoke(journal_t *journal)
int journal_set_revoke(journal_t *journal, unsigned long blocknr, tid_t sequence)
int journal_test_revoke(journal_t *journal, unsigned long blocknr, tid_t sequence)
static int do_readahead(mpg123_handle *fr, unsigned long newhead)
#define READ(_gif, _buf, _len)
#define success(from, fromstr, to, tostr)
static struct message * sequence