aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-04-13 15:15:59 -0400
committerJosef Bacik <josef@redhat.com>2011-05-23 13:00:57 -0400
commit2a1eb4614d984d5cd4c928784e9afcf5c07f93be (patch)
tree892b123c194e490a2dc0bc5b45f641ac921e9d26 /fs/btrfs/transaction.h
parent7a7eaa40a39bde4eefc91aadeb1ce3dc4e6a1252 (diff)
Btrfs: if we've already started a trans handle, use that one
We currently track trans handles in current->journal_info, but we don't actually use it. This patch fixes it. This will cover the case where we have multiple people starting transactions down the call chain. This keeps us from having to allocate a new handle and all of that, we just increase the use count of the current handle, save the old block_rsv, and return. I tested this with xfstests and it worked out fine. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r--fs/btrfs/transaction.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 1f573f09dba2..154314f80f8d 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -47,11 +47,13 @@ struct btrfs_trans_handle {
47 u64 transid; 47 u64 transid;
48 u64 block_group; 48 u64 block_group;
49 u64 bytes_reserved; 49 u64 bytes_reserved;
50 unsigned long use_count;
50 unsigned long blocks_reserved; 51 unsigned long blocks_reserved;
51 unsigned long blocks_used; 52 unsigned long blocks_used;
52 unsigned long delayed_ref_updates; 53 unsigned long delayed_ref_updates;
53 struct btrfs_transaction *transaction; 54 struct btrfs_transaction *transaction;
54 struct btrfs_block_rsv *block_rsv; 55 struct btrfs_block_rsv *block_rsv;
56 struct btrfs_block_rsv *orig_rsv;
55}; 57};
56 58
57struct btrfs_pending_snapshot { 59struct btrfs_pending_snapshot {