diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-08-01 15:27:23 (GMT) |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 15:04:06 (GMT) |
commit | f87f057b49ee52cf5c627ab27a706e3252767c9f (patch) | |
tree | 4f8cc04e91ae836f4dd1b2151f47cbd1bd1b9367 /fs/btrfs/locking.h | |
parent | 492bb6deee3416ad792dcd8584ebd95c463af1a6 (diff) | |
download | linux-f87f057b49ee52cf5c627ab27a706e3252767c9f.tar.xz |
Btrfs: Improve and cleanup locking done by walk_down_tree
While dropping snapshots, walk_down_tree does most of the work of checking
reference counts and limiting tree traversal to just the blocks that
we are freeing.
It dropped and held the allocation mutex in strange and confusing ways,
this commit changes it to only hold the mutex while actually freeing a block.
The rest of the checks around reference counts should be safe without the lock
because we only allow one process in btrfs_drop_snapshot at a time. Other
processes dropping reference counts should not drop it to 1 because
their tree roots already have an extra ref on the block.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/locking.h')
0 files changed, 0 insertions, 0 deletions