OSDN Git Service

Btrfs: adjust the write_lock_level as we unlock
authorChris Mason <chris.mason@oracle.com>
Mon, 19 Mar 2012 19:54:38 +0000 (15:54 -0400)
committerChris Mason <chris.mason@oracle.com>
Mon, 26 Mar 2012 21:04:24 +0000 (17:04 -0400)
commitf7c79f30cb2d3883488e70cafc9e3a7edd4b9fdb
tree784c5c878e85a7b8fa283e22767b057d6cfcfa40
parenta098d8e8eec5a46a47b1bb74390746973d913a9c
Btrfs: adjust the write_lock_level as we unlock

btrfs_search_slot sometimes needs write locks on high levels of
the tree.  It remembers the highest level that needs a write lock
and will use that for all future searches through the tree in a given
call.

But, very often we'll just cow the top level or the level below and we
won't really need write locks on the root again after that.  This patch
changes things to adjust the write lock requirement as it unlocks
levels.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.c