]> 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)
commite5a37164866bd6d663708bdf55c5f70ff7ad6bb8
tree65f95634ccd85b562325e1134ce16180cb179c32
parent0cb072ede674cb3a818b3374453e102f0e685ce3
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