Commit graph

88 commits

Author SHA1 Message Date
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
Andrea Mazzoleni
7718e6d206 Renames snapraid_parity to handle. 2014-11-09 10:25:39 +01:00
Andrea Mazzoleni
876bddcf4c Beautifies the code. 2014-09-27 00:32:39 +02:00
Andrea Mazzoleni
6700b928c2 Adds a new file_mode setting to control the file access mode. 2014-09-04 22:52:04 +02:00
Andrea Mazzoleni
44ef039a13 Different source organization. 2014-03-23 17:50:27 +01:00
Renamed from src/parity.c (Browse further)