Lines Matching refs:transaction

16 #include "transaction.h"
31 * No running transaction (fs tree blocks are not modified)
38 * | New trans handles can be attached to transaction N by calling all
43 * | transaction N
47 * | Will wait for previous running transaction to completely finish if there
53 * | - Wait for current transaction to be committed by others.
57 * | to this running transaction.
59 * | transaction N+1.
62 * | Caller is chosen to commit transaction N, and all other trans handle
67 * | The heavy lifting transaction work is started.
74 * | transaction to finish and attach to transaction N+1.
85 * | At this stage, new transaction is allowed to |
96 * This transaction is finished and all its [[TRANS_STATE_COMMIT_START]]
118 void btrfs_put_transaction(struct btrfs_transaction *transaction)
120 WARN_ON(refcount_read(&transaction->use_count) == 0);
121 if (refcount_dec_and_test(&transaction->use_count)) {
122 BUG_ON(!list_empty(&transaction->list));
124 &transaction->delayed_refs.href_root.rb_root));
126 &transaction->delayed_refs.dirty_extent_root));
127 if (transaction->delayed_refs.pending_csums)
128 btrfs_err(transaction->fs_info,
130 transaction->delayed_refs.pending_csums);
133 * because the transaction was aborted and a commit did not
138 while (!list_empty(&transaction->deleted_bgs)) {
141 cache = list_first_entry(&transaction->deleted_bgs,
148 WARN_ON(!list_empty(&transaction->dev_update_list));
149 kfree(transaction);
155 struct btrfs_transaction *cur_trans = trans->transaction;
252 * To be called after all the new block groups attached to the transaction
270 * either allocate a new transaction or hop into the existing one
305 * current transaction, and commit it. If there is no transaction, just
312 * JOIN_NOLOCK only happens during the transaction commit, so
324 * someone started a transaction after we unlocked. Make sure
345 * commit the transaction.
358 * although the tree mod log is per file system and not per transaction,
359 * the log must never go across transaction boundaries.
363 WARN(1, KERN_ERR "BTRFS: tree_mod_seq_list not empty when creating a fresh transaction\n");
365 WARN(1, KERN_ERR "BTRFS: tree_mod_log rb tree not empty when creating a fresh transaction\n");
396 * is properly recorded in a given transaction. This is required to make sure
397 * the old root from before we joined the transaction is deleted when the
398 * transaction commits.
437 * this transaction.
465 struct btrfs_transaction *cur_trans = trans->transaction;
467 /* Add ourselves to the transaction dropped list */
511 /* wait for commit against the current transaction to become unblocked
512 * when this is done, it is safe to start a new transaction, but the current
513 * transaction might not be fully on disk.
590 * Do the reservation before we join the transaction so we can do all
605 * we only do 1 enospc flushing cycle per transaction start. We
657 * If we are JOIN_NOLOCK we're already committing a transaction and
664 * transaction and commit it, so we needn't do sb_start_intwrite().
688 h->transaction = cur_trans;
706 trace_btrfs_space_reservation(fs_info, "transaction",
733 * transaction.
783 * Similar to regular join but it never starts a transaction when none is
793 * btrfs_attach_transaction() - catch the running transaction
795 * It is used when we want to commit the current the transaction, but
799 * running transaction. But it is possible that the inactive transaction
801 * inactive transaction in the fs when -ENOENT is returned, you should
812 * btrfs_attach_transaction_barrier() - catch the running transaction
836 /* wait for a transaction commit to be fully complete */
851 /* find specified transaction */
868 * The specified transaction doesn't exist, or we
877 /* find newest transaction that is committing | committed */
918 struct btrfs_transaction *cur_trans = trans->transaction;
942 trace_btrfs_space_reservation(fs_info, "transaction",
953 struct btrfs_transaction *cur_trans = trans->transaction;
1043 * the transaction (through extent_io_tree_release()).
1067 * those extents are on disk for transaction or log commit. We wait
1084 * When committing the transaction, we'll remove any entries
1087 * concurrently - we do it only at transaction commit time when
1148 * This function ensures such extents are persisted on disk for transaction or
1151 * @trans: transaction whose dirty pages we'd like to write
1157 struct extent_io_tree *dirty_pages = &trans->transaction->dirty_pages;
1166 extent_io_tree_release(&trans->transaction->dirty_pages);
1226 struct list_head *dirty_bgs = &trans->transaction->dirty_bgs;
1227 struct list_head *io_bgs = &trans->transaction->io_bgs;
1273 &trans->transaction->switch_commits);
1295 &trans->transaction->switch_commits);
1359 &trans->transaction->switch_commits);
1420 * roots inside one transaction and write all btree into disk, to make
1449 * We are going to commit transaction, see btrfs_commit_transaction()
1468 * Now we do a simplified commit transaction, which will:
1486 "Error while writing out transaction for qgroup");
1504 * transaction commit. This does the actual creation.
1507 * If the error which may affect the commitment of the current transaction
1569 trace_btrfs_space_reservation(fs_info, "transaction",
1784 struct list_head *head = &trans->transaction->pending_snapshots;
1845 * wait for the current transaction commit to start and block subsequent
1846 * transaction joins
1857 * wait for the current transaction to start and then become unblocked.
1871 * returns, any subsequent transaction will not be allowed to join.
1884 * We've got freeze protection passed with the transaction.
1915 /* take transaction reference */
1916 cur_trans = trans->transaction;
1930 /* wait for transaction to start and unblock */
1947 struct btrfs_transaction *cur_trans = trans->transaction;
1956 * If the transaction is removed from the list, it means this
1957 * transaction has been committed successfully, so it is impossible
1972 * Now that we know no one else is still using the transaction we can
1973 * remove the transaction from the list of transactions. This avoids
1974 * the transaction kthread from cleaning up the transaction while some
1976 * on things like log trees, as it forces the transaction kthread to
1977 * wait for this transaction to be cleaned up by us.
1983 btrfs_cleanup_one_transaction(trans->transaction, fs_info);
2006 * transaction and remove them from the list
2029 * from already being in a transaction and our join_transaction doesn't
2036 struct list_head *head = &trans->transaction->pending_snapshots;
2064 struct list_head *head = &trans->transaction->pending_snapshots;
2081 struct btrfs_transaction *cur_trans = trans->transaction;
2088 * Some places just start a transaction to commit it. We need to make
2090 * transaction as failed, so set trans->dirty to make the abort code do
2114 cur_trans = trans->transaction;
2117 * set the flushing flag so procs in this transaction have to
2139 * will wait for the transaction to commit if it
2200 * The previous transaction was aborted and was already removed
2233 * transaction. Otherwise if this transaction commits before the ordered
2242 * commit the transaction. We could have started a join before setting
2295 WARN_ON(cur_trans != trans->transaction);
2317 * Since the transaction is done, we can apply the pending changes
2318 * before the next transaction.
2397 "Error while writing out transaction");
2460 btrfs_warn(fs_info, "Skipping commit of aborted transaction.");