Lines Matching defs:transaction
26 * Unlink a buffer from a transaction checkpoint list.
32 transaction_t *transaction = jh->b_cp_transaction;
36 if (transaction->t_checkpoint_list == jh) {
37 transaction->t_checkpoint_list = jh->b_cpnext;
38 if (transaction->t_checkpoint_list == jh)
39 transaction->t_checkpoint_list = NULL;
67 * transaction to complete. If there is absolutely no way
141 * Perform an actual checkpoint. We take the first transaction on the
152 transaction_t *transaction;
170 * OK, we need to start writing disk blocks. Take one transaction
176 transaction = journal->j_checkpoint_transactions;
177 if (transaction->t_chp_stats.cs_chp_time == 0)
178 transaction->t_chp_stats.cs_chp_time = jiffies;
179 this_tid = transaction->t_tid;
182 * If someone cleaned up this transaction while we slept, we're
183 * done (maybe it's a new transaction, but it fell at the same
186 if (journal->j_checkpoint_transactions != transaction ||
187 transaction->t_tid != this_tid)
190 /* checkpoint all of the transaction's buffers */
191 while (transaction->t_checkpoint_list) {
192 jh = transaction->t_checkpoint_list;
199 transaction->t_chp_stats.cs_forced_to_close++;
233 * re-adding into a new transaction, need to check
247 * If the transaction was released or the checkpoint
251 !transaction->t_checkpoint_list)
257 * raced by some other transaction shrink or buffer
266 transaction->t_chp_stats.cs_written++;
267 transaction->t_checkpoint_list = jh->b_cpnext;
272 jh2bh(transaction->t_checkpoint_list) == journal->j_chkpt_bhs[0])
304 * aware of transaction aborts. Checkpointing involves writing to the
346 * and try to release them. If the whole transaction is released, set
406 transaction_t *transaction, *last_transaction, *next_transaction;
421 * Get next shrink transaction, resume previous scan or start
422 * over again. If some others do checkpoint and drop transaction
427 transaction = journal->j_shrink_transaction;
429 transaction = journal->j_checkpoint_transactions;
432 first_tid = transaction->t_tid;
434 next_transaction = transaction;
437 transaction = next_transaction;
438 next_transaction = transaction->t_cpnext;
439 tid = transaction->t_tid;
441 freed = journal_shrink_one_cp_list(transaction->t_checkpoint_list,
449 } while (transaction != last_transaction);
451 if (transaction != last_transaction) {
481 transaction_t *transaction, *last_transaction, *next_transaction;
485 transaction = journal->j_checkpoint_transactions;
486 if (!transaction)
490 last_transaction = transaction->t_cpprev;
491 next_transaction = transaction;
493 transaction = next_transaction;
494 next_transaction = transaction->t_cpnext;
495 journal_shrink_one_cp_list(transaction->t_checkpoint_list,
505 * Stop scanning if we couldn't free the transaction. This
511 } while (transaction != last_transaction);
541 * We cannot safely clean a transaction out of the log until all of the
542 * buffer updates committed in that transaction have safely been stored
544 * transaction need to be maintained on the transaction's checkpoint
546 * called to remove the buffer from the existing transaction's
549 * The function returns 1 if it frees the transaction, 0 otherwise.
557 transaction_t *transaction;
563 transaction = jh->b_cp_transaction;
564 if (!transaction) {
565 JBUFFER_TRACE(jh, "not on transaction");
568 journal = transaction->t_journal;
570 JBUFFER_TRACE(jh, "removing from transaction");
587 /* Is this transaction empty? */
588 if (transaction->t_checkpoint_list)
593 * buffer off a running or committing transaction's checkpoing list,
594 * then even if the checkpoint list is empty, the transaction obviously
600 if (transaction->t_state != T_FINISHED)
604 * OK, that was the last buffer for the transaction, we can now
605 * safely remove this transaction from the log.
607 stats = &transaction->t_chp_stats;
612 transaction->t_tid, stats);
614 __jbd2_journal_drop_transaction(journal, transaction);
615 jbd2_journal_free_transaction(transaction);
622 * it frees the transaction, 0 otherwise.
643 * buffer from this transaction.
651 * list so that we know when it is safe to clean the transaction out of
658 transaction_t *transaction)
664 /* Get reference for checkpointing transaction */
666 jh->b_cp_transaction = transaction;
668 if (!transaction->t_checkpoint_list) {
671 jh->b_cpnext = transaction->t_checkpoint_list;
672 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev;
676 transaction->t_checkpoint_list = jh;
677 percpu_counter_inc(&transaction->t_journal->j_checkpoint_jh_count);
681 * We've finished with this transaction structure: adios...
683 * The transaction must have no links except for the checkpoint by this
690 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction)
695 if (transaction->t_cpnext) {
696 transaction->t_cpnext->t_cpprev = transaction->t_cpprev;
697 transaction->t_cpprev->t_cpnext = transaction->t_cpnext;
698 if (journal->j_checkpoint_transactions == transaction)
700 transaction->t_cpnext;
701 if (journal->j_checkpoint_transactions == transaction)
705 J_ASSERT(transaction->t_state == T_FINISHED);
706 J_ASSERT(transaction->t_buffers == NULL);
707 J_ASSERT(transaction->t_forget == NULL);
708 J_ASSERT(transaction->t_shadow_list == NULL);
709 J_ASSERT(transaction->t_checkpoint_list == NULL);
710 J_ASSERT(atomic_read(&transaction->t_updates) == 0);
711 J_ASSERT(journal->j_committing_transaction != transaction);
712 J_ASSERT(journal->j_running_transaction != transaction);
714 trace_jbd2_drop_transaction(journal, transaction);
716 jbd2_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid);