]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: only process as many file extents as there are refs
authorJosef Bacik <jbacik@fb.com>
Fri, 24 Jan 2014 19:05:42 +0000 (14:05 -0500)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:20:28 +0000 (13:20 -0800)
commitf687c314fb8bff767d018a9fee623c88eff39cad
tree70ea7ddd1d3285530f35568c62d1da3fd88b9099
parent3a393a792e458c49f22de0d588bb11a7a1193e13
Btrfs: only process as many file extents as there are refs

The backref walking code will search down to the key it is looking for and then
proceed to walk _all_ of the extents on the file until it hits the end.  This is
suboptimal with large files, we only need to look for as many extents as we have
references for that inode.  I have a testcase that creates a randomly written 4
gig file and before this patch it took 6min 30sec to do the initial send, with
this patch it takes 2min 30sec to do the intial send.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/backref.c