• 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()
83 * Try to release a checkpointed buffer from its transaction.
85 * whole transaction.
124 * transaction to complete. If there is absolutely no way in __jbd2_log_wait_for_space()
198 * Perform an actual checkpoint. We take the first transaction on the
209 transaction_t *transaction; in jbd2_log_do_checkpoint() local
227 * OK, we need to start writing disk blocks. Take one transaction in jbd2_log_do_checkpoint()
234 transaction = journal->j_checkpoint_transactions; in jbd2_log_do_checkpoint()
235 if (transaction->t_chp_stats.cs_chp_time == 0) in jbd2_log_do_checkpoint()
236 transaction->t_chp_stats.cs_chp_time = jiffies; in jbd2_log_do_checkpoint()
237 this_tid = transaction->t_tid; in jbd2_log_do_checkpoint()
240 * If someone cleaned up this transaction while we slept, we're in jbd2_log_do_checkpoint()
241 * done (maybe it's a new transaction, but it fell at the same in jbd2_log_do_checkpoint()
244 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
245 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
248 /* checkpoint all of the transaction's buffers */ in jbd2_log_do_checkpoint()
249 while (transaction->t_checkpoint_list) { in jbd2_log_do_checkpoint()
250 jh = transaction->t_checkpoint_list; in jbd2_log_do_checkpoint()
266 transaction->t_chp_stats.cs_forced_to_close++; in jbd2_log_do_checkpoint()
288 /* The transaction was released; we're done */ in jbd2_log_do_checkpoint()
295 * lock. We cannot afford to let the transaction in jbd2_log_do_checkpoint()
305 transaction->t_chp_stats.cs_written++; in jbd2_log_do_checkpoint()
323 * Now we issued all of the transaction's buffers, let's deal in jbd2_log_do_checkpoint()
327 /* Did somebody clean up the transaction in the meanwhile? */ in jbd2_log_do_checkpoint()
328 if (journal->j_checkpoint_transactions != transaction || in jbd2_log_do_checkpoint()
329 transaction->t_tid != this_tid) in jbd2_log_do_checkpoint()
332 while (transaction->t_checkpoint_io_list) { in jbd2_log_do_checkpoint()
333 jh = transaction->t_checkpoint_io_list; in jbd2_log_do_checkpoint()
377 * aware of transaction aborts. Checkpointing involves writing to the
420 * Returns 1 if we freed the transaction, 0 otherwise.
466 transaction_t *transaction, *last_transaction, *next_transaction; in __jbd2_journal_clean_checkpoint_list() local
469 transaction = journal->j_checkpoint_transactions; in __jbd2_journal_clean_checkpoint_list()
470 if (!transaction) in __jbd2_journal_clean_checkpoint_list()
473 last_transaction = transaction->t_cpprev; in __jbd2_journal_clean_checkpoint_list()
474 next_transaction = transaction; in __jbd2_journal_clean_checkpoint_list()
476 transaction = next_transaction; in __jbd2_journal_clean_checkpoint_list()
477 next_transaction = transaction->t_cpnext; in __jbd2_journal_clean_checkpoint_list()
478 ret = journal_clean_one_cp_list(transaction->t_checkpoint_list, in __jbd2_journal_clean_checkpoint_list()
494 ret = journal_clean_one_cp_list(transaction-> in __jbd2_journal_clean_checkpoint_list()
499 * Stop scanning if we couldn't free the transaction. This in __jbd2_journal_clean_checkpoint_list()
505 } while (transaction != last_transaction); in __jbd2_journal_clean_checkpoint_list()
535 * We cannot safely clean a transaction out of the log until all of the
536 * buffer updates committed in that transaction have safely been stored
538 * transaction need to be maintained on the transaction's checkpoint
540 * called to remove the buffer from the existing transaction's
543 * The function returns 1 if it frees the transaction, 0 otherwise.
551 transaction_t *transaction; in __jbd2_journal_remove_checkpoint() local
557 if ((transaction = jh->b_cp_transaction) == NULL) { in __jbd2_journal_remove_checkpoint()
558 JBUFFER_TRACE(jh, "not on transaction"); in __jbd2_journal_remove_checkpoint()
561 journal = transaction->t_journal; in __jbd2_journal_remove_checkpoint()
563 JBUFFER_TRACE(jh, "removing from transaction"); in __jbd2_journal_remove_checkpoint()
568 if (transaction->t_checkpoint_list != NULL || in __jbd2_journal_remove_checkpoint()
569 transaction->t_checkpoint_io_list != NULL) in __jbd2_journal_remove_checkpoint()
574 * buffer off a running or committing transaction's checkpoing list, in __jbd2_journal_remove_checkpoint()
575 * then even if the checkpoint list is empty, the transaction obviously in __jbd2_journal_remove_checkpoint()
581 if (transaction->t_state != T_FINISHED) in __jbd2_journal_remove_checkpoint()
584 /* OK, that was the last buffer for the transaction: we can now in __jbd2_journal_remove_checkpoint()
585 safely remove this transaction from the log */ in __jbd2_journal_remove_checkpoint()
586 stats = &transaction->t_chp_stats; in __jbd2_journal_remove_checkpoint()
591 transaction->t_tid, stats); in __jbd2_journal_remove_checkpoint()
593 __jbd2_journal_drop_transaction(journal, transaction); in __jbd2_journal_remove_checkpoint()
594 jbd2_journal_free_transaction(transaction); in __jbd2_journal_remove_checkpoint()
602 * list so that we know when it is safe to clean the transaction out of
609 transaction_t *transaction) in __jbd2_journal_insert_checkpoint() argument
615 /* Get reference for checkpointing transaction */ in __jbd2_journal_insert_checkpoint()
617 jh->b_cp_transaction = transaction; in __jbd2_journal_insert_checkpoint()
619 if (!transaction->t_checkpoint_list) { in __jbd2_journal_insert_checkpoint()
622 jh->b_cpnext = transaction->t_checkpoint_list; in __jbd2_journal_insert_checkpoint()
623 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev; in __jbd2_journal_insert_checkpoint()
627 transaction->t_checkpoint_list = jh; in __jbd2_journal_insert_checkpoint()
631 * We've finished with this transaction structure: adios...
633 * The transaction must have no links except for the checkpoint by this
640 void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transaction) in __jbd2_journal_drop_transaction() argument
643 if (transaction->t_cpnext) { in __jbd2_journal_drop_transaction()
644 transaction->t_cpnext->t_cpprev = transaction->t_cpprev; in __jbd2_journal_drop_transaction()
645 transaction->t_cpprev->t_cpnext = transaction->t_cpnext; in __jbd2_journal_drop_transaction()
646 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
648 transaction->t_cpnext; in __jbd2_journal_drop_transaction()
649 if (journal->j_checkpoint_transactions == transaction) in __jbd2_journal_drop_transaction()
653 J_ASSERT(transaction->t_state == T_FINISHED); in __jbd2_journal_drop_transaction()
654 J_ASSERT(transaction->t_buffers == NULL); in __jbd2_journal_drop_transaction()
655 J_ASSERT(transaction->t_forget == NULL); in __jbd2_journal_drop_transaction()
656 J_ASSERT(transaction->t_shadow_list == NULL); in __jbd2_journal_drop_transaction()
657 J_ASSERT(transaction->t_checkpoint_list == NULL); in __jbd2_journal_drop_transaction()
658 J_ASSERT(transaction->t_checkpoint_io_list == NULL); in __jbd2_journal_drop_transaction()
659 J_ASSERT(atomic_read(&transaction->t_updates) == 0); in __jbd2_journal_drop_transaction()
660 J_ASSERT(journal->j_committing_transaction != transaction); in __jbd2_journal_drop_transaction()
661 J_ASSERT(journal->j_running_transaction != transaction); in __jbd2_journal_drop_transaction()
663 trace_jbd2_drop_transaction(journal, transaction); in __jbd2_journal_drop_transaction()
665 jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid); in __jbd2_journal_drop_transaction()