summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorJosef Bacik2011-04-11 21:45:29 +0200
committerJosef Bacik2011-04-12 02:43:52 +0200
commit13c5a93e7005d7dae0b6d070d25203593e692d13 (patch)
treeecbc7205618940bbba3f0d9ad000462a5364f763 /fs/btrfs/disk-io.c
parentBtrfs: check for duplicate iov_base's when doing dio reads (diff)
downloadkernel-qcow2-linux-13c5a93e7005d7dae0b6d070d25203593e692d13.tar.gz
kernel-qcow2-linux-13c5a93e7005d7dae0b6d070d25203593e692d13.tar.xz
kernel-qcow2-linux-13c5a93e7005d7dae0b6d070d25203593e692d13.zip
Btrfs: avoid taking the trans_mutex in btrfs_end_transaction
I've been working on making our O_DIRECT latency not suck and I noticed we were taking the trans_mutex in btrfs_end_transaction. So to do this we convert num_writers and use_count to atomic_t's and just decrement them in btrfs_end_transaction. Instead of deleting the transaction from the trans list in put_transaction we do that in btrfs_commit_transaction() since that's the only time it actually needs to be removed from the list. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index a272bfd74ea0..ef6865c17cd6 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3136,7 +3136,7 @@ static int btrfs_cleanup_transaction(struct btrfs_root *root)
btrfs_destroy_pinned_extent(root,
root->fs_info->pinned_extents);
- t->use_count = 0;
+ atomic_set(&t->use_count, 0);
list_del_init(&t->list);
memset(t, 0, sizeof(*t));
kmem_cache_free(btrfs_transaction_cachep, t);