]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Btrfs: try to avoid doing a search in btrfs_next_leaf
authorJosef Bacik <jbacik@fusionio.com>
Mon, 24 Sep 2012 20:01:09 +0000 (16:01 -0400)
committerChris Mason <chris.mason@fusionio.com>
Mon, 1 Oct 2012 19:19:35 +0000 (15:19 -0400)
commit6c751cbb0621292296af77c47f6dfaa28cca2ed4
treed7e972e00fde5e64d3f82e92b5442c26ce034d60
parent877d16dcd05cd7e517cb9dc4eece0d3c0c1f038e
Btrfs: try to avoid doing a search in btrfs_next_leaf

Things like btrfs_drop_extents call btrfs_next_leaf to see if there is
anything else they need on the next leaf.  This will result in a re-search,
but if we are already at the last leaf in the tree or if the first item in
the next leaf doesn't match the objectid of the one we want we can just
return without doing the search at all.  This helps in things like fsync()
where our tree is pretty shallow and we're likely to be on the last leaf
often.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/ctree.c
fs/btrfs/ctree.h