]> arthur.barton.de Git - bup.git/commit
Don't fadvise we don't need data that we do need
authorAidan Hobson Sayers <aidanhs@cantab.net>
Sun, 25 Jan 2015 23:50:27 +0000 (23:50 +0000)
committerRob Browning <rlb@defaultvalue.org>
Mon, 26 Jan 2015 00:48:14 +0000 (18:48 -0600)
commitd5c312629e2cd72242c00b446149721bda636849
treedf36a7451dad81eedabd768db5e8ccf062456bac
parent4f466d63f596bb4466d359806ea63c3079628e7c
Don't fadvise we don't need data that we do need

The documentation for posix_fadvise states that if len is 0 the advice
extends to the end of the file. We currently always pass 0 for
the first two posix_fadvise calls (first because ofs is 0, second
because ofs == BLOB_READ_SIZE == 1024*1024) so we're advising the kernel
to dump any predicted file caching twice per file.

This patch ensures we don't pass a len of 0 in the two scenarios above.

Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
[rlb@defaultvalue.org: adjust commit summary]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/hashsplit.py