Commit Graph

17 Commits

Author SHA1 Message Date
Thomas Waldmann d1ea925a5b move borg package to src/ 2016-05-05 20:19:50 +02:00
Thomas Waldmann ec930738bf docs: added some insights by "Voltara", fixes #903 2016-04-16 23:27:01 +02:00
Oleg Drokin ce176b52bf Workround a bug in Linux fadvise FADV_DONTNEED, fixes #907
Despite what the man page says, Linux does not discard the initial
partial page only. The ending page would be truncated no matter if
it is partial or not.
Page-align the fadvise size to take care of this.
Also while we are at it, roll back initial fadvise offset to the
previous page boundary to actually throw away that page as we
no longer need it having read the second part now and the first
time in the previous call.

This patch has a noticeable impact in my Linux testing when the file
is on the rotating media. The total test runtime decreased by a bit
over 10%, but since over half of that time was actually cpu time,
the actual iowait time decreased around 20%.
2016-04-15 20:16:47 -04:00
Marian Beermann 061bf59d5d Chunker: fix wrong EOF assumption[1], check for return type[2]
[1]
This worked incidentally because OSes tend to return at least one page
worth of data when EOF is not reached. Increasing WINDOW_SIZE beyond
the page size might have lead to data loss.

[2]
If read() of the passed Python object returned something not-bytes,
PyBytes_Size returns -1 (ssize_t) which becomes a very larger number for
memcpy()s size_t.
2016-03-31 22:03:17 +02:00
Marian Beermann 489eb78cbb Possible fix to silently skipping EIO and the like? #748 2016-03-16 01:32:48 +01:00
Thomas Waldmann b461091be1 fix compiler warnings, fixes #697 2016-03-02 14:45:02 +01:00
Thomas Waldmann 8e13d315bb use PyMemoryView_FromMemory (py 3.3+) 2016-01-24 15:36:04 +01:00
Thomas Waldmann 7247043db0 get rid of C compiler warnings, fixes #391 2015-11-21 22:08:30 +01:00
Thomas Waldmann bc5949a7f4 chunker: add a check whether the POSIX_FADV_DONTNEED constant is defined
on openbsd, it isn't.
2015-09-14 17:36:04 +02:00
Thomas Waldmann e244fe2f69 change 2 more chunker vars to off_t
so they get 64bit on 32bit platforms.
2015-09-06 22:06:52 +02:00
Alan Jenkins 59a44296e4 chunker - cast from size_t to off_t can now be removed
Sorry, this should really have been part of the previous commit -
it's why I noticed a problem.
2015-08-20 17:48:59 +01:00
Alan Jenkins ce3e67cb96 chunker - fix 4GB files on 32-bit systems
From code inspection - effect not actually tested.
2015-08-20 17:23:50 +01:00
Alan Jenkins 7c6f3ece66 Initialize chunker fd to -1, so it's not equal to STDIN_FILENO (0) 2015-08-20 17:23:41 +01:00
Thomas Waldmann d3d78f7ae3 call fadvise DONTNEED for the byterange we actually have read, fixes #158
avoid throwing away potential readahead data the OS might have read into the cache.
2015-08-20 05:33:51 +02:00
Thomas Waldmann 3be55bedd3 chunker: n needs to be a signed size_t
... as it is also used for the read() return value, which can be negative in case of errors.
2015-07-30 15:21:13 +02:00
Thomas Waldmann 072326fef0 chunker: get rid of read_buf
if we have a OS file handle, we can directly read to the final destination - one memcpy less.
if we have a Python file object, we get a Python bytes object as read result (can't save the memcpy here).
2015-05-31 18:41:23 +02:00
Thomas Waldmann 78bfc58b47 rename package directory to borg 2015-05-22 17:48:54 +02:00
Renamed from attic/_chunker.c (Browse further)