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;
44 * Unlink a buffer from a transaction checkpoint(io) list.
50 transaction_t *transaction = jh->b_cp_transaction;
53 if (transaction->t_checkpoint_io_list == jh) {
54 transaction->t_checkpoint_io_list = jh->b_cpnext;
55 if (transaction->t_checkpoint_io_list == jh)
56 transaction->t_checkpoint_io_list = NULL;
67 transaction_t *transaction = jh->b_cp_transaction;
71 if (!transaction->t_checkpoint_io_list) {
74 jh->b_cpnext = transaction->t_checkpoint_io_list;
75 jh->b_cpprev = transaction->t_checkpoint_io_list->b_cpprev;
79 transaction->t_checkpoint_io_list = jh;
118 * transaction to complete. If there is absolutely no way
191 * Perform an actual checkpoint. We take the first transaction on the
202 transaction_t *transaction;
220 * OK, we need to start writing disk blocks. Take one transaction
226 transaction = journal->j_checkpoint_transactions;
227 if (transaction->t_chp_stats.cs_chp_time == 0)
228 transaction->t_chp_stats.cs_chp_time = jiffies;
229 this_tid = transaction->t_tid;
232 * If someone cleaned up this transaction while we slept, we're
233 * done (maybe it's a new transaction, but it fell at the same
236 if (journal->j_checkpoint_transactions != transaction ||
237 transaction->t_tid != this_tid)
240 /* checkpoint all of the transaction's buffers */
241 while (transaction->t_checkpoint_list) {
242 jh = transaction->t_checkpoint_list;
258 transaction->t_chp_stats.cs_forced_to_close++;
291 /* The transaction was released; we're done */
298 * lock. We cannot afford to let the transaction
308 transaction->t_chp_stats.cs_written++;
326 * Now we issued all of the transaction's buffers, let's deal
330 /* Did somebody clean up the transaction in the meanwhile? */
331 if (journal->j_checkpoint_transactions != transaction ||
332 transaction->t_tid != this_tid)
335 while (transaction->t_checkpoint_io_list) {
336 jh = transaction->t_checkpoint_io_list;
375 * aware of transaction aborts. Checkpointing involves writing to the
418 * Returns 1 if we freed the transaction, 0 otherwise.
455 * and try to release them. If the whole transaction is released, set
508 transaction_t *transaction, *last_transaction, *next_transaction;
523 * Get next shrink transaction, resume previous scan or start
524 * over again. If some others do checkpoint and drop transaction
529 transaction = journal->j_shrink_transaction;
531 transaction = journal->j_checkpoint_transactions;
534 first_tid = transaction->t_tid;
536 next_transaction = transaction;
539 transaction = next_transaction;
540 next_transaction = transaction->t_cpnext;
541 tid = transaction->t_tid;
544 nr_freed += journal_shrink_one_cp_list(transaction->t_checkpoint_list,
553 nr_freed += journal_shrink_one_cp_list(transaction->t_checkpoint_io_list,
559 } while (transaction != last_transaction);
561 if (transaction != last_transaction) {
592 transaction_t *transaction, *last_transaction, *next_transaction;
595 transaction = journal->j_checkpoint_transactions;
596 if (!transaction)
599 last_transaction = transaction->t_cpprev;
600 next_transaction = transaction;
602 transaction = next_transaction;
603 next_transaction = transaction->t_cpnext;
604 ret = journal_clean_one_cp_list(transaction->t_checkpoint_list,
620 ret = journal_clean_one_cp_list(transaction->
625 * Stop scanning if we couldn't free the transaction. This
631 } while (transaction != last_transaction);
661 * We cannot safely clean a transaction out of the log until all of the
662 * buffer updates committed in that transaction have safely been stored
664 * transaction need to be maintained on the transaction's checkpoint
666 * called to remove the buffer from the existing transaction's
669 * The function returns 1 if it frees the transaction, 0 otherwise.
677 transaction_t *transaction;
683 transaction = jh->b_cp_transaction;
684 if (!transaction) {
685 JBUFFER_TRACE(jh, "not on transaction");
688 journal = transaction->t_journal;
690 JBUFFER_TRACE(jh, "removing from transaction");
707 /* Is this transaction empty? */
708 if (transaction->t_checkpoint_list || transaction->t_checkpoint_io_list)
713 * buffer off a running or committing transaction's checkpoing list,
714 * then even if the checkpoint list is empty, the transaction obviously
720 if (transaction->t_state != T_FINISHED)
724 * OK, that was the last buffer for the transaction, we can now
725 * safely remove this transaction from the log.
727 stats = &transaction->t_chp_stats;
732 transaction->t_tid, stats);
734 __jbd2_journal_drop_transaction(journal, transaction);
735 jbd2_journal_free_transaction(transaction);
741 * list so that we know when it is safe to clean the transaction out of
748 transaction_t *transaction)
754 /* Get reference for checkpointing transaction */
756 jh->b_cp_transaction = transaction;
758 if (!transaction->t_checkpoint_list) {
761 jh->b_cpnext = transaction->t_checkpoint_list;
762 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev;
766 transaction->t_checkpoint_list = jh;
767 percpu_counter_inc(&transaction->t_journal->j_checkpoint_jh_count);
771 * We've finished with this transaction structure: adios...
773 * The transaction must have no links except for the checkpoint by this
780 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction)
785 if (transaction->t_cpnext) {
786 transaction->t_cpnext->t_cpprev = transaction->t_cpprev;
787 transaction->t_cpprev->t_cpnext = transaction->t_cpnext;
788 if (journal->j_checkpoint_transactions == transaction)
790 transaction->t_cpnext;
791 if (journal->j_checkpoint_transactions == transaction)
795 J_ASSERT(transaction->t_state == T_FINISHED);
796 J_ASSERT(transaction->t_buffers == NULL);
797 J_ASSERT(transaction->t_forget == NULL);
798 J_ASSERT(transaction->t_shadow_list == NULL);
799 J_ASSERT(transaction->t_checkpoint_list == NULL);
800 J_ASSERT(transaction->t_checkpoint_io_list == NULL);
801 J_ASSERT(atomic_read(&transaction->t_updates) == 0);
802 J_ASSERT(journal->j_committing_transaction != transaction);
803 J_ASSERT(journal->j_running_transaction != transaction);
805 trace_jbd2_drop_transaction(journal, transaction);
807 jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid);