]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Btrfs: make some tree searches in send.c more efficient
authorFilipe David Borba Manana <fdmanana@gmail.com>
Wed, 5 Feb 2014 16:48:56 +0000 (16:48 +0000)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:15:49 +0000 (15:15 -0400)
commitdff6d0adbe998927f72fc8d9ceee8ff72b124328
treeb01f2349fadc31a0af2f38a69000bf41b7f29bb8
parenta0859c0998605d2dc1b021543398cd84a40589db
Btrfs: make some tree searches in send.c more efficient

We have this pattern where we do search for a contiguous group of
items in a tree and everytime we find an item, we process it, then
we release our path, increment the offset of the search key, do
another full tree search and repeat these steps until a tree search
can't find more items we're interested in.

Instead of doing these full tree searches after processing each item,
just process the next item/slot in our leaf and don't release the path.
Since all these trees are read only and we always use the commit root
for a search and skip node/leaf locks, we're not affecting concurrency
on the trees.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/send.c