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
350 * and try to release them. If the whole transaction is released, set
410 transaction_t *transaction, *last_transaction, *next_transaction; in jbd2_journal_shrink_checkpoint_list() local
426 * Get next shrink transaction, resume previous scan or start in jbd2_journal_shrink_checkpoint_list()
427 * over again. If some others do checkpoint and drop transaction in jbd2_journal_shrink_checkpoint_list()
432 transaction = journal->j_shrink_transaction; in jbd2_journal_shrink_checkpoint_list()
434 transaction = journal->j_checkpoint_transactions; in jbd2_journal_shrink_checkpoint_list()
437 first_tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
441 next_transaction = transaction; in jbd2_journal_shrink_checkpoint_list()
444 transaction = next_transaction; in jbd2_journal_shrink_checkpoint_list()
445 next_transaction = transaction->t_cpnext; in jbd2_journal_shrink_checkpoint_list()
446 tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
448 freed = journal_shrink_one_cp_list(transaction->t_checkpoint_list, in jbd2_journal_shrink_checkpoint_list()
456 } while (transaction != last_transaction); in jbd2_journal_shrink_checkpoint_list()
458 if (transaction != last_transaction) { in jbd2_journal_shrink_checkpoint_list()
492 transaction_t *transaction, *last_transaction, *next_transaction; in __jbd2_journal_clean_checkpoint_list() local
497 transaction = journal->j_checkpoint_transactions; in __jbd2_journal_clean_checkpoint_list()
498 if (!transaction) in __jbd2_journal_clean_checkpoint_list()
501 last_transaction = transaction->t_cpprev; in __jbd2_journal_clean_checkpoint_list()
502 next_transaction = transaction; in __jbd2_journal_clean_checkpoint_list()
504 transaction = next_transaction; in __jbd2_journal_clean_checkpoint_list()
505 next_transaction = transaction->t_cpnext; in __jbd2_journal_clean_checkpoint_list()
506 journal_shrink_one_cp_list(transaction->t_checkpoint_list, in __jbd2_journal_clean_checkpoint_list()
516 * Stop scanning if we couldn't free the transaction. This in __jbd2_journal_clean_checkpoint_list()
522 } while (transaction != last_transaction); in __jbd2_journal_clean_checkpoint_list()
552 * We cannot safely clean a transaction out of the log until all of the
553 * buffer updates committed in that transaction have safely been stored
555 * transaction need to be maintained on the transaction's checkpoint
557 * called to remove the buffer from the existing transaction's
560 * The function returns 1 if it frees the transaction, 0 otherwise.
568 transaction_t *transaction; in __jbd2_journal_remove_checkpoint() local
573 transaction = jh->b_cp_transaction; in __jbd2_journal_remove_checkpoint()
574 if (!transaction) { in __jbd2_journal_remove_checkpoint()
575 JBUFFER_TRACE(jh, "not on transaction"); in __jbd2_journal_remove_checkpoint()
578 journal = transaction->t_journal; in __jbd2_journal_remove_checkpoint()
580 JBUFFER_TRACE(jh, "removing from transaction"); in __jbd2_journal_remove_checkpoint()
587 /* Is this transaction empty? */ in __jbd2_journal_remove_checkpoint()
588 if (transaction->t_checkpoint_list) in __jbd2_journal_remove_checkpoint()
593 * buffer off a running or committing transaction's checkpoing list, in __jbd2_journal_remove_checkpoint()
594 * then even if the checkpoint list is empty, the transaction obviously in __jbd2_journal_remove_checkpoint()
600 if (transaction->t_state != T_FINISHED) in __jbd2_journal_remove_checkpoint()
604 * OK, that was the last buffer for the transaction, we can now in __jbd2_journal_remove_checkpoint()
605 * safely remove this transaction from the log. in __jbd2_journal_remove_checkpoint()
607 stats = &transaction->t_chp_stats; in __jbd2_journal_remove_checkpoint()
612 transaction->t_tid, stats); in __jbd2_journal_remove_checkpoint()
614 __jbd2_journal_drop_transaction(journal, transaction); in __jbd2_journal_remove_checkpoint()
615 jbd2_journal_free_transaction(transaction); in __jbd2_journal_remove_checkpoint()
622 * it frees the transaction, 0 otherwise.
643 * buffer from this transaction. in jbd2_journal_try_remove_checkpoint()
651 * list so that we know when it is safe to clean the transaction out of
658 transaction_t *transaction) in __jbd2_journal_insert_checkpoint() argument
664 /* Get reference for checkpointing transaction */ in __jbd2_journal_insert_checkpoint()
666 jh->b_cp_transaction = transaction; in __jbd2_journal_insert_checkpoint()
668 if (!transaction->t_checkpoint_list) { in __jbd2_journal_insert_checkpoint()
671 jh->b_cpnext = transaction->t_checkpoint_list; in __jbd2_journal_insert_checkpoint()
672 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev; in __jbd2_journal_insert_checkpoint()
676 transaction->t_checkpoint_list = jh; in __jbd2_journal_insert_checkpoint()
677 percpu_counter_inc(&transaction->t_journal->j_checkpoint_jh_count); in __jbd2_journal_insert_checkpoint()
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) in __jbd2_journal_drop_transaction() argument
695 if (transaction->t_cpnext) { in __jbd2_journal_drop_transaction()
696 transaction->t_cpnext->t_cpprev = transaction->t_cpprev; in __jbd2_journal_drop_transaction()
697 transaction->t_cpprev->t_cpnext = transaction->t_cpnext; in __jbd2_journal_drop_transaction()
698 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
700 transaction->t_cpnext; in __jbd2_journal_drop_transaction()
701 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
705 J_ASSERT(transaction->t_state == T_FINISHED); in __jbd2_journal_drop_transaction()
706 J_ASSERT(transaction->t_buffers == NULL); in __jbd2_journal_drop_transaction()
707 J_ASSERT(transaction->t_forget == NULL); in __jbd2_journal_drop_transaction()
708 J_ASSERT(transaction->t_shadow_list == NULL); in __jbd2_journal_drop_transaction()
709 J_ASSERT(transaction->t_checkpoint_list == NULL); in __jbd2_journal_drop_transaction()
710 J_ASSERT(atomic_read(&transaction->t_updates) == 0); in __jbd2_journal_drop_transaction()
711 J_ASSERT(journal->j_committing_transaction != transaction); in __jbd2_journal_drop_transaction()
712 J_ASSERT(journal->j_running_transaction != transaction); in __jbd2_journal_drop_transaction()
714 trace_jbd2_drop_transaction(journal, transaction); in __jbd2_journal_drop_transaction()
716 jbd2_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); in __jbd2_journal_drop_transaction()