aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2016-06-20 17:23:41 -0400
committerDavid Sterba <dsterba@suse.com>2016-07-26 07:54:26 -0400
commit64b63580728ef19137d35363a1c28794b70ad416 (patch)
treef78944d4590ee07bbdea3559712adc4973946d3a
parent05f9a780129c81dfd70ae827a9abb15c7e6321a8 (diff)
btrfs: add btrfs_trans_handle->fs_info pointer
btrfs_trans_handle->root is documented as for use for confirming that the root passed in to start the transaction is the same as the one ending it. It's used in several places when an fs_info pointer is needed, so let's just add an fs_info pointer directly. Eventually, the root pointer can be removed. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/extent-tree.c6
-rw-r--r--fs/btrfs/qgroup.c2
-rw-r--r--fs/btrfs/transaction.c1
-rw-r--r--fs/btrfs/transaction.h1
4 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 44549d706dcd..c6c505e2478f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4589,7 +4589,7 @@ out:
4589 */ 4589 */
4590 if (trans->can_flush_pending_bgs && 4590 if (trans->can_flush_pending_bgs &&
4591 trans->chunk_bytes_reserved >= (u64)SZ_2M) { 4591 trans->chunk_bytes_reserved >= (u64)SZ_2M) {
4592 btrfs_create_pending_block_groups(trans, trans->root); 4592 btrfs_create_pending_block_groups(trans, extent_root);
4593 btrfs_trans_release_chunk_metadata(trans); 4593 btrfs_trans_release_chunk_metadata(trans);
4594 } 4594 }
4595 return ret; 4595 return ret;
@@ -5730,7 +5730,7 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
5730 */ 5730 */
5731void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans) 5731void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans)
5732{ 5732{
5733 struct btrfs_fs_info *fs_info = trans->root->fs_info; 5733 struct btrfs_fs_info *fs_info = trans->fs_info;
5734 5734
5735 if (!trans->chunk_bytes_reserved) 5735 if (!trans->chunk_bytes_reserved)
5736 return; 5736 return;
@@ -8543,7 +8543,7 @@ static int record_one_subtree_extent(struct btrfs_trans_handle *trans,
8543 8543
8544 delayed_refs = &trans->transaction->delayed_refs; 8544 delayed_refs = &trans->transaction->delayed_refs;
8545 spin_lock(&delayed_refs->lock); 8545 spin_lock(&delayed_refs->lock);
8546 if (btrfs_qgroup_insert_dirty_extent(trans->root->fs_info, 8546 if (btrfs_qgroup_insert_dirty_extent(trans->fs_info,
8547 delayed_refs, qrecord)) 8547 delayed_refs, qrecord))
8548 kfree(qrecord); 8548 kfree(qrecord);
8549 spin_unlock(&delayed_refs->lock); 8549 spin_unlock(&delayed_refs->lock);
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 3a83631c1176..93ee1c18ef9d 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2196,7 +2196,7 @@ void assert_qgroups_uptodate(struct btrfs_trans_handle *trans)
2196{ 2196{
2197 if (list_empty(&trans->qgroup_ref_list) && !trans->delayed_ref_elem.seq) 2197 if (list_empty(&trans->qgroup_ref_list) && !trans->delayed_ref_elem.seq)
2198 return; 2198 return;
2199 btrfs_err(trans->root->fs_info, 2199 btrfs_err(trans->fs_info,
2200 "qgroups not uptodate in trans handle %p: list is%s empty, " 2200 "qgroups not uptodate in trans handle %p: list is%s empty, "
2201 "seq is %#x.%x", 2201 "seq is %#x.%x",
2202 trans, list_empty(&trans->qgroup_ref_list) ? "" : " not", 2202 trans, list_empty(&trans->qgroup_ref_list) ? "" : " not",
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index d986447d19a4..41e14c632c3f 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -561,6 +561,7 @@ again:
561 h->transaction = cur_trans; 561 h->transaction = cur_trans;
562 h->root = root; 562 h->root = root;
563 h->use_count = 1; 563 h->use_count = 1;
564 h->fs_info = root->fs_info;
564 565
565 h->type = type; 566 h->type = type;
566 h->can_flush_pending_bgs = true; 567 h->can_flush_pending_bgs = true;
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index c5abee4f01ad..efb122643380 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -128,6 +128,7 @@ struct btrfs_trans_handle {
128 * Subvolume quota depends on this 128 * Subvolume quota depends on this
129 */ 129 */
130 struct btrfs_root *root; 130 struct btrfs_root *root;
131 struct btrfs_fs_info *fs_info;
131 struct seq_list delayed_ref_elem; 132 struct seq_list delayed_ref_elem;
132 struct list_head qgroup_ref_list; 133 struct list_head qgroup_ref_list;
133 struct list_head new_bgs; 134 struct list_head new_bgs;