]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: avoid starting a transaction in the write path
authorJosef Bacik <jbacik@fusionio.com>
Wed, 14 Aug 2013 18:02:47 +0000 (14:02 -0400)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:05:05 +0000 (08:05 -0400)
commit0c46b867adcabd6fd119c19bee7b91daaea9edcb
tree161dfa7f29d5aa907de0fee6bdc487f9a2bcb342
parentc4d1c07d9bb5bfb52982e949b1d742a696abd9c9
Btrfs: avoid starting a transaction in the write path

I noticed while looking at a deadlock that we are always starting a transaction
in cow_file_range().  This isn't really needed since we only need a transaction
if we are doing an inline extent, or if the allocator needs to allocate a chunk.
So push down all the transaction start stuff to be closer to where we actually
need a transaction in all of these cases.  This will hopefully reduce our write
latency when we are committing often.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.h
fs/btrfs/inode.c