• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/jbd/

Lines Matching defs:journal

110  * __log_wait_for_space: wait until there is space in the journal.
115 void __log_wait_for_space(journal_t *journal)
118 assert_spin_locked(&journal->j_state_lock);
120 nblocks = jbd_space_needed(journal);
121 while (__log_space_left(journal) < nblocks) {
122 if (journal->j_flags & JFS_ABORT)
124 spin_unlock(&journal->j_state_lock);
125 mutex_lock(&journal->j_checkpoint_mutex);
131 spin_lock(&journal->j_state_lock);
132 nblocks = jbd_space_needed(journal);
133 if (__log_space_left(journal) < nblocks) {
134 spin_unlock(&journal->j_state_lock);
135 log_do_checkpoint(journal);
136 spin_lock(&journal->j_state_lock);
138 mutex_unlock(&journal->j_checkpoint_mutex);
147 static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh)
148 __releases(journal->j_list_lock)
151 spin_unlock(&journal->j_list_lock);
165 static void __wait_cp_io(journal_t *journal, transaction_t *transaction)
175 if (journal->j_checkpoint_transactions != transaction ||
182 jbd_sync_bh(journal, bh);
183 spin_lock(&journal->j_list_lock);
188 spin_unlock(&journal->j_list_lock);
194 spin_lock(&journal->j_list_lock);
211 __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
234 static int __process_buffer(journal_t *journal, struct journal_head *jh,
242 spin_unlock(&journal->j_list_lock);
253 spin_unlock(&journal->j_list_lock);
255 log_start_commit(journal, tid);
256 log_wait_commit(journal, tid);
262 spin_unlock(&journal->j_list_lock);
270 * possibly block, while still holding the journal lock.
284 spin_unlock(&journal->j_list_lock);
285 __flush_batch(journal, bhs, batch_count);
297 * The journal should be locked before calling this function.
299 int log_do_checkpoint(journal_t *journal)
310 * journal straight away.
312 result = cleanup_journal_tail(journal);
321 spin_lock(&journal->j_list_lock);
322 if (!journal->j_checkpoint_transactions)
324 transaction = journal->j_checkpoint_transactions;
332 if (journal->j_checkpoint_transactions == transaction &&
345 jbd_sync_bh(journal, bh);
349 retry = __process_buffer(journal, jh, bhs,&batch_count);
350 if (!retry && lock_need_resched(&journal->j_list_lock)){
351 spin_unlock(&journal->j_list_lock);
359 spin_unlock(&journal->j_list_lock);
362 __flush_batch(journal, bhs, &batch_count);
366 spin_lock(&journal->j_list_lock);
373 __wait_cp_io(journal, transaction);
376 spin_unlock(&journal->j_list_lock);
377 result = cleanup_journal_tail(journal);
384 * Check the list of checkpoint transactions for the journal to see if
386 * in the journal superblock. If so, we can instantly roll the
391 * Called with the journal lock held.
395 * main filesystem area rather than to the journal, so it can proceed
396 * even in abort state, but we must not update the journal superblock if
400 int cleanup_journal_tail(journal_t *journal)
413 spin_lock(&journal->j_state_lock);
414 spin_lock(&journal->j_list_lock);
415 transaction = journal->j_checkpoint_transactions;
419 } else if ((transaction = journal->j_committing_transaction) != NULL) {
422 } else if ((transaction = journal->j_running_transaction) != NULL) {
424 blocknr = journal->j_head;
426 first_tid = journal->j_transaction_sequence;
427 blocknr = journal->j_head;
429 spin_unlock(&journal->j_list_lock);
434 if (journal->j_tail_sequence == first_tid) {
435 spin_unlock(&journal->j_state_lock);
442 freed = blocknr - journal->j_tail;
443 if (blocknr < journal->j_tail)
444 freed = freed + journal->j_last - journal->j_first;
447 "Cleaning journal tail from %d to %d (offset %lu), "
449 journal->j_tail_sequence, first_tid, blocknr, freed);
451 journal->j_free += freed;
452 journal->j_tail_sequence = first_tid;
453 journal->j_tail = blocknr;
454 spin_unlock(&journal->j_state_lock);
455 if (!(journal->j_flags & JFS_ABORT))
456 journal_update_superblock(journal, 1);
468 * Called with the journal locked.
514 * Find all the written-back checkpoint buffers in the journal and release them.
516 * Called with the journal locked.
521 int __journal_clean_checkpoint_list(journal_t *journal)
527 transaction = journal->j_checkpoint_transactions;
576 * This function is called with the journal locked.
584 journal_t *journal;
593 journal = transaction->t_journal;
612 if (transaction == journal->j_committing_transaction) {
620 __journal_drop_transaction(journal, transaction);
624 wake_up(&journal->j_wait_logspace);
636 * Called with the journal locked.
665 * Called with the journal locked.
669 void __journal_drop_transaction(journal_t *journal, transaction_t *transaction)
671 assert_spin_locked(&journal->j_list_lock);
675 if (journal->j_checkpoint_transactions == transaction)
676 journal->j_checkpoint_transactions =
678 if (journal->j_checkpoint_transactions == transaction)
679 journal->j_checkpoint_transactions = NULL;
692 J_ASSERT(journal->j_committing_transaction != transaction);
693 J_ASSERT(journal->j_running_transaction != transaction);