[PATCH] fadvise(2) system call

Tim Kientzle tim at kientzle.com
Thu Nov 10 06:03:21 UTC 2011


On Nov 9, 2011, at 4:57 PM, Peter Wemm wrote:

> Did 'tar tvf' stop seeking and doing random seek/reads for raw tar
> files?  I know it can't do this for a stream compressed file and
> there's no choice but to read it all.

bsdtar has for some years optimized 'tar tvf' on uncompressed
tar archives by using seek operations to skip over the
bodies of large files.  Makes a big difference in some situations.

The optimization is actually integrated deeply into
libarchive; the individual format handlers identify
cases where the stream contents will be ignored
("skipped") and the I/O layer can use this as it sees
fit.   As a result, the optimization works cleanly with
tar, cpio, ISO, Zip, and other formats.

It sounds like some of the folks on this thread
would have fun with the strategy section of
libarchive/archive_read_open_filename.c.
Anyone know how to properly request a "skip forward"
on tape drives?  That's one of the missing pieces.

Tim



More information about the freebsd-arch mailing list