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()
147 * Perform an actual checkpoint. We take the first transaction on the
158 transaction_t *transaction; in jbd2_log_do_checkpoint() local
176 * OK, we need to start writing disk blocks. Take one transaction in jbd2_log_do_checkpoint()
182 transaction = journal->j_checkpoint_transactions; in jbd2_log_do_checkpoint()
183 if (transaction->t_chp_stats.cs_chp_time == 0) in jbd2_log_do_checkpoint()
184 transaction->t_chp_stats.cs_chp_time = jiffies; in jbd2_log_do_checkpoint()
185 this_tid = transaction->t_tid; in jbd2_log_do_checkpoint()
188 * If someone cleaned up this transaction while we slept, we're in jbd2_log_do_checkpoint()
189 * done (maybe it's a new transaction, but it fell at the same in jbd2_log_do_checkpoint()
192 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
193 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
196 /* checkpoint all of the transaction's buffers */ in jbd2_log_do_checkpoint()
197 while (transaction->t_checkpoint_list) { in jbd2_log_do_checkpoint()
198 jh = transaction->t_checkpoint_list; in jbd2_log_do_checkpoint()
205 transaction->t_chp_stats.cs_forced_to_close++; in jbd2_log_do_checkpoint()
239 * re-adding into a new transaction, need to check in jbd2_log_do_checkpoint()
253 * If the transaction was released or the checkpoint in jbd2_log_do_checkpoint()
257 !transaction->t_checkpoint_list) in jbd2_log_do_checkpoint()
263 * raced by some other transaction shrink or buffer in jbd2_log_do_checkpoint()
272 transaction->t_chp_stats.cs_written++; in jbd2_log_do_checkpoint()
273 transaction->t_checkpoint_list = jh->b_cpnext; in jbd2_log_do_checkpoint()
278 jh2bh(transaction->t_checkpoint_list) == journal->j_chkpt_bhs[0]) in jbd2_log_do_checkpoint()
310 * aware of transaction aborts. Checkpointing involves writing to the
352 * and try to release them. If the whole transaction is released, set
412 transaction_t *transaction, *last_transaction, *next_transaction; in jbd2_journal_shrink_checkpoint_list() local
428 * Get next shrink transaction, resume previous scan or start in jbd2_journal_shrink_checkpoint_list()
429 * over again. If some others do checkpoint and drop transaction in jbd2_journal_shrink_checkpoint_list()
434 transaction = journal->j_shrink_transaction; in jbd2_journal_shrink_checkpoint_list()
436 transaction = journal->j_checkpoint_transactions; in jbd2_journal_shrink_checkpoint_list()
439 first_tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
443 next_transaction = transaction; in jbd2_journal_shrink_checkpoint_list()
446 transaction = next_transaction; in jbd2_journal_shrink_checkpoint_list()
447 next_transaction = transaction->t_cpnext; in jbd2_journal_shrink_checkpoint_list()
448 tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
450 freed = journal_shrink_one_cp_list(transaction->t_checkpoint_list, in jbd2_journal_shrink_checkpoint_list()
458 } while (transaction != last_transaction); in jbd2_journal_shrink_checkpoint_list()
460 if (transaction != last_transaction) { in jbd2_journal_shrink_checkpoint_list()
490 transaction_t *transaction, *last_transaction, *next_transaction; in __jbd2_journal_clean_checkpoint_list() local
494 transaction = journal->j_checkpoint_transactions; in __jbd2_journal_clean_checkpoint_list()
495 if (!transaction) in __jbd2_journal_clean_checkpoint_list()
499 last_transaction = transaction->t_cpprev; in __jbd2_journal_clean_checkpoint_list()
500 next_transaction = transaction; in __jbd2_journal_clean_checkpoint_list()
502 transaction = next_transaction; in __jbd2_journal_clean_checkpoint_list()
503 next_transaction = transaction->t_cpnext; in __jbd2_journal_clean_checkpoint_list()
504 journal_shrink_one_cp_list(transaction->t_checkpoint_list, in __jbd2_journal_clean_checkpoint_list()
514 * Stop scanning if we couldn't free the transaction. This in __jbd2_journal_clean_checkpoint_list()
520 } while (transaction != last_transaction); in __jbd2_journal_clean_checkpoint_list()
550 * We cannot safely clean a transaction out of the log until all of the
551 * buffer updates committed in that transaction have safely been stored
553 * transaction need to be maintained on the transaction's checkpoint
555 * called to remove the buffer from the existing transaction's
558 * The function returns 1 if it frees the transaction, 0 otherwise.
566 transaction_t *transaction; in __jbd2_journal_remove_checkpoint() local
572 transaction = jh->b_cp_transaction; in __jbd2_journal_remove_checkpoint()
573 if (!transaction) { in __jbd2_journal_remove_checkpoint()
574 JBUFFER_TRACE(jh, "not on transaction"); in __jbd2_journal_remove_checkpoint()
577 journal = transaction->t_journal; in __jbd2_journal_remove_checkpoint()
579 JBUFFER_TRACE(jh, "removing from transaction"); in __jbd2_journal_remove_checkpoint()
596 /* Is this transaction empty? */ in __jbd2_journal_remove_checkpoint()
597 if (transaction->t_checkpoint_list) in __jbd2_journal_remove_checkpoint()
602 * buffer off a running or committing transaction's checkpoing list, in __jbd2_journal_remove_checkpoint()
603 * then even if the checkpoint list is empty, the transaction obviously in __jbd2_journal_remove_checkpoint()
609 if (transaction->t_state != T_FINISHED) in __jbd2_journal_remove_checkpoint()
613 * OK, that was the last buffer for the transaction, we can now in __jbd2_journal_remove_checkpoint()
614 * safely remove this transaction from the log. in __jbd2_journal_remove_checkpoint()
616 stats = &transaction->t_chp_stats; in __jbd2_journal_remove_checkpoint()
621 transaction->t_tid, stats); in __jbd2_journal_remove_checkpoint()
623 __jbd2_journal_drop_transaction(journal, transaction); in __jbd2_journal_remove_checkpoint()
624 jbd2_journal_free_transaction(transaction); in __jbd2_journal_remove_checkpoint()
631 * it frees the transaction, 0 otherwise.
652 * buffer from this transaction. in jbd2_journal_try_remove_checkpoint()
660 * list so that we know when it is safe to clean the transaction out of
667 transaction_t *transaction) in __jbd2_journal_insert_checkpoint() argument
673 /* Get reference for checkpointing transaction */ in __jbd2_journal_insert_checkpoint()
675 jh->b_cp_transaction = transaction; in __jbd2_journal_insert_checkpoint()
677 if (!transaction->t_checkpoint_list) { in __jbd2_journal_insert_checkpoint()
680 jh->b_cpnext = transaction->t_checkpoint_list; in __jbd2_journal_insert_checkpoint()
681 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev; in __jbd2_journal_insert_checkpoint()
685 transaction->t_checkpoint_list = jh; in __jbd2_journal_insert_checkpoint()
686 percpu_counter_inc(&transaction->t_journal->j_checkpoint_jh_count); in __jbd2_journal_insert_checkpoint()
690 * We've finished with this transaction structure: adios...
692 * The transaction must have no links except for the checkpoint by this
699 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction) in __jbd2_journal_drop_transaction() argument
704 if (transaction->t_cpnext) { in __jbd2_journal_drop_transaction()
705 transaction->t_cpnext->t_cpprev = transaction->t_cpprev; in __jbd2_journal_drop_transaction()
706 transaction->t_cpprev->t_cpnext = transaction->t_cpnext; in __jbd2_journal_drop_transaction()
707 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
709 transaction->t_cpnext; in __jbd2_journal_drop_transaction()
710 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
714 J_ASSERT(transaction->t_state == T_FINISHED); in __jbd2_journal_drop_transaction()
715 J_ASSERT(transaction->t_buffers == NULL); in __jbd2_journal_drop_transaction()
716 J_ASSERT(transaction->t_forget == NULL); in __jbd2_journal_drop_transaction()
717 J_ASSERT(transaction->t_shadow_list == NULL); in __jbd2_journal_drop_transaction()
718 J_ASSERT(transaction->t_checkpoint_list == NULL); in __jbd2_journal_drop_transaction()
719 J_ASSERT(atomic_read(&transaction->t_updates) == 0); in __jbd2_journal_drop_transaction()
720 J_ASSERT(journal->j_committing_transaction != transaction); in __jbd2_journal_drop_transaction()
721 J_ASSERT(journal->j_running_transaction != transaction); in __jbd2_journal_drop_transaction()
723 trace_jbd2_drop_transaction(journal, transaction); in __jbd2_journal_drop_transaction()
725 jbd2_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); in __jbd2_journal_drop_transaction()