Commit graph

54 commits

Author SHA1 Message Date
Allan Clark
5886923bb1 Add bandwidth limit feature --bw-limit 2025-03-29 19:29:55 +01:00
Andrea Mazzoleni
a605442c8c Fix typos in messages 2023-12-09 15:35:45 +01:00
Andrea Gelmini
986e9b4131 Fix typos 2020-05-26 12:50:15 +02:00
Andrea Mazzoleni
9a21995a61 Split the parity close and truncate operations
To avoid any possible conflicts.
2019-06-04 19:28:43 +02:00
Andrea Mazzoleni
a873eee208 Improve parity fixing speed 2019-05-19 10:04:53 +02:00
Andrea Mazzoleni
54015a2df8 Add some more logging in case of failure of parity resize 2017-11-24 23:02:45 +01:00
Andrea Mazzoleni
68563650c9 Use fallocate() with an offset starting at the missing data
This works better with Btrfs.
2017-11-24 23:02:41 +01:00
Andrea Mazzoleni
713a8138c0 Minor formatting changes 2017-11-03 23:46:45 +01:00
Andrea Mazzoleni
61a1e7a7e6 Use casting when printing value that may be of a different type
The stat struct could use whatever type for st_* fields.
2017-10-27 22:54:42 +02:00
Andrea Mazzoleni
cb84c61d07 Extend the coverage test 2016-11-06 20:23:11 +01:00
Andrea Mazzoleni
8de78a8b9f Use portable format specified for printf
Otherwise they raise a warning when building for x64.
2016-11-06 15:52:14 +01:00
Andrea Mazzoleni
ba0184c37c Add a test option to skip the space holder 2016-10-05 00:12:29 +02:00
Andrea Mazzoleni
a61c415d39 Fix printing of outofparity message 2016-10-02 00:06:48 +02:00
Andrea Mazzoleni
eb039e8186 Print the outofparity explanation at the end
Otherwise it could scroll away.
2016-09-30 18:40:54 +02:00
Andrea Mazzoleni
3bdc9b93ad Add additional checks on parity size
Ensures that it's always aligned at the block size.
Also adds more comments about resizing process.
2016-09-28 20:32:50 +02:00
Andrea Mazzoleni
422d642591 Check that the parity was fully allocated
We must check if any remaining size is left to be
allocated.
2016-09-28 18:55:50 +02:00
Andrea Mazzoleni
85df40f40d Clarify about the space holder for Windows
In Windows we keep 256 MB to avoid warnings.
2016-08-31 22:26:17 +02:00
Andrea Mazzoleni
5911da55c0 In Windows leave 256 MB of free space in the parity disk
This is done to avoid the annoying warning message of
disk full.
2016-07-27 23:06:59 +02:00
Andrea Mazzoleni
6637d712a3 Remove unneded assignment
It confuses static analyzers.
2016-07-26 21:08:42 +02:00
Andrea Mazzoleni
0b4aee793a Avoid to close invalid handle
This could happen if open() return -1.
2016-07-26 20:51:20 +02:00
Andrea Mazzoleni
ef6958b410 No way to fix the wrong aligment
The only possibility is to regenerate parity.
2016-07-26 19:34:48 +02:00
Andrea Mazzoleni
2b31d23a10 Fix incorrect split size
This fixes invalid size stored in the content file
generated by previous bad BETA versions.
2016-07-25 22:23:32 +02:00
Andrea Mazzoleni
501b1d7983 Avoid extra allocation in parity file
After growing the parity file, call an extra ftruncate()
to ensure to cut the file to the exact size, removing any extra
allocation that could result by failed attempts to grow it.
Note that how fallocate() behaves on failures is not really
specified, so it's possible that extra space is allocated.
2016-07-25 21:58:20 +02:00
Andrea Mazzoleni
256db0e595 Rename internal esc/quote functions
No functional change
2016-05-29 18:19:32 +02:00
Andrea Mazzoleni
3c6c5c07c7 More extensive use of data_off_t
This avoids the need of some type cast.
2016-05-18 20:58:41 +02:00
Andrea Mazzoleni
bec310d50b Add regression test for multi parity 2016-05-17 19:08:12 +02:00
Andrea Mazzoleni
21241c5078 Preliminary advise support 2016-05-15 14:50:59 +02:00
Andrea Mazzoleni
2bebc5d953 Add fallocate in Windows and comment about its use 2016-05-15 14:27:35 +02:00
Andrea Mazzoleni
f564e9b91a Preliminary support for multiple parity files
This allows to split parity in different partitions.
2016-05-15 14:27:33 +02:00
Andrea Mazzoleni
12b30c198e Use a thread-safe esc() function with a local buffer 2016-02-09 23:12:33 +01:00
Andrea Mazzoleni
d2991f736c Function renaming to get better consistency 2016-01-16 14:30:08 +01:00
Andrea Mazzoleni
74fa6e9274 Add the "maybe" function also to par2block 2016-01-15 20:36:20 +01:00
Andrea Mazzoleni
18cc80bd7e Now pread and pwrite use is required for multithread
We need to support concurrent access at the same file handle
from multiple threads, and they cannot share the same file pointer.
2016-01-09 10:25:56 +01:00
Andrea Mazzoleni
cbf2040b89 Add mutex protection at the filesystem structure
In sync we need to modify the filesystem, like to call
fs_deallocate(). We need then proper protection.
This also removes the need of multiple fs_last cached value.
2016-01-09 10:18:14 +01:00
Andrea Mazzoleni
3c00248aa6 Add level knownledge to parity handle 2016-01-09 10:18:14 +01:00
Andrea Mazzoleni
5249f9cb04 Fix various typos in comments 2016-01-02 16:52:20 +01:00
Andrea Mazzoleni
9bc5f9e5ce Change the internal mapping to a tree of chunk
This is intended to save memory as now we can use a fixed
block of 17 bytes to store the block information, compared
to the previous 28/36 bytes.
2015-10-04 23:17:13 +02:00
Andrea Mazzoleni
0407c945db Change the interface for parity allocation
This will allow a more compact representation
of the parity allocation
2015-10-01 23:24:06 +02:00
Andrea Mazzoleni
de0c437bd2 Put a clear separation between log and msg functions 2015-04-20 22:07:42 +02:00
Andrea Mazzoleni
a5a72f4a31 Change some warnings to errors to always print them on screen 2015-04-19 21:13:05 +02:00
Andrea Mazzoleni
21ce043725 Use manual line buffering for stdout/stderr.
This is needed for Windows where line buffering is not supported.
2015-03-23 22:57:36 +01:00
Andrea Mazzoleni
83d967e2c0 Change "diff" to return an error if a "sync" is required 2015-03-02 23:01:15 +01:00
Andrea Mazzoleni
e56de653da Introduce a new messaging system 2015-02-22 14:31:03 +01:00
Andrea Mazzoleni
ea07a7025e Escape path in the log file 2015-02-12 22:55:05 +01:00
Andrea Mazzoleni
2ac751b6d9 Put all the stdout output also in stdlog 2015-02-03 19:35:43 +01:00
Andrea Mazzoleni
798de7ca99 Change the flush logic for streams
Now stdout and stderr are always line buffered, and stdlog only
flushed on request.
2015-02-03 18:29:11 +01:00
Andrea Mazzoleni
b5ce575981 Change the log and output handling
Now the log file contains all the errors messages,
and all the tag lines.
2015-02-02 23:39:46 +01:00
Andrea Mazzoleni
ad57aafd8f Refactor the parity size detection before sync.
Now we resize the parity only after checking the size of all
the parity file.
2015-02-01 18:48:50 +01:00
Andrea Mazzoleni
ffe7f6fa57 Adds new files support.c/h for low level support functions. 2015-01-02 18:52:04 +01:00
Andrea Mazzoleni
3bce9eda7e More explicative message for parity overflow. 2014-11-24 23:07:39 +01:00