On the coreutils list, there was a recent discussion about using fiemap and/or SEEK_DATA/SEEK_HOLE support in recent OSs to efficiently detect holes in sparse files:

http://lists.gnu.org/archive/html/bug-coreutils/2010-07/msg00100.html

I think porting cmp to use this would be a nice optimization to make it faster to run cmp on two large but sparse files, since you could efficiently skip runs of 0.

--
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to