]> Dogcows Code - chaz/tar/commit
tar: optimize -c --sparse when file is entirely sparse
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Aug 2010 00:28:11 +0000 (17:28 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 25 Aug 2010 00:29:06 +0000 (17:29 -0700)
commita9895fd20c957ce184091672f1623a5bedd82407
tree763803bfc1533d1b292fc71ad6c1d1f2afa45778
parenta59c819beb4886ee43f16dfd80ec1151fda1abe6
tar: optimize -c --sparse when file is entirely sparse

* src/sparse.c (sparse_scan_file): If the file is entirely sparse,
that is, if ST_NBLOCKS is zero, don't bother scanning for nonzero
blocks.  Idea by Kit Westneat, communicated by Bernd Schubert in
<http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00038.html>.
Also, omit unnecessary lseek at start of file.
src/sparse.c
This page took 0.024113 seconds and 4 git commands to generate.