summaryrefslogtreecommitdiff
path: root/transaction.c
Commit message (Collapse)AuthorAge
* btrfs-progs: Wire up delayed refsNikolay Borisov2018-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit enables the delayed refs infrastructures. This entails doing the following: 1. Replacing existing calls of btrfs_extent_post_op (which is the equivalent of delayed refs) with the proper btrfs_run_delayed_refs. As well as eliminating open-coded calls to finish_current_insert and del_pending_extents which execute the delayed ops. 2. Wiring up the addition of delayed refs when freeing extents (btrfs_free_extent) and when adding new extents (alloc_tree_block). 3. Adding calls to btrfs_run_delayed refs in the transaction commit path alongside comments why every call is needed, since it's not always obvious (those call sites were derived empirically by running and debugging existing tests) 4. Correctly flagging the transaction in which we are reinitialising the extent tree. 5. Moving btrfs_write_dirty_block_groups to btrfs_write_dirty_block_groups since blockgroups should be written to disk after the last delayed refs have been run. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Make btrfs_write_dirty_block_groups take only trans argumentNikolay Borisov2018-10-23
| | | | | | | | | | The root argument is used only to get a reference to the fs_info, this can be achieved with the transaction handle being passed so use that. This is in preparation for moving this function in the main transaction commit routine. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: transaction: do proper error handling in transaction commitQu Wenruo2018-09-13
| | | | | | | | | | | There are cases that btrfs_commit_transaction() itself can fail, mostly due to ENOSPC when allocating space. Don't panic out in this case. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Gu Jinxiang <gujx@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Add boolean to signal whether we are re-initing extent treeNikolay Borisov2018-08-06
| | | | | | | | | Add a boolean to record whether the extent tree is being re-initialised in the current transaction. This is going to be needed by the delayed refs code. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Remove fs_info argument from write_ctree_superNikolay Borisov2018-06-07
| | | | | | | | | This function already takes a transaction handle which has a reference to the fs_info, so use that to obtain it. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: don't start or commit after transaction abortDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: start framework for transaction abortDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: store pointer to fs_info in transaction handleDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move transaction code out of disk-ioDavid Sterba2017-09-08
| | | | | | Temporarily export the low-level helpers. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move transaction implementation out of headerDavid Sterba2017-09-08
Signed-off-by: David Sterba <dsterba@suse.com>