Btrfs: avoid taking the trans_mutex in btrfs_end_transaction
authorJosef Bacik <josef@redhat.com>
Mon, 11 Apr 2011 19:45:29 +0000 (15:45 -0400)
committerJosef Bacik <josef@redhat.com>
Tue, 12 Apr 2011 00:43:52 +0000 (20:43 -0400)
commit13c5a93e7005d7dae0b6d070d25203593e692d13
treeecbc7205618940bbba3f0d9ad000462a5364f763
parent93a54bc4c28a125978cddbe2db9e347391e3522d
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>
fs/btrfs/disk-io.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h