• Home
  • Raw
  • Download

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()
194 * Perform an actual checkpoint. We take the first transaction on the
205 transaction_t *transaction; in jbd2_log_do_checkpoint() local
223 * OK, we need to start writing disk blocks. Take one transaction in jbd2_log_do_checkpoint()
229 transaction = journal->j_checkpoint_transactions; in jbd2_log_do_checkpoint()
230 if (transaction->t_chp_stats.cs_chp_time == 0) in jbd2_log_do_checkpoint()
231 transaction->t_chp_stats.cs_chp_time = jiffies; in jbd2_log_do_checkpoint()
232 this_tid = transaction->t_tid; in jbd2_log_do_checkpoint()
235 * If someone cleaned up this transaction while we slept, we're in jbd2_log_do_checkpoint()
236 * done (maybe it's a new transaction, but it fell at the same in jbd2_log_do_checkpoint()
239 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
240 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
243 /* checkpoint all of the transaction's buffers */ in jbd2_log_do_checkpoint()
244 while (transaction->t_checkpoint_list) { in jbd2_log_do_checkpoint()
245 jh = transaction->t_checkpoint_list; in jbd2_log_do_checkpoint()
261 transaction->t_chp_stats.cs_forced_to_close++; in jbd2_log_do_checkpoint()
294 /* The transaction was released; we're done */ in jbd2_log_do_checkpoint()
301 * lock. We cannot afford to let the transaction in jbd2_log_do_checkpoint()
311 transaction->t_chp_stats.cs_written++; in jbd2_log_do_checkpoint()
329 * Now we issued all of the transaction's buffers, let's deal in jbd2_log_do_checkpoint()
333 /* Did somebody clean up the transaction in the meanwhile? */ in jbd2_log_do_checkpoint()
334 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
335 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
338 while (transaction->t_checkpoint_io_list) { in jbd2_log_do_checkpoint()
339 jh = transaction->t_checkpoint_io_list; in jbd2_log_do_checkpoint()
378 * aware of transaction aborts. Checkpointing involves writing to the
421 * Returns 1 if we freed the transaction, 0 otherwise.
458 * and try to release them. If the whole transaction is released, set
511 transaction_t *transaction, *last_transaction, *next_transaction; in jbd2_journal_shrink_checkpoint_list() local
526 * Get next shrink transaction, resume previous scan or start in jbd2_journal_shrink_checkpoint_list()
527 * over again. If some others do checkpoint and drop transaction in jbd2_journal_shrink_checkpoint_list()
532 transaction = journal->j_shrink_transaction; in jbd2_journal_shrink_checkpoint_list()
534 transaction = journal->j_checkpoint_transactions; in jbd2_journal_shrink_checkpoint_list()
537 first_tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
539 next_transaction = transaction; in jbd2_journal_shrink_checkpoint_list()
542 transaction = next_transaction; in jbd2_journal_shrink_checkpoint_list()
543 next_transaction = transaction->t_cpnext; in jbd2_journal_shrink_checkpoint_list()
544 tid = transaction->t_tid; in jbd2_journal_shrink_checkpoint_list()
547 nr_freed += journal_shrink_one_cp_list(transaction->t_checkpoint_list, in jbd2_journal_shrink_checkpoint_list()
556 nr_freed += journal_shrink_one_cp_list(transaction->t_checkpoint_io_list, in jbd2_journal_shrink_checkpoint_list()
562 } while (transaction != last_transaction); in jbd2_journal_shrink_checkpoint_list()
564 if (transaction != last_transaction) { in jbd2_journal_shrink_checkpoint_list()
595 transaction_t *transaction, *last_transaction, *next_transaction; in __jbd2_journal_clean_checkpoint_list() local
598 transaction = journal->j_checkpoint_transactions; in __jbd2_journal_clean_checkpoint_list()
599 if (!transaction) in __jbd2_journal_clean_checkpoint_list()
602 last_transaction = transaction->t_cpprev; in __jbd2_journal_clean_checkpoint_list()
603 next_transaction = transaction; in __jbd2_journal_clean_checkpoint_list()
605 transaction = next_transaction; in __jbd2_journal_clean_checkpoint_list()
606 next_transaction = transaction->t_cpnext; in __jbd2_journal_clean_checkpoint_list()
607 ret = journal_clean_one_cp_list(transaction->t_checkpoint_list, in __jbd2_journal_clean_checkpoint_list()
623 ret = journal_clean_one_cp_list(transaction-> in __jbd2_journal_clean_checkpoint_list()
628 * Stop scanning if we couldn't free the transaction. This in __jbd2_journal_clean_checkpoint_list()
634 } while (transaction != last_transaction); in __jbd2_journal_clean_checkpoint_list()
664 * We cannot safely clean a transaction out of the log until all of the
665 * buffer updates committed in that transaction have safely been stored
667 * transaction need to be maintained on the transaction's checkpoint
669 * called to remove the buffer from the existing transaction's
672 * The function returns 1 if it frees the transaction, 0 otherwise.
680 transaction_t *transaction; in __jbd2_journal_remove_checkpoint() local
686 transaction = jh->b_cp_transaction; in __jbd2_journal_remove_checkpoint()
687 if (!transaction) { in __jbd2_journal_remove_checkpoint()
688 JBUFFER_TRACE(jh, "not on transaction"); in __jbd2_journal_remove_checkpoint()
691 journal = transaction->t_journal; in __jbd2_journal_remove_checkpoint()
693 JBUFFER_TRACE(jh, "removing from transaction"); in __jbd2_journal_remove_checkpoint()
710 /* Is this transaction empty? */ in __jbd2_journal_remove_checkpoint()
711 if (transaction->t_checkpoint_list || transaction->t_checkpoint_io_list) in __jbd2_journal_remove_checkpoint()
716 * buffer off a running or committing transaction's checkpoing list, in __jbd2_journal_remove_checkpoint()
717 * then even if the checkpoint list is empty, the transaction obviously in __jbd2_journal_remove_checkpoint()
723 if (transaction->t_state != T_FINISHED) in __jbd2_journal_remove_checkpoint()
727 * OK, that was the last buffer for the transaction, we can now in __jbd2_journal_remove_checkpoint()
728 * safely remove this transaction from the log. in __jbd2_journal_remove_checkpoint()
730 stats = &transaction->t_chp_stats; in __jbd2_journal_remove_checkpoint()
735 transaction->t_tid, stats); in __jbd2_journal_remove_checkpoint()
737 __jbd2_journal_drop_transaction(journal, transaction); in __jbd2_journal_remove_checkpoint()
738 jbd2_journal_free_transaction(transaction); in __jbd2_journal_remove_checkpoint()
744 * list so that we know when it is safe to clean the transaction out of
751 transaction_t *transaction) in __jbd2_journal_insert_checkpoint() argument
757 /* Get reference for checkpointing transaction */ in __jbd2_journal_insert_checkpoint()
759 jh->b_cp_transaction = transaction; in __jbd2_journal_insert_checkpoint()
761 if (!transaction->t_checkpoint_list) { in __jbd2_journal_insert_checkpoint()
764 jh->b_cpnext = transaction->t_checkpoint_list; in __jbd2_journal_insert_checkpoint()
765 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev; in __jbd2_journal_insert_checkpoint()
769 transaction->t_checkpoint_list = jh; in __jbd2_journal_insert_checkpoint()
770 percpu_counter_inc(&transaction->t_journal->j_checkpoint_jh_count); in __jbd2_journal_insert_checkpoint()
774 * We've finished with this transaction structure: adios...
776 * The transaction must have no links except for the checkpoint by this
783 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction) in __jbd2_journal_drop_transaction() argument
788 if (transaction->t_cpnext) { in __jbd2_journal_drop_transaction()
789 transaction->t_cpnext->t_cpprev = transaction->t_cpprev; in __jbd2_journal_drop_transaction()
790 transaction->t_cpprev->t_cpnext = transaction->t_cpnext; in __jbd2_journal_drop_transaction()
791 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
793 transaction->t_cpnext; in __jbd2_journal_drop_transaction()
794 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
798 J_ASSERT(transaction->t_state == T_FINISHED); in __jbd2_journal_drop_transaction()
799 J_ASSERT(transaction->t_buffers == NULL); in __jbd2_journal_drop_transaction()
800 J_ASSERT(transaction->t_forget == NULL); in __jbd2_journal_drop_transaction()
801 J_ASSERT(transaction->t_shadow_list == NULL); in __jbd2_journal_drop_transaction()
802 J_ASSERT(transaction->t_checkpoint_list == NULL); in __jbd2_journal_drop_transaction()
803 J_ASSERT(transaction->t_checkpoint_io_list == NULL); in __jbd2_journal_drop_transaction()
804 J_ASSERT(atomic_read(&transaction->t_updates) == 0); in __jbd2_journal_drop_transaction()
805 J_ASSERT(journal->j_committing_transaction != transaction); in __jbd2_journal_drop_transaction()
806 J_ASSERT(journal->j_running_transaction != transaction); in __jbd2_journal_drop_transaction()
808 trace_jbd2_drop_transaction(journal, transaction); in __jbd2_journal_drop_transaction()
810 jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); in __jbd2_journal_drop_transaction()