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