• 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/fs/jbd2/

Lines Matching defs:transaction

29  * Unlink a buffer from a transaction checkpoint list.
35 transaction_t *transaction = jh->b_cp_transaction;
39 if (transaction->t_checkpoint_list == jh) {
40 transaction->t_checkpoint_list = jh->b_cpnext;
41 if (transaction->t_checkpoint_list == jh)
42 transaction->t_checkpoint_list = NULL;
47 * Unlink a buffer from a transaction checkpoint(io) list.
53 transaction_t *transaction = jh->b_cp_transaction;
56 if (transaction->t_checkpoint_io_list == jh) {
57 transaction->t_checkpoint_io_list = jh->b_cpnext;
58 if (transaction->t_checkpoint_io_list == jh)
59 transaction->t_checkpoint_io_list = NULL;
70 transaction_t *transaction = jh->b_cp_transaction;
74 if (!transaction->t_checkpoint_io_list) {
77 jh->b_cpnext = transaction->t_checkpoint_io_list;
78 jh->b_cpprev = transaction->t_checkpoint_io_list->b_cpprev;
82 transaction->t_checkpoint_io_list = jh;
86 * Try to release a checkpointed buffer from its transaction.
88 * whole transaction.
136 * transaction to complete. If there is absolutely no way
194 * Clean up transaction's list of buffers submitted for io.
204 static int __wait_cp_io(journal_t *journal, transaction_t *transaction)
212 this_tid = transaction->t_tid;
214 /* Did somebody clean up the transaction in the meanwhile? */
215 if (journal->j_checkpoint_transactions != transaction ||
216 transaction->t_tid != this_tid)
218 while (!released && transaction->t_checkpoint_io_list) {
219 jh = transaction->t_checkpoint_io_list;
281 int *batch_count, transaction_t *transaction)
299 transaction->t_chp_stats.cs_forced_to_close++;
320 * We cannot afford to let the transaction logic start
331 transaction->t_chp_stats.cs_written++;
343 * Perform an actual checkpoint. We take the first transaction on the
352 transaction_t *transaction;
370 * OK, we need to start writing disk blocks. Take one transaction
377 transaction = journal->j_checkpoint_transactions;
378 if (transaction->t_chp_stats.cs_chp_time == 0)
379 transaction->t_chp_stats.cs_chp_time = jiffies;
380 this_tid = transaction->t_tid;
383 * If someone cleaned up this transaction while we slept, we're
384 * done (maybe it's a new transaction, but it fell at the same
387 if (journal->j_checkpoint_transactions == transaction &&
388 transaction->t_tid == this_tid) {
393 while (!retry && transaction->t_checkpoint_list) {
396 jh = transaction->t_checkpoint_list;
404 transaction);
428 * Now we have cleaned up the first transaction's checkpoint
431 err = __wait_cp_io(journal, transaction);
456 * aware of transaction aborts. Checkpointing involves writing to the
465 transaction_t * transaction;
472 /* OK, work out the oldest transaction remaining in the log, and
476 * next transaction ID we will write, and where it will
481 transaction = journal->j_checkpoint_transactions;
482 if (transaction) {
483 first_tid = transaction->t_tid;
484 blocknr = transaction->t_log_start;
485 } else if ((transaction = journal->j_committing_transaction) != NULL) {
486 first_tid = transaction->t_tid;
487 blocknr = transaction->t_log_start;
488 } else if ((transaction = journal->j_running_transaction) != NULL) {
489 first_tid = transaction->t_tid;
498 /* If the oldest pinned transaction is at the tail of the log
605 transaction_t *transaction, *last_transaction, *next_transaction;
609 transaction = journal->j_checkpoint_transactions;
610 if (!transaction)
613 last_transaction = transaction->t_cpprev;
614 next_transaction = transaction;
616 transaction = next_transaction;
617 next_transaction = transaction->t_cpnext;
618 ret += journal_clean_one_cp_list(transaction->
634 ret += journal_clean_one_cp_list(transaction->
638 } while (transaction != last_transaction);
648 * We cannot safely clean a transaction out of the log until all of the
649 * buffer updates committed in that transaction have safely been stored
651 * transaction need to be maintained on the transaction's checkpoint
653 * called to remove the buffer from the existing transaction's
656 * The function returns 1 if it frees the transaction, 0 otherwise.
666 transaction_t *transaction;
672 if ((transaction = jh->b_cp_transaction) == NULL) {
673 JBUFFER_TRACE(jh, "not on transaction");
676 journal = transaction->t_journal;
681 if (transaction->t_checkpoint_list != NULL ||
682 transaction->t_checkpoint_io_list != NULL)
684 JBUFFER_TRACE(jh, "transaction has no more buffers");
688 * buffer off a running or committing transaction's checkpoing list,
689 * then even if the checkpoint list is empty, the transaction obviously
695 if (transaction->t_state != T_FINISHED) {
696 JBUFFER_TRACE(jh, "belongs to running/committing transaction");
700 /* OK, that was the last buffer for the transaction: we can now
701 safely remove this transaction from the log */
702 stats = &transaction->t_chp_stats;
707 transaction->t_tid, stats);
709 __jbd2_journal_drop_transaction(journal, transaction);
710 kfree(transaction);
723 * list so that we know when it is safe to clean the transaction out of
730 transaction_t *transaction)
736 jh->b_cp_transaction = transaction;
738 if (!transaction->t_checkpoint_list) {
741 jh->b_cpnext = transaction->t_checkpoint_list;
742 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev;
746 transaction->t_checkpoint_list = jh;
750 * We've finished with this transaction structure: adios...
752 * The transaction must have no links except for the checkpoint by this
759 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction)
762 if (transaction->t_cpnext) {
763 transaction->t_cpnext->t_cpprev = transaction->t_cpprev;
764 transaction->t_cpprev->t_cpnext = transaction->t_cpnext;
765 if (journal->j_checkpoint_transactions == transaction)
767 transaction->t_cpnext;
768 if (journal->j_checkpoint_transactions == transaction)
772 J_ASSERT(transaction->t_state == T_FINISHED);
773 J_ASSERT(transaction->t_buffers == NULL);
774 J_ASSERT(transaction->t_forget == NULL);
775 J_ASSERT(transaction->t_iobuf_list == NULL);
776 J_ASSERT(transaction->t_shadow_list == NULL);
777 J_ASSERT(transaction->t_log_list == NULL);
778 J_ASSERT(transaction->t_checkpoint_list == NULL);
779 J_ASSERT(transaction->t_checkpoint_io_list == NULL);
780 J_ASSERT(atomic_read(&transaction->t_updates) == 0);
781 J_ASSERT(journal->j_committing_transaction != transaction);
782 J_ASSERT(journal->j_running_transaction != transaction);
784 jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid);