git.annexia.org
/
pxzcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b09470
)
Use posix_fadvise to tell the kernel how we use the output file.
author
Richard W.M. Jones
<rjones@redhat.com>
Tue, 22 Oct 2013 10:59:30 +0000
(11:59 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Tue, 22 Oct 2013 10:59:30 +0000
(11:59 +0100)
pxzcat.c
patch
|
blob
|
history
diff --git
a/pxzcat.c
b/pxzcat.c
index
346e3f8
..
a6becce
100644
(file)
--- a/
pxzcat.c
+++ b/
pxzcat.c
@@
-171,6
+171,9
@@
xzfile_uncompress (const char *filename, const char *outputfile,
if (ftruncate (ofd, size) == -1)
error (EXIT_FAILURE, errno, "ftruncate: %s", outputfile);
+ /* Tell the kernel we won't read the output file. */
+ posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED);
+
/* Iterate over blocks. */
iter_blocks (idx, nr_threads, filename, fd, outputfile, ofd);