]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: avoid visiting all extent items when cloning a range
authorFilipe Manana <fdmanana@gmail.com>
Sat, 31 May 2014 01:31:05 +0000 (02:31 +0100)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:21:04 +0000 (17:21 -0700)
commitcb12195bea5a144a1fa419a923eff28c93479a77
tree65f95634ccd85b562325e1134ce16180cb179c32
parentd910e940ad567d7a17e7049743f11757b9167b07
Btrfs: avoid visiting all extent items when cloning a range

When cloning a range of a file, we were visiting all the extent items in
the btree that belong to our source inode. We don't need to visit those
extent items that don't overlap the range we are cloning, as doing so only
makes us waste time and do unnecessary btree navigations (btrfs_next_leaf)
for inodes that have a large number of file extent items in the btree.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ioctl.c