Operating systems provide APIs (FIEMAP ioctl in case of Linux, who really cares about others) to get the information regarding underlying FS extents of a file, including whether the extent is zero-initialized and never touched afterwards (FIEMAP_EXTENT_UNWRITTEN). For the pieces that are located inside such extents, it's obvious in advance that sha(block) = sha('\0' * block_size), so the SHA computation can be bypassed. It can significantly improve recheck times in cases when rtorrent was killed while downloading.
Operating systems provide APIs (
FIEMAP
ioctl in case of Linux, who really cares about others) to get the information regarding underlying FS extents of a file, including whether the extent is zero-initialized and never touched afterwards (FIEMAP_EXTENT_UNWRITTEN
). For the pieces that are located inside such extents, it's obvious in advance thatsha(block) = sha('\0' * block_size)
, so the SHA computation can be bypassed. It can significantly improve recheck times in cases when rtorrent was killed while downloading.