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()
83 * Try to release a checkpointed buffer from its transaction.
85 * whole transaction.
126 * transaction to complete. If there is absolutely no way in __jbd2_log_wait_for_space()
199 * Perform an actual checkpoint. We take the first transaction on the
210 transaction_t *transaction; in jbd2_log_do_checkpoint() local
228 * OK, we need to start writing disk blocks. Take one transaction in jbd2_log_do_checkpoint()
235 transaction = journal->j_checkpoint_transactions; in jbd2_log_do_checkpoint()
236 if (transaction->t_chp_stats.cs_chp_time == 0) in jbd2_log_do_checkpoint()
237 transaction->t_chp_stats.cs_chp_time = jiffies; in jbd2_log_do_checkpoint()
238 this_tid = transaction->t_tid; in jbd2_log_do_checkpoint()
241 * If someone cleaned up this transaction while we slept, we're in jbd2_log_do_checkpoint()
242 * done (maybe it's a new transaction, but it fell at the same in jbd2_log_do_checkpoint()
245 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
246 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
249 /* checkpoint all of the transaction's buffers */ in jbd2_log_do_checkpoint()
250 while (transaction->t_checkpoint_list) { in jbd2_log_do_checkpoint()
251 jh = transaction->t_checkpoint_list; in jbd2_log_do_checkpoint()
267 transaction->t_chp_stats.cs_forced_to_close++; in jbd2_log_do_checkpoint()
302 /* The transaction was released; we're done */ in jbd2_log_do_checkpoint()
309 * lock. We cannot afford to let the transaction in jbd2_log_do_checkpoint()
319 transaction->t_chp_stats.cs_written++; in jbd2_log_do_checkpoint()
337 * Now we issued all of the transaction's buffers, let's deal in jbd2_log_do_checkpoint()
341 /* Did somebody clean up the transaction in the meanwhile? */ in jbd2_log_do_checkpoint()
342 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
343 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
346 while (transaction->t_checkpoint_io_list) { in jbd2_log_do_checkpoint()
347 jh = transaction->t_checkpoint_io_list; in jbd2_log_do_checkpoint()
391 * aware of transaction aborts. Checkpointing involves writing to the
434 * Returns 1 if we freed the transaction, 0 otherwise.
480 transaction_t *transaction, *last_transaction, *next_transaction; in __jbd2_journal_clean_checkpoint_list() local
483 transaction = journal->j_checkpoint_transactions; in __jbd2_journal_clean_checkpoint_list()
484 if (!transaction) in __jbd2_journal_clean_checkpoint_list()
487 last_transaction = transaction->t_cpprev; in __jbd2_journal_clean_checkpoint_list()
488 next_transaction = transaction; in __jbd2_journal_clean_checkpoint_list()
490 transaction = next_transaction; in __jbd2_journal_clean_checkpoint_list()
491 next_transaction = transaction->t_cpnext; in __jbd2_journal_clean_checkpoint_list()
492 ret = journal_clean_one_cp_list(transaction->t_checkpoint_list, in __jbd2_journal_clean_checkpoint_list()
508 ret = journal_clean_one_cp_list(transaction-> in __jbd2_journal_clean_checkpoint_list()
513 * Stop scanning if we couldn't free the transaction. This in __jbd2_journal_clean_checkpoint_list()
519 } while (transaction != last_transaction); in __jbd2_journal_clean_checkpoint_list()
549 * We cannot safely clean a transaction out of the log until all of the
550 * buffer updates committed in that transaction have safely been stored
552 * transaction need to be maintained on the transaction's checkpoint
554 * called to remove the buffer from the existing transaction's
557 * The function returns 1 if it frees the transaction, 0 otherwise.
565 transaction_t *transaction; in __jbd2_journal_remove_checkpoint() local
571 if ((transaction = jh->b_cp_transaction) == NULL) { in __jbd2_journal_remove_checkpoint()
572 JBUFFER_TRACE(jh, "not on transaction"); in __jbd2_journal_remove_checkpoint()
575 journal = transaction->t_journal; in __jbd2_journal_remove_checkpoint()
577 JBUFFER_TRACE(jh, "removing from transaction"); in __jbd2_journal_remove_checkpoint()
582 if (transaction->t_checkpoint_list != NULL || in __jbd2_journal_remove_checkpoint()
583 transaction->t_checkpoint_io_list != NULL) in __jbd2_journal_remove_checkpoint()
588 * buffer off a running or committing transaction's checkpoing list, in __jbd2_journal_remove_checkpoint()
589 * then even if the checkpoint list is empty, the transaction obviously in __jbd2_journal_remove_checkpoint()
595 if (transaction->t_state != T_FINISHED) in __jbd2_journal_remove_checkpoint()
598 /* OK, that was the last buffer for the transaction: we can now in __jbd2_journal_remove_checkpoint()
599 safely remove this transaction from the log */ in __jbd2_journal_remove_checkpoint()
600 stats = &transaction->t_chp_stats; in __jbd2_journal_remove_checkpoint()
605 transaction->t_tid, stats); in __jbd2_journal_remove_checkpoint()
607 __jbd2_journal_drop_transaction(journal, transaction); in __jbd2_journal_remove_checkpoint()
608 jbd2_journal_free_transaction(transaction); in __jbd2_journal_remove_checkpoint()
616 * list so that we know when it is safe to clean the transaction out of
623 transaction_t *transaction) in __jbd2_journal_insert_checkpoint() argument
629 /* Get reference for checkpointing transaction */ in __jbd2_journal_insert_checkpoint()
631 jh->b_cp_transaction = transaction; in __jbd2_journal_insert_checkpoint()
633 if (!transaction->t_checkpoint_list) { in __jbd2_journal_insert_checkpoint()
636 jh->b_cpnext = transaction->t_checkpoint_list; in __jbd2_journal_insert_checkpoint()
637 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev; in __jbd2_journal_insert_checkpoint()
641 transaction->t_checkpoint_list = jh; in __jbd2_journal_insert_checkpoint()
645 * We've finished with this transaction structure: adios...
647 * The transaction must have no links except for the checkpoint by this
654 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction) in __jbd2_journal_drop_transaction() argument
657 if (transaction->t_cpnext) { in __jbd2_journal_drop_transaction()
658 transaction->t_cpnext->t_cpprev = transaction->t_cpprev; in __jbd2_journal_drop_transaction()
659 transaction->t_cpprev->t_cpnext = transaction->t_cpnext; in __jbd2_journal_drop_transaction()
660 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
662 transaction->t_cpnext; in __jbd2_journal_drop_transaction()
663 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
667 J_ASSERT(transaction->t_state == T_FINISHED); in __jbd2_journal_drop_transaction()
668 J_ASSERT(transaction->t_buffers == NULL); in __jbd2_journal_drop_transaction()
669 J_ASSERT(transaction->t_forget == NULL); in __jbd2_journal_drop_transaction()
670 J_ASSERT(transaction->t_shadow_list == NULL); in __jbd2_journal_drop_transaction()
671 J_ASSERT(transaction->t_checkpoint_list == NULL); in __jbd2_journal_drop_transaction()
672 J_ASSERT(transaction->t_checkpoint_io_list == NULL); in __jbd2_journal_drop_transaction()
673 J_ASSERT(atomic_read(&transaction->t_updates) == 0); in __jbd2_journal_drop_transaction()
674 J_ASSERT(journal->j_committing_transaction != transaction); in __jbd2_journal_drop_transaction()
675 J_ASSERT(journal->j_running_transaction != transaction); in __jbd2_journal_drop_transaction()
677 trace_jbd2_drop_transaction(journal, transaction); in __jbd2_journal_drop_transaction()
679 jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); in __jbd2_journal_drop_transaction()