]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: avoid taking the chunk_mutex in do_chunk_alloc
authorJosef Bacik <josef@redhat.com>
Tue, 12 Apr 2011 00:20:11 +0000 (20:20 -0400)
committerChris Mason <chris.mason@oracle.com>
Sat, 16 Apr 2011 11:10:56 +0000 (07:10 -0400)
commit15c2297dcdc1db42b881260ba84e086bca00bc3a
treefaf541835e82e9d56c7474c04b2d785821fe61d3
parentd217ed5377e98d91ea8e72d2fd9d9b8c57e1e28d
Btrfs: avoid taking the chunk_mutex in do_chunk_alloc

Everytime we try to allocate disk space we try and see if we can pre-emptively
allocate a chunk, but in the common case we don't allocate anything, so there is
no sense in taking the chunk_mutex at all.  So instead if we are allocating a
chunk, mark it in the space_info so we don't get two people trying to allocate
at the same time.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Reviewed-by: Liu Bo <liubo2009@cn.fujitsu.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c