Lines Matching full:transaction

26  * Unlink a buffer from a transaction checkpoint list.
32 transaction_t *transaction = jh->b_cp_transaction; in __buffer_unlink() local
36 if (transaction->t_checkpoint_list == jh) { in __buffer_unlink()
37 transaction->t_checkpoint_list = jh->b_cpnext; in __buffer_unlink()
38 if (transaction->t_checkpoint_list == jh) in __buffer_unlink()
39 transaction->t_checkpoint_list = NULL; in __buffer_unlink()
67 * transaction to complete. If there is absolutely no way in __jbd2_log_wait_for_space()
141 * Perform an actual checkpoint. We take the first transaction on the
152 transaction_t *transaction; in jbd2_log_do_checkpoint() local
170 * OK, we need to start writing disk blocks. Take one transaction in jbd2_log_do_checkpoint()
176 transaction = journal->j_checkpoint_transactions; in jbd2_log_do_checkpoint()
177 if (transaction->t_chp_stats.cs_chp_time == 0) in jbd2_log_do_checkpoint()
178 transaction->t_chp_stats.cs_chp_time = jiffies; in jbd2_log_do_checkpoint()
179 this_tid = transaction->t_tid; in jbd2_log_do_checkpoint()
182 * If someone cleaned up this transaction while we slept, we're in jbd2_log_do_checkpoint()
183 * done (maybe it's a new transaction, but it fell at the same in jbd2_log_do_checkpoint()
186 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
187 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
190 /* checkpoint all of the transaction's buffers */ in jbd2_log_do_checkpoint()
191 while (transaction->t_checkpoint_list) { in jbd2_log_do_checkpoint()
192 jh = transaction->t_checkpoint_list; in jbd2_log_do_checkpoint()
199 transaction->t_chp_stats.cs_forced_to_close++; in jbd2_log_do_checkpoint()
233 * re-adding into a new transaction, need to check in jbd2_log_do_checkpoint()
247 * If the transaction was released or the checkpoint in jbd2_log_do_checkpoint()
251 !transaction->t_checkpoint_list) in jbd2_log_do_checkpoint()
257 * raced by some other transaction shrink or buffer in jbd2_log_do_checkpoint()
266 transaction->t_chp_stats.cs_written++; in jbd2_log_do_checkpoint()
267 transaction->t_checkpoint_list = jh->b_cpnext; in jbd2_log_do_checkpoint()
272 jh2bh(transaction->t_checkpoint_list) == journal->j_chkpt_bhs[0]) in jbd2_log_do_checkpoint()
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; in jbd2_journal_shrink_checkpoint_list() local
421 * Get next shrink transaction, resume previous scan or start in jbd2_journal_shrink_checkpoint_list()
422 * over again. If some others do checkpoint and drop transaction in jbd2_journal_shrink_checkpoint_list()
427 transaction = journal->j_shrink_transaction; in jbd2_journal_shrink_checkpoint_list()
429 transaction = journal->j_checkpoint_transactions; in jbd2_journal_shrink_checkpoint_list()
432 first_tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
434 next_transaction = transaction; in jbd2_journal_shrink_checkpoint_list()
437 transaction = next_transaction; in jbd2_journal_shrink_checkpoint_list()
438 next_transaction = transaction->t_cpnext; in jbd2_journal_shrink_checkpoint_list()
439 tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
441 freed = journal_shrink_one_cp_list(transaction->t_checkpoint_list, in jbd2_journal_shrink_checkpoint_list()
449 } while (transaction != last_transaction); in jbd2_journal_shrink_checkpoint_list()
451 if (transaction != last_transaction) { in jbd2_journal_shrink_checkpoint_list()
481 transaction_t *transaction, *last_transaction, *next_transaction; in __jbd2_journal_clean_checkpoint_list() local
485 transaction = journal->j_checkpoint_transactions; in __jbd2_journal_clean_checkpoint_list()
486 if (!transaction) in __jbd2_journal_clean_checkpoint_list()
490 last_transaction = transaction->t_cpprev; in __jbd2_journal_clean_checkpoint_list()
491 next_transaction = transaction; in __jbd2_journal_clean_checkpoint_list()
493 transaction = next_transaction; in __jbd2_journal_clean_checkpoint_list()
494 next_transaction = transaction->t_cpnext; in __jbd2_journal_clean_checkpoint_list()
495 journal_shrink_one_cp_list(transaction->t_checkpoint_list, in __jbd2_journal_clean_checkpoint_list()
505 * Stop scanning if we couldn't free the transaction. This in __jbd2_journal_clean_checkpoint_list()
511 } while (transaction != last_transaction); in __jbd2_journal_clean_checkpoint_list()
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; in __jbd2_journal_remove_checkpoint() local
562 transaction = jh->b_cp_transaction; in __jbd2_journal_remove_checkpoint()
563 if (!transaction) { in __jbd2_journal_remove_checkpoint()
564 JBUFFER_TRACE(jh, "not on transaction"); in __jbd2_journal_remove_checkpoint()
567 journal = transaction->t_journal; in __jbd2_journal_remove_checkpoint()
569 JBUFFER_TRACE(jh, "removing from transaction"); in __jbd2_journal_remove_checkpoint()
576 /* Is this transaction empty? */ in __jbd2_journal_remove_checkpoint()
577 if (transaction->t_checkpoint_list) in __jbd2_journal_remove_checkpoint()
582 * buffer off a running or committing transaction's checkpoing list, in __jbd2_journal_remove_checkpoint()
583 * then even if the checkpoint list is empty, the transaction obviously in __jbd2_journal_remove_checkpoint()
589 if (transaction->t_state != T_FINISHED) in __jbd2_journal_remove_checkpoint()
593 * OK, that was the last buffer for the transaction, we can now in __jbd2_journal_remove_checkpoint()
594 * safely remove this transaction from the log. in __jbd2_journal_remove_checkpoint()
596 stats = &transaction->t_chp_stats; in __jbd2_journal_remove_checkpoint()
601 transaction->t_tid, stats); in __jbd2_journal_remove_checkpoint()
603 __jbd2_journal_drop_transaction(journal, transaction); in __jbd2_journal_remove_checkpoint()
604 jbd2_journal_free_transaction(transaction); in __jbd2_journal_remove_checkpoint()
611 * it frees the transaction, 0 otherwise.
632 * buffer from this transaction. in jbd2_journal_try_remove_checkpoint()
640 * list so that we know when it is safe to clean the transaction out of
647 transaction_t *transaction) in __jbd2_journal_insert_checkpoint() argument
653 /* Get reference for checkpointing transaction */ in __jbd2_journal_insert_checkpoint()
655 jh->b_cp_transaction = transaction; in __jbd2_journal_insert_checkpoint()
657 if (!transaction->t_checkpoint_list) { in __jbd2_journal_insert_checkpoint()
660 jh->b_cpnext = transaction->t_checkpoint_list; in __jbd2_journal_insert_checkpoint()
661 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev; in __jbd2_journal_insert_checkpoint()
665 transaction->t_checkpoint_list = jh; in __jbd2_journal_insert_checkpoint()
666 percpu_counter_inc(&transaction->t_journal->j_checkpoint_jh_count); in __jbd2_journal_insert_checkpoint()
670 * We've finished with this transaction structure: adios...
672 * The transaction must have no links except for the checkpoint by this
679 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction) in __jbd2_journal_drop_transaction() argument
684 if (transaction->t_cpnext) { in __jbd2_journal_drop_transaction()
685 transaction->t_cpnext->t_cpprev = transaction->t_cpprev; in __jbd2_journal_drop_transaction()
686 transaction->t_cpprev->t_cpnext = transaction->t_cpnext; in __jbd2_journal_drop_transaction()
687 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
689 transaction->t_cpnext; in __jbd2_journal_drop_transaction()
690 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
694 J_ASSERT(transaction->t_state == T_FINISHED); in __jbd2_journal_drop_transaction()
695 J_ASSERT(transaction->t_buffers == NULL); in __jbd2_journal_drop_transaction()
696 J_ASSERT(transaction->t_forget == NULL); in __jbd2_journal_drop_transaction()
697 J_ASSERT(transaction->t_shadow_list == NULL); in __jbd2_journal_drop_transaction()
698 J_ASSERT(transaction->t_checkpoint_list == NULL); in __jbd2_journal_drop_transaction()
699 J_ASSERT(atomic_read(&transaction->t_updates) == 0); in __jbd2_journal_drop_transaction()
700 J_ASSERT(journal->j_committing_transaction != transaction); in __jbd2_journal_drop_transaction()
701 J_ASSERT(journal->j_running_transaction != transaction); in __jbd2_journal_drop_transaction()
703 trace_jbd2_drop_transaction(journal, transaction); in __jbd2_journal_drop_transaction()
705 jbd2_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); in __jbd2_journal_drop_transaction()