diff --git a/cov/cmdline/check.c.func-sort-c.html b/cov/cmdline/check.c.func-sort-c.html
index 3c1c2d1e..42c16119 100644
--- a/cov/cmdline/check.c.func-sort-c.html
+++ b/cov/cmdline/check.c.func-sort-c.html
@@ -73,15 +73,15 @@
| blockcmp |
- 472820 |
+ 473403 |
| repair_step |
- 252162 |
+ 252742 |
| is_hash_matching |
- 214237 |
+ 214689 |
| state_check |
diff --git a/cov/cmdline/check.c.func.html b/cov/cmdline/check.c.func.html
index a459f866..cade11b5 100644
--- a/cov/cmdline/check.c.func.html
+++ b/cov/cmdline/check.c.func.html
@@ -65,7 +65,7 @@
| blockcmp |
- 472820 |
+ 473403 |
| file_post |
@@ -73,7 +73,7 @@
| is_hash_matching |
- 214237 |
+ 214689 |
| is_parity_matching |
@@ -85,7 +85,7 @@
| repair_step |
- 252162 |
+ 252742 |
| state_check |
diff --git a/cov/cmdline/check.c.gcov.html b/cov/cmdline/check.c.gcov.html
index 647e6c8d..ba89f607 100644
--- a/cov/cmdline/check.c.gcov.html
+++ b/cov/cmdline/check.c.gcov.html
@@ -129,64 +129,64 @@
67 : * Check if a block hash matches the specified buffer.
68 : * Return ==0 if equal
69 : */
- 70 472820 : static int blockcmp(struct snapraid_state* state, int rehash, struct snapraid_block* block, unsigned pos_size, unsigned char* buffer, unsigned char* buffer_zero)
+ 70 473403 : static int blockcmp(struct snapraid_state* state, int rehash, struct snapraid_block* block, unsigned pos_size, unsigned char* buffer, unsigned char* buffer_zero)
71 : {
72 : unsigned char hash[HASH_MAX];
73 :
74 : /* now compute the hash of the valid part */
- 75 472820 : if (rehash) {
+ 75 473403 : if (rehash) {
76 0 : memhash(state->prevhash, state->prevhashseed, hash, buffer, pos_size);
77 : } else {
- 78 472820 : memhash(state->hash, state->hashseed, hash, buffer, pos_size);
+ 78 473403 : memhash(state->hash, state->hashseed, hash, buffer, pos_size);
79 : }
80 :
81 : /* compare the hash */
- 82 472820 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
- 83 19037 : return -1;
+ 82 473403 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
+ 83 19016 : return -1;
84 : }
85 :
86 : /* compare to the end of the block */
- 87 453783 : if (pos_size < state->block_size) {
- 88 187445 : if (memcmp(buffer + pos_size, buffer_zero + pos_size, state->block_size - pos_size) != 0) {
+ 87 454387 : if (pos_size < state->block_size) {
+ 88 187463 : if (memcmp(buffer + pos_size, buffer_zero + pos_size, state->block_size - pos_size) != 0) {
89 36 : return -1;
90 : }
91 : }
92 :
- 93 453747 : return 0;
+ 93 454351 : return 0;
94 : }
95 :
96 : /**
97 : * Check if the hash of all the failed block we are expecting to recover are now matching.
98 : */
- 99 214237 : static int is_hash_matching(struct snapraid_state* state, int rehash, unsigned diskmax, struct failed_struct* failed, unsigned* failed_map, unsigned failed_count, void** buffer, void* buffer_zero)
+ 99 214689 : static int is_hash_matching(struct snapraid_state* state, int rehash, unsigned diskmax, struct failed_struct* failed, unsigned* failed_map, unsigned failed_count, void** buffer, void* buffer_zero)
100 : {
101 : unsigned j;
102 : int hash_checked;
103 :
- 104 214237 : hash_checked = 0; /* keep track if we check at least one block */
+ 104 214689 : hash_checked = 0; /* keep track if we check at least one block */
105 :
106 : /* check if the recovered blocks are OK */
- 107 672506 : for (j = 0; j < failed_count; ++j) {
+ 107 673562 : for (j = 0; j < failed_count; ++j) {
108 : /* if we are expected to recover this block */
- 109 477342 : if (!failed[failed_map[j]].is_outofdate
+ 109 477925 : if (!failed[failed_map[j]].is_outofdate
110 : /* if the block has a hash to check */
- 111 472820 : && block_has_updated_hash(failed[failed_map[j]].block)
+ 111 473403 : && block_has_updated_hash(failed[failed_map[j]].block)
112 : ) {
113 : /* if a hash doesn't match, fail the check */
- 114 472820 : unsigned pos_size = file_block_size(failed[failed_map[j]].file, failed[failed_map[j]].file_pos, state->block_size);
- 115 472820 : if (blockcmp(state, rehash, failed[failed_map[j]].block, pos_size, buffer[failed[failed_map[j]].index], buffer_zero) != 0) {
- 116 19073 : log_tag("hash_error: Hash mismatch on entry %u\n", failed_map[j]);
- 117 19073 : return 0;
+ 114 473403 : unsigned pos_size = file_block_size(failed[failed_map[j]].file, failed[failed_map[j]].file_pos, state->block_size);
+ 115 473403 : if (blockcmp(state, rehash, failed[failed_map[j]].block, pos_size, buffer[failed[failed_map[j]].index], buffer_zero) != 0) {
+ 116 19052 : log_tag("hash_error: Hash mismatch on entry %u\n", failed_map[j]);
+ 117 19052 : return 0;
118 : }
119 :
- 120 453747 : hash_checked = 1;
+ 120 454351 : hash_checked = 1;
121 : }
122 : }
123 :
124 : /* if nothing checked, we reject it */
125 : /* note that we are excluding this case at upper level */
126 : /* but checking again doesn't hurt */
- 127 195164 : if (!hash_checked) {
+ 127 195637 : if (!hash_checked) {
128 : /* LCOV_EXCL_START */
129 : return 0;
130 : /* LCOV_EXCL_STOP */
@@ -194,8 +194,8 @@
132 :
133 : /* if we checked something, and no block failed the check */
134 : /* recompute all the redundancy information */
- 135 195164 : raid_gen(diskmax, state->level, state->block_size, buffer);
- 136 195164 : return 1;
+ 135 195637 : raid_gen(diskmax, state->level, state->block_size, buffer);
+ 136 195637 : return 1;
137 : }
138 :
139 : /**
@@ -221,7 +221,7 @@
159 : * Return <0 if failure for missing strategy, >0 if data is wrong and we cannot rebuild correctly, 0 on success.
160 : * If success, the parity are computed in the buffer variable.
161 : */
- 162 252162 : static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, unsigned diskmax, struct failed_struct* failed, unsigned* failed_map, unsigned failed_count, void** buffer, void** buffer_recov, void* buffer_zero)
+ 162 252742 : static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, unsigned diskmax, struct failed_struct* failed, unsigned* failed_map, unsigned failed_count, void** buffer, void** buffer_recov, void* buffer_zero)
163 : {
164 : unsigned i, n;
165 : int error;
@@ -230,7 +230,7 @@
168 : int ip[LEV_MAX];
169 :
170 : /* no fix required, already checked at higher level, but just to be sure */
- 171 252162 : if (failed_count == 0) {
+ 171 252742 : if (failed_count == 0) {
172 : /* LCOV_EXCL_START */
173 : /* recompute only the parity */
174 : raid_gen(diskmax, state->level, state->block_size, buffer);
@@ -238,28 +238,28 @@
176 : /* LCOV_EXCL_STOP */
177 : }
178 :
- 179 252162 : n = state->level;
- 180 252162 : error = 0;
+ 179 252742 : n = state->level;
+ 180 252742 : error = 0;
181 :
182 : /* setup vector of failed disk indexes */
- 183 890699 : for (i = 0; i < failed_count; ++i)
- 184 638537 : id[i] = failed[failed_map[i]].index;
+ 183 892104 : for (i = 0; i < failed_count; ++i)
+ 184 639362 : id[i] = failed[failed_map[i]].index;
185 :
186 : /* check if there is at least a failed block that can be checked for correctness using the hash */
187 : /* if there isn't, we have to sacrifice a parity block to check that the result is correct */
- 188 252162 : has_hash = 0;
- 189 890699 : for (i = 0; i < failed_count; ++i) {
+ 188 252742 : has_hash = 0;
+ 189 892104 : for (i = 0; i < failed_count; ++i) {
190 : /* if we are expected to recover this block */
- 191 638537 : if (!failed[failed_map[i]].is_outofdate
+ 191 639362 : if (!failed[failed_map[i]].is_outofdate
192 : /* if the block has a hash to check */
- 193 629493 : && block_has_updated_hash(failed[failed_map[i]].block)
+ 193 630318 : && block_has_updated_hash(failed[failed_map[i]].block)
194 : )
- 195 629485 : has_hash = 1;
+ 195 630310 : has_hash = 1;
196 : }
197 :
198 : /* if we don't have a hash, but we have an extra parity */
199 : /* (strictly-less failures than number of parities) */
- 200 252162 : if (!has_hash && failed_count < n) {
+ 200 252742 : if (!has_hash && failed_count < n) {
201 : /* number of parity to use, one more to check the recovering */
202 8 : unsigned r = failed_count + 1;
203 :
@@ -299,51 +299,51 @@
237 :
238 : /* if we have a hash, and enough parities */
239 : /* (less-or-equal failures than number of parities) */
- 240 252154 : if (has_hash && failed_count <= n) {
+ 240 252734 : if (has_hash && failed_count <= n) {
241 : /* number of parities to use equal at the number of failures */
- 242 204494 : unsigned r = failed_count;
+ 242 204960 : unsigned r = failed_count;
243 :
244 : /* all combinations (r of n) parities */
- 245 204494 : combination_first(r, n, ip);
+ 245 204960 : combination_first(r, n, ip);
246 : do {
247 : /* if a parity is missing, do nothing */
- 248 691579 : for (i = 0; i < r; ++i) {
- 249 477342 : if (buffer_recov[ip[i]] == 0)
+ 248 692614 : for (i = 0; i < r; ++i) {
+ 249 477925 : if (buffer_recov[ip[i]] == 0)
250 0 : break;
251 : }
- 252 214237 : if (i != r)
+ 252 214689 : if (i != r)
253 0 : continue;
254 :
255 : /* copy the parities to use */
- 256 691579 : for (i = 0; i < r; ++i)
- 257 477342 : memcpy(buffer[diskmax + ip[i]], buffer_recov[ip[i]], state->block_size);
+ 256 692614 : for (i = 0; i < r; ++i)
+ 257 477925 : memcpy(buffer[diskmax + ip[i]], buffer_recov[ip[i]], state->block_size);
258 :
259 : /* recover */
- 260 214237 : raid_data(r, id, ip, diskmax, state->block_size, buffer);
+ 260 214689 : raid_data(r, id, ip, diskmax, state->block_size, buffer);
261 :
262 : /* use the hash to check the result */
- 263 214237 : if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero))
- 264 195164 : return 0;
+ 263 214689 : if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero))
+ 264 195637 : return 0;
265 :
266 : /* log */
- 267 19073 : log_tag("parity_error:%u:", pos);
- 268 38146 : for (i = 0; i < r; ++i) {
- 269 19073 : if (i != 0)
+ 267 19052 : log_tag("parity_error:%u:", pos);
+ 268 38104 : for (i = 0; i < r; ++i) {
+ 269 19052 : if (i != 0)
270 0 : log_tag("/");
- 271 19073 : log_tag("%s", lev_config_name(ip[i]));
+ 271 19052 : log_tag("%s", lev_config_name(ip[i]));
272 : }
- 273 19073 : log_tag(":hash: Hash mismatch\n");
- 274 19073 : ++error;
- 275 38146 : } while (combination_next(r, n, ip));
+ 273 19052 : log_tag(":hash: Hash mismatch\n");
+ 274 19052 : ++error;
+ 275 38104 : } while (combination_next(r, n, ip));
276 : }
277 :
278 : /* return the number of failed attempts, or -1 if no strategy */
- 279 56990 : if (error)
- 280 9330 : return error;
+ 279 57097 : if (error)
+ 280 9323 : return error;
281 :
- 282 47660 : log_tag("strategy_error:%u: No strategy to recover from %u failures with %u parity %s hash\n",
+ 282 47774 : log_tag("strategy_error:%u: No strategy to recover from %u failures with %u parity %s hash\n",
283 : pos, failed_count, n, has_hash ? "with" : "without");
- 284 47660 : return -1;
+ 284 47774 : return -1;
285 : }
286 :
287 870958 : static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsigned diskmax, struct failed_struct* failed, unsigned* failed_map, unsigned failed_count, void** buffer, void** buffer_recov, void* buffer_zero)
@@ -360,47 +360,47 @@
298 :
299 : /* if nothing failed, just recompute the parity */
300 870958 : if (failed_count == 0) {
- 301 583884 : raid_gen(diskmax, state->level, state->block_size, buffer);
- 302 583884 : return 0;
+ 301 583304 : raid_gen(diskmax, state->level, state->block_size, buffer);
+ 302 583304 : return 0;
303 : }
304 :
305 : /* logs the status */
- 306 1015630 : for (j = 0; j < failed_count; ++j) {
+ 306 1017035 : for (j = 0; j < failed_count; ++j) {
307 : const char* desc;
308 : const char* hash;
309 : const char* data;
- 310 728556 : struct snapraid_block* block = failed[j].block;
- 311 728556 : unsigned block_state = block_state_get(block);
+ 310 729381 : struct snapraid_block* block = failed[j].block;
+ 311 729381 : unsigned block_state = block_state_get(block);
312 :
- 313 728556 : switch (block_state) {
+ 313 729381 : switch (block_state) {
314 18454 : case BLOCK_STATE_DELETED : desc = "delete"; break;
315 13851 : case BLOCK_STATE_CHG : desc = "change"; break;
316 62282 : case BLOCK_STATE_REP : desc = "replace"; break;
- 317 633969 : case BLOCK_STATE_BLK : desc = "block"; break;
+ 317 634794 : case BLOCK_STATE_BLK : desc = "block"; break;
318 : /* LCOV_EXCL_START */
319 : default : desc = "unknown"; break;
320 : /* LCOV_EXCL_STOP */
321 : }
322 :
- 323 728556 : if (hash_is_invalid(block->hash)) {
+ 323 729381 : if (hash_is_invalid(block->hash)) {
324 13843 : hash = "lost";
- 325 714713 : } else if (hash_is_zero(block->hash)) {
+ 325 715538 : } else if (hash_is_zero(block->hash)) {
326 8 : hash = "zero";
327 : } else {
- 328 714705 : hash = "known";
+ 328 715530 : hash = "known";
329 : }
330 :
- 331 728556 : if (failed[j].is_bad)
- 332 642831 : data = "bad";
+ 331 729381 : if (failed[j].is_bad)
+ 332 643656 : data = "bad";
333 : else
334 85725 : data = "good";
335 :
- 336 728556 : if (failed[j].file) {
- 337 710102 : struct snapraid_disk* disk = failed[j].disk;
- 338 710102 : struct snapraid_file* file = failed[j].file;
- 339 710102 : block_off_t file_pos = failed[j].file_pos;
+ 336 729381 : if (failed[j].file) {
+ 337 710927 : struct snapraid_disk* disk = failed[j].disk;
+ 338 710927 : struct snapraid_file* file = failed[j].file;
+ 339 710927 : block_off_t file_pos = failed[j].file_pos;
340 :
- 341 710102 : log_tag("entry:%u:%s:%s:%s:%s:%s:%u:\n", j, desc, hash, data, disk->name, esc_tag(file->sub, esc_buffer), file_pos);
+ 341 710927 : log_tag("entry:%u:%s:%s:%s:%s:%s:%u:\n", j, desc, hash, data, disk->name, esc_tag(file->sub, esc_buffer), file_pos);
342 : } else {
343 18454 : log_tag("entry:%u:%s:%s:%s:\n", j, desc, hash, data);
344 : }
@@ -422,35 +422,35 @@
360 : /* We are interested to recover BLK, REP and CHG blocks if they are marked as bad, */
361 : /* but we are not interested in DELETED ones. */
362 :
- 363 287074 : n = 0;
- 364 287074 : something_to_recover = 0; /* keep track if there is at least one block to fix */
- 365 1015630 : for (j = 0; j < failed_count; ++j) {
- 366 728556 : if (failed[j].is_bad) {
- 367 642831 : unsigned block_state = block_state_get(failed[j].block);
+ 363 287654 : n = 0;
+ 364 287654 : something_to_recover = 0; /* keep track if there is at least one block to fix */
+ 365 1017035 : for (j = 0; j < failed_count; ++j) {
+ 366 729381 : if (failed[j].is_bad) {
+ 367 643656 : unsigned block_state = block_state_get(failed[j].block);
368 :
- 369 642831 : assert(block_state != BLOCK_STATE_DELETED); /* we cannot have bad DELETED blocks */
+ 369 643656 : assert(block_state != BLOCK_STATE_DELETED); /* we cannot have bad DELETED blocks */
370 :
371 : /* if we have the hash for it */
- 372 642831 : if ((block_state == BLOCK_STATE_BLK || block_state == BLOCK_STATE_REP)
+ 372 643656 : if ((block_state == BLOCK_STATE_BLK || block_state == BLOCK_STATE_REP)
373 : /* try to fetch the block using the known hash */
- 374 642823 : && (state_import_fetch(state, rehash, failed[j].block, buffer[failed[j].index]) == 0
- 375 638351 : || state_search_fetch(state, rehash, failed[j].file, failed[j].file_pos, failed[j].block, buffer[failed[j].index]) == 0)
+ 374 643648 : && (state_import_fetch(state, rehash, failed[j].block, buffer[failed[j].index]) == 0
+ 375 639176 : || state_search_fetch(state, rehash, failed[j].file, failed[j].file_pos, failed[j].block, buffer[failed[j].index]) == 0)
376 : ) {
377 : /* we already have corrected it! */
378 22382 : log_tag("hash_import: Fixed entry %u\n", j);
379 : } else {
380 : /* otherwise try to recover it */
- 381 620449 : failed_map[n] = j;
- 382 620449 : ++n;
+ 381 621274 : failed_map[n] = j;
+ 382 621274 : ++n;
383 :
384 : /* we have something to try to recover */
- 385 620449 : something_to_recover = 1;
+ 385 621274 : something_to_recover = 1;
386 : }
387 : }
388 : }
389 :
390 : /* if nothing to fix */
- 391 287074 : if (!something_to_recover) {
+ 391 287654 : if (!something_to_recover) {
392 43956 : log_tag("recover_sync:%u:%u: Skipped for already recovered\n", pos, n);
393 :
394 : /* recompute only the parity */
@@ -458,22 +458,22 @@
396 43956 : return 0;
397 : }
398 :
- 399 243118 : ret = repair_step(state, rehash, pos, diskmax, failed, failed_map, n, buffer, buffer_recov, buffer_zero);
- 400 243118 : if (ret == 0) {
+ 399 243698 : ret = repair_step(state, rehash, pos, diskmax, failed, failed_map, n, buffer, buffer_recov, buffer_zero);
+ 400 243698 : if (ret == 0) {
401 : /* reprocess the CHG blocks, for which we don't have a hash to check */
402 : /* if they were BAD we have to use some heuristics to ensure that we have recovered */
403 : /* the state after the sync. If unsure, we assume the worst case */
404 :
- 405 666510 : for (j = 0; j < failed_count; ++j) {
+ 405 667587 : for (j = 0; j < failed_count; ++j) {
406 : /* we take care only of BAD blocks we have to write back */
- 407 475860 : if (failed[j].is_bad) {
- 408 462388 : unsigned block_state = block_state_get(failed[j].block);
+ 407 476464 : if (failed[j].is_bad) {
+ 408 462992 : unsigned block_state = block_state_get(failed[j].block);
409 :
410 : /* BLK and REP blocks are always OK, because at this point */
411 : /* we have already checked their hash */
- 412 462388 : if (block_state != BLOCK_STATE_CHG) {
- 413 462380 : assert(block_state == BLOCK_STATE_BLK || block_state == BLOCK_STATE_REP);
- 414 462380 : continue;
+ 412 462992 : if (block_state != BLOCK_STATE_CHG) {
+ 413 462984 : assert(block_state == BLOCK_STATE_BLK || block_state == BLOCK_STATE_REP);
+ 414 462984 : continue;
415 : }
416 :
417 : /* for CHG blocks we have to 'guess' if they are correct or not */
@@ -515,15 +515,15 @@
453 : }
454 : }
455 :
- 456 190650 : return 0;
+ 456 191123 : return 0;
457 : }
- 458 52468 : if (ret > 0)
- 459 9330 : error += ret;
+ 458 52575 : if (ret > 0)
+ 459 9323 : error += ret;
460 :
- 461 52468 : if (ret < 0)
- 462 43138 : log_tag("recover_sync:%u:%u: Failed with no attempts\n", pos, n);
+ 461 52575 : if (ret < 0)
+ 462 43252 : log_tag("recover_sync:%u:%u: Failed with no attempts\n", pos, n);
463 : else
- 464 9330 : log_tag("recover_sync:%u:%u: Failed with %d attempts\n", pos, n, ret);
+ 464 9323 : log_tag("recover_sync:%u:%u: Failed with %d attempts\n", pos, n, ret);
465 :
466 : /* Now assume that the parity IS NOT updated at the current state, */
467 : /* but still represent the state before the last 'sync' process. */
@@ -533,15 +533,15 @@
471 : /* but we are not interested to recover CHG (new version) and REP (new version) blocks, */
472 : /* even if marked as bad, because we don't have parity for them and it's just impossible, */
473 : /* and we are not interested to recover DELETED ones. */
- 474 52468 : n = 0;
- 475 52468 : something_to_recover = 0; /* keep track if there is at least one block to fix */
- 476 52468 : something_unsynced = 0; /* keep track if we have some unsynced info to process */
- 477 232728 : for (j = 0; j < failed_count; ++j) {
- 478 180260 : unsigned block_state = block_state_get(failed[j].block);
+ 474 52575 : n = 0;
+ 475 52575 : something_to_recover = 0; /* keep track if there is at least one block to fix */
+ 476 52575 : something_unsynced = 0; /* keep track if we have some unsynced info to process */
+ 477 233056 : for (j = 0; j < failed_count; ++j) {
+ 478 180481 : unsigned block_state = block_state_get(failed[j].block);
479 :
- 480 180260 : if (block_state == BLOCK_STATE_DELETED
- 481 171216 : || block_state == BLOCK_STATE_CHG
- 482 171216 : || block_state == BLOCK_STATE_REP
+ 480 180481 : if (block_state == BLOCK_STATE_DELETED
+ 481 171437 : || block_state == BLOCK_STATE_CHG
+ 482 171437 : || block_state == BLOCK_STATE_REP
483 : ) {
484 : /* If the block is CHG, REP or DELETED, we don't have the original content of block, */
485 : /* and we must try to recover it. */
@@ -583,24 +583,24 @@
521 : /* it also applies to CHG and DELETE blocks because we want to have */
522 : /* a successful recovering only if a BLK one is matching */
523 9044 : failed[j].is_outofdate = 1;
- 524 171216 : } else if (failed[j].is_bad) {
+ 524 171437 : } else if (failed[j].is_bad) {
525 : /* If the block is bad we don't know its content, and we try to recover it */
526 : /* At this point, we can have only BLK ones */
527 :
- 528 171216 : assert(block_state == BLOCK_STATE_BLK);
+ 528 171437 : assert(block_state == BLOCK_STATE_BLK);
529 :
530 : /* we have something we are interested to recover */
- 531 171216 : something_to_recover = 1;
+ 531 171437 : something_to_recover = 1;
532 :
533 : /* we try to recover it */
- 534 171216 : failed_map[n] = j;
- 535 171216 : ++n;
+ 534 171437 : failed_map[n] = j;
+ 535 171437 : ++n;
536 : }
537 : }
538 :
539 : /* if nothing to fix, we just don't try */
540 : /* if nothing unsynced we also don't retry, because it's the same try as before */
- 541 52468 : if (something_to_recover && something_unsynced) {
+ 541 52575 : if (something_to_recover && something_unsynced) {
542 9044 : ret = repair_step(state, rehash, pos, diskmax, failed, failed_map, n, buffer, buffer_recov, buffer_zero);
543 9044 : if (ret == 0) {
544 : /* reprocess the REP and CHG blocks, for which we have recovered and old state */
@@ -634,17 +634,17 @@
572 : else
573 0 : log_tag("recover_unsync:%u:%u: Failed with %d attempts\n", pos, n, ret);
574 : } else {
- 575 43424 : log_tag("recover_unsync:%u:%u: Skipped for%s%s\n", pos, n,
+ 575 43531 : log_tag("recover_unsync:%u:%u: Skipped for%s%s\n", pos, n,
576 : !something_to_recover ? " nothing to recover" : "",
577 : !something_unsynced ? " nothing unsynched" : ""
578 : );
579 : }
580 :
581 : /* return the number of failed attempts, or -1 if no strategy */
- 582 47946 : if (error)
- 583 4808 : return error;
+ 582 48053 : if (error)
+ 583 4801 : return error;
584 : else
- 585 43138 : return -1;
+ 585 43252 : return -1;
586 : }
587 :
588 : /**
@@ -718,12 +718,12 @@
656 : /* rename it to .unrecoverable */
657 : char path_to[PATH_MAX];
658 :
- 659 63229 : pathprint(path_to, sizeof(path_to), "%s%s.unrecoverable", disk->dir, file->sub);
+ 659 63283 : pathprint(path_to, sizeof(path_to), "%s%s.unrecoverable", disk->dir, file->sub);
660 :
661 : /* ensure to close the file before renaming */
- 662 63229 : if (handle[j].file == file) {
- 663 63229 : ret = handle_close(&handle[j]);
- 664 63229 : if (ret != 0) {
+ 662 63283 : if (handle[j].file == file) {
+ 663 63283 : ret = handle_close(&handle[j]);
+ 664 63283 : if (ret != 0) {
665 : /* LCOV_EXCL_START */
666 : log_tag("error:%u:%s:%s: Close error. %s\n", i, disk->name, esc_tag(file->sub, esc_buffer), strerror(errno));
667 : log_fatal("DANGER! Unexpected close error in a data disk.\n");
@@ -732,8 +732,8 @@
670 : }
671 : }
672 :
- 673 63229 : ret = rename(path, path_to);
- 674 63229 : if (ret != 0) {
+ 673 63283 : ret = rename(path, path_to);
+ 674 63283 : if (ret != 0) {
675 : /* LCOV_EXCL_START */
676 : log_fatal("Error renaming '%s' to '%s'. %s.\n", path, path_to, strerror(errno));
677 : log_fatal("WARNING! Without a working data disk, it isn't possible to fix errors on it.\n");
@@ -741,22 +741,22 @@
679 : /* LCOV_EXCL_STOP */
680 : }
681 :
- 682 63229 : log_tag("status:unrecoverable:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
- 683 63229 : msg_info("unrecoverable %s\n", fmt_term(disk, file->sub, esc_buffer));
+ 682 63283 : log_tag("status:unrecoverable:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 683 63283 : msg_info("unrecoverable %s\n", fmt_term(disk, file->sub, esc_buffer));
684 :
685 : /* and do not set the time if damaged */
- 686 63229 : goto close_and_continue;
+ 686 63283 : goto close_and_continue;
687 : }
688 :
689 : /* if the file is not fixed, meaning that it is untouched */
- 690 694005 : if (!file_flag_has(file, FILE_IS_FIXED)) {
+ 690 693951 : if (!file_flag_has(file, FILE_IS_FIXED)) {
691 : /* nothing to do, but close the file */
- 692 574590 : goto close_and_continue;
+ 692 574520 : goto close_and_continue;
693 : }
694 :
695 : /* if the file is closed or different than the one expected, reopen it */
696 : /* a different open file could happen when filtering for bad blocks */
- 697 119415 : if (handle[j].file != file) {
+ 697 119431 : if (handle[j].file != file) {
698 : /* close a potential different file */
699 0 : ret = handle_close(&handle[j]);
700 0 : if (ret != 0) {
@@ -779,13 +779,13 @@
717 : }
718 : }
719 :
- 720 119415 : log_tag("status:recovered:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
- 721 119415 : msg_info("recovered %s\n", fmt_term(disk, file->sub, esc_buffer));
+ 720 119431 : log_tag("status:recovered:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 721 119431 : msg_info("recovered %s\n", fmt_term(disk, file->sub, esc_buffer));
722 :
- 723 119415 : inode = handle[j].st.st_ino;
+ 723 119431 : inode = handle[j].st.st_ino;
724 :
725 : /* search for the corresponding inode */
- 726 119415 : collide_file = tommy_hashdyn_search(&disk->inodeset, file_inode_compare_to_arg, &inode, file_inode_hash(inode));
+ 726 119431 : collide_file = tommy_hashdyn_search(&disk->inodeset, file_inode_compare_to_arg, &inode, file_inode_hash(inode));
727 :
728 : /* if the inode is already in the database and it refers at a different file name, */
729 : /* we can fix the file time ONLY if the time and size allow to differentiate */
@@ -795,15 +795,15 @@
733 : /* when recreating them the inodes may be reused in a different order, */
734 : /* and at the next sync some files may have matching inode/size/time even if different name */
735 : /* not allowing sync to detect that the file is changed and not renamed */
- 736 119415 : if (!collide_file /* if not in the database, there is no collision */
- 737 37419 : || strcmp(collide_file->sub, file->sub) == 0 /* if the name is the same, it's the right collision */
- 738 28281 : || collide_file->size != file->size /* if the size is different, the collision is identified */
+ 736 119431 : if (!collide_file /* if not in the database, there is no collision */
+ 737 37411 : || strcmp(collide_file->sub, file->sub) == 0 /* if the name is the same, it's the right collision */
+ 738 28341 : || collide_file->size != file->size /* if the size is different, the collision is identified */
739 9 : || collide_file->mtime_sec != file->mtime_sec /* if the mtime is different, the collision is identified */
740 7 : || collide_file->mtime_nsec != file->mtime_nsec /* same for mtime_nsec */
741 : ) {
742 : /* set the original modification time */
- 743 119415 : ret = handle_utime(&handle[j]);
- 744 238830 : if (ret == -1) {
+ 743 119431 : ret = handle_utime(&handle[j]);
+ 744 238862 : if (ret == -1) {
745 : /* LCOV_EXCL_START */
746 : /* mark the file as damaged */
747 : file_flag_set(file, FILE_IS_DAMAGED);
@@ -818,21 +818,21 @@
756 : /* we are not fixing, but only checking */
757 : /* print just the final status */
758 1308032 : if (file_flag_has(file, FILE_IS_DAMAGED)) {
- 759 9419 : if (state->opt.auditonly) {
- 760 2759 : log_tag("status:damaged:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
- 761 2759 : msg_info("damaged %s\n", fmt_term(disk, file->sub, esc_buffer));
+ 759 9499 : if (state->opt.auditonly) {
+ 760 2799 : log_tag("status:damaged:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 761 2799 : msg_info("damaged %s\n", fmt_term(disk, file->sub, esc_buffer));
762 : } else {
- 763 6660 : log_tag("status:unrecoverable:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
- 764 6660 : msg_info("unrecoverable %s\n", fmt_term(disk, file->sub, esc_buffer));
+ 763 6700 : log_tag("status:unrecoverable:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 764 6700 : msg_info("unrecoverable %s\n", fmt_term(disk, file->sub, esc_buffer));
765 : }
- 766 1298613 : } else if (file_flag_has(file, FILE_IS_FIXED)) {
- 767 76146 : log_tag("status:recoverable:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
- 768 76146 : msg_info("recoverable %s\n", fmt_term(disk, file->sub, esc_buffer));
+ 766 1298533 : } else if (file_flag_has(file, FILE_IS_FIXED)) {
+ 767 76212 : log_tag("status:recoverable:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 768 76212 : msg_info("recoverable %s\n", fmt_term(disk, file->sub, esc_buffer));
769 : } else {
770 : /* we don't use msg_verbose() because it also goes into the log */
- 771 1222467 : if (msg_level >= MSG_VERBOSE) {
- 772 23223 : log_tag("status:correct:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
- 773 23223 : msg_info("correct %s\n", fmt_term(disk, file->sub, esc_buffer));
+ 771 1222321 : if (msg_level >= MSG_VERBOSE) {
+ 772 23229 : log_tag("status:correct:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 773 23229 : msg_info("correct %s\n", fmt_term(disk, file->sub, esc_buffer));
774 : }
775 : }
776 : }
@@ -844,8 +844,8 @@
782 2162259 : if (handle[j].file == file) {
783 : /* ensure to close the file just after finishing with it */
784 : /* to avoid to keep it open without any possible use */
- 785 1978798 : ret = handle_close(&handle[j]);
- 786 1978798 : if (ret != 0) {
+ 785 1978440 : ret = handle_close(&handle[j]);
+ 786 1978440 : if (ret != 0) {
787 : /* LCOV_EXCL_START */
788 : log_tag("error:%u:%s:%s: Close error. %s\n", i, disk->name, esc_tag(file->sub, esc_buffer), strerror(errno));
789 : log_fatal("DANGER! Unexpected close error in a data disk.\n");
@@ -1011,7 +1011,7 @@
949 5461398 : if (!disk) {
950 : /* use an empty block */
951 14061 : memset(buffer[j], 0, state->block_size);
- 952 954451 : continue;
+ 952 955462 : continue;
953 : }
954 :
955 : /* if the disk block is not used */
@@ -1067,8 +1067,8 @@
1005 : /* if the file is closed or different than the current one */
1006 5236820 : if (handle[j].file == 0 || handle[j].file != file) {
1007 : /* close the old one, if any */
- 1008 2259328 : ret = handle_close(&handle[j]);
- 1009 2259328 : if (ret == -1) {
+ 1008 2260089 : ret = handle_close(&handle[j]);
+ 1009 2260089 : if (ret == -1) {
1010 : /* LCOV_EXCL_START */
1011 : log_tag("error:%u:%s:%s: Close error. %s\n", i, disk->name, esc_tag(handle[j].file->sub, esc_buffer), strerror(errno));
1012 : log_fatal("DANGER! Unexpected close error in a data disk.\n");
@@ -1079,10 +1079,10 @@
1017 : }
1018 :
1019 : /* if fixing, and the file is not excluded, we must open for writing */
- 1020 2259328 : if (fix && !file_flag_has(file, FILE_IS_EXCLUDED)) {
+ 1020 2260089 : if (fix && !file_flag_has(file, FILE_IS_EXCLUDED)) {
1021 : /* if fixing, create the file, open for writing and resize if required */
- 1022 771297 : ret = handle_create(&handle[j], file, state->file_mode);
- 1023 771297 : if (ret == -1) {
+ 1022 771311 : ret = handle_create(&handle[j], file, state->file_mode);
+ 1023 771311 : if (ret == -1) {
1024 : /* LCOV_EXCL_START */
1025 : if (errno == EACCES) {
1026 : log_fatal("WARNING! Please give write permission to the file.\n");
@@ -1096,69 +1096,69 @@
1034 : }
1035 :
1036 : /* check if the file was just created */
- 1037 1542594 : if (handle[j].created != 0) {
+ 1037 1542622 : if (handle[j].created != 0) {
1038 : /* if fragmented, it may be reopened, so remember that the file */
1039 : /* was originally missing */
- 1040 112998 : file_flag_set(file, FILE_IS_CREATED);
+ 1040 113135 : file_flag_set(file, FILE_IS_CREATED);
1041 : }
1042 : } else {
1043 : /* open the file only for reading */
- 1044 1488031 : if (!file_flag_has(file, FILE_IS_MISSING))
- 1045 1372877 : ret = handle_open(&handle[j], file, state->file_mode,
- 1046 1372877 : log_error, state->opt.expected_missing ? log_expected : 0);
+ 1044 1488778 : if (!file_flag_has(file, FILE_IS_MISSING))
+ 1045 1372856 : ret = handle_open(&handle[j], file, state->file_mode,
+ 1046 1372856 : log_error, state->opt.expected_missing ? log_expected : 0);
1047 : else
- 1048 115154 : ret = -1; /* if the file is missing, we cannot open it */
- 1049 1488031 : if (ret == -1) {
+ 1048 115922 : ret = -1; /* if the file is missing, we cannot open it */
+ 1049 1488778 : if (ret == -1) {
1050 : /* save the failed block for the check/fix */
- 1051 193589 : failed[failed_count].is_bad = 1;
- 1052 193589 : failed[failed_count].is_outofdate = 0;
- 1053 193589 : failed[failed_count].index = j;
- 1054 193589 : failed[failed_count].block = block;
- 1055 193589 : failed[failed_count].disk = disk;
- 1056 193589 : failed[failed_count].file = file;
- 1057 193589 : failed[failed_count].file_pos = file_pos;
- 1058 193589 : failed[failed_count].handle = &handle[j];
- 1059 193589 : ++failed_count;
+ 1051 194661 : failed[failed_count].is_bad = 1;
+ 1052 194661 : failed[failed_count].is_outofdate = 0;
+ 1053 194661 : failed[failed_count].index = j;
+ 1054 194661 : failed[failed_count].block = block;
+ 1055 194661 : failed[failed_count].disk = disk;
+ 1056 194661 : failed[failed_count].file = file;
+ 1057 194661 : failed[failed_count].file_pos = file_pos;
+ 1058 194661 : failed[failed_count].handle = &handle[j];
+ 1059 194661 : ++failed_count;
1060 :
- 1061 193589 : log_tag("error:%u:%s:%s: Open error at position %u\n", i, disk->name, esc_tag(file->sub, esc_buffer), file_pos);
- 1062 193589 : ++error;
+ 1061 194661 : log_tag("error:%u:%s:%s: Open error at position %u\n", i, disk->name, esc_tag(file->sub, esc_buffer), file_pos);
+ 1062 194661 : ++error;
1063 :
1064 : /* mark the file as missing, to avoid to retry to open it again */
1065 : /* note that this can be done only if we are not fixing it */
1066 : /* otherwise, it could be recreated */
- 1067 193589 : file_flag_set(file, FILE_IS_MISSING);
- 1068 193589 : continue;
+ 1067 194661 : file_flag_set(file, FILE_IS_MISSING);
+ 1068 194661 : continue;
1069 : }
1070 : }
1071 :
1072 : /* if it's the first open, and not excluded */
- 1073 2065739 : if (!file_flag_has(file, FILE_IS_OPENED)
- 1074 2050359 : && !file_flag_has(file, FILE_IS_EXCLUDED)) {
+ 1073 2065428 : if (!file_flag_has(file, FILE_IS_OPENED)
+ 1074 2050067 : && !file_flag_has(file, FILE_IS_EXCLUDED)) {
1075 :
1076 : /* check if the file is changed */
- 1077 1998928 : if (handle[j].st.st_size != file->size
- 1078 1806116 : || handle[j].st.st_mtime != file->mtime_sec
- 1079 1781440 : || STAT_NSEC(&handle[j].st) != file->mtime_nsec
+ 1077 1998636 : if (handle[j].st.st_size != file->size
+ 1078 1805944 : || handle[j].st.st_mtime != file->mtime_sec
+ 1079 1781522 : || STAT_NSEC(&handle[j].st) != file->mtime_nsec
1080 : /* don't check the inode to support file-system without persistent inodes */
1081 : ) {
1082 : /* report that the file is not synced */
- 1083 217488 : file_flag_set(file, FILE_IS_UNSYNCED);
+ 1083 217114 : file_flag_set(file, FILE_IS_UNSYNCED);
1084 : }
1085 : }
1086 :
1087 : /* if it's the first open, and not excluded and larger */
- 1088 2065739 : if (!file_flag_has(file, FILE_IS_OPENED)
- 1089 2050359 : && !file_flag_has(file, FILE_IS_EXCLUDED)
- 1090 1998928 : && !(state->opt.syncedonly && file_flag_has(file, FILE_IS_UNSYNCED))
- 1091 1998928 : && handle[j].st.st_size > file->size
+ 1088 2065428 : if (!file_flag_has(file, FILE_IS_OPENED)
+ 1089 2050067 : && !file_flag_has(file, FILE_IS_EXCLUDED)
+ 1090 1998636 : && !(state->opt.syncedonly && file_flag_has(file, FILE_IS_UNSYNCED))
+ 1091 1998636 : && handle[j].st.st_size > file->size
1092 : ) {
- 1093 8770 : log_error("File '%s' is larger than expected.\n", handle[j].path);
- 1094 8770 : log_tag("error:%u:%s:%s: Size error\n", i, disk->name, esc_tag(file->sub, esc_buffer));
- 1095 8770 : ++error;
+ 1093 8724 : log_error("File '%s' is larger than expected.\n", handle[j].path);
+ 1094 8724 : log_tag("error:%u:%s:%s: Size error\n", i, disk->name, esc_tag(file->sub, esc_buffer));
+ 1095 8724 : ++error;
1096 :
- 1097 8770 : if (fix) {
- 1098 3236 : ret = handle_truncate(&handle[j], file);
- 1099 3236 : if (ret == -1) {
+ 1097 8724 : if (fix) {
+ 1098 3222 : ret = handle_truncate(&handle[j], file);
+ 1099 3222 : if (ret == -1) {
1100 : /* LCOV_EXCL_START */
1101 : log_fatal("DANGER! Unexpected truncate error in a data disk, it isn't possible to fix.\n");
1102 : log_fatal("Stopping at block %u\n", i);
@@ -1167,43 +1167,43 @@
1105 : /* LCOV_EXCL_STOP */
1106 : }
1107 :
- 1108 3236 : log_tag("fixed:%u:%s:%s: Fixed size\n", i, disk->name, esc_tag(file->sub, esc_buffer));
- 1109 3236 : ++recovered_error;
+ 1108 3222 : log_tag("fixed:%u:%s:%s: Fixed size\n", i, disk->name, esc_tag(file->sub, esc_buffer));
+ 1109 3222 : ++recovered_error;
1110 : }
1111 : }
1112 :
1113 : /* mark the file as opened at least one time */
1114 : /* this is used to avoid to check the unsynced and size */
1115 : /* more than one time, in case the file is reopened later */
- 1116 2065739 : file_flag_set(file, FILE_IS_OPENED);
+ 1116 2065428 : file_flag_set(file, FILE_IS_OPENED);
1117 : }
1118 :
1119 : /* read from the file */
- 1120 5043231 : read_size = handle_read(&handle[j], file_pos, buffer[j], state->block_size,
- 1121 5043231 : log_error, state->opt.expected_missing ? log_expected : 0);
- 1122 5043231 : if (read_size == -1) {
+ 1120 5042159 : read_size = handle_read(&handle[j], file_pos, buffer[j], state->block_size,
+ 1121 5042159 : log_error, state->opt.expected_missing ? log_expected : 0);
+ 1122 5042159 : if (read_size == -1) {
1123 : /* save the failed block for the check/fix */
- 1124 441964 : failed[failed_count].is_bad = 1; /* it's bad because we cannot read it */
- 1125 441964 : failed[failed_count].is_outofdate = 0;
- 1126 441964 : failed[failed_count].index = j;
- 1127 441964 : failed[failed_count].block = block;
- 1128 441964 : failed[failed_count].disk = disk;
- 1129 441964 : failed[failed_count].file = file;
- 1130 441964 : failed[failed_count].file_pos = file_pos;
- 1131 441964 : failed[failed_count].handle = &handle[j];
- 1132 441964 : ++failed_count;
+ 1124 442169 : failed[failed_count].is_bad = 1; /* it's bad because we cannot read it */
+ 1125 442169 : failed[failed_count].is_outofdate = 0;
+ 1126 442169 : failed[failed_count].index = j;
+ 1127 442169 : failed[failed_count].block = block;
+ 1128 442169 : failed[failed_count].disk = disk;
+ 1129 442169 : failed[failed_count].file = file;
+ 1130 442169 : failed[failed_count].file_pos = file_pos;
+ 1131 442169 : failed[failed_count].handle = &handle[j];
+ 1132 442169 : ++failed_count;
1133 :
- 1134 441964 : log_tag("error:%u:%s:%s: Read error at position %u\n", i, disk->name, esc_tag(file->sub, esc_buffer), file_pos);
- 1135 441964 : ++error;
- 1136 441964 : continue;
+ 1134 442169 : log_tag("error:%u:%s:%s: Read error at position %u\n", i, disk->name, esc_tag(file->sub, esc_buffer), file_pos);
+ 1135 442169 : ++error;
+ 1136 442169 : continue;
1137 : }
1138 :
- 1139 4601267 : countsize += read_size;
+ 1139 4599990 : countsize += read_size;
1140 :
1141 : /* always insert CHG blocks, the repair functions needs all of them */
1142 : /* because the parity may be still referring at the old state */
1143 : /* and the repair must be aware of it */
- 1144 4601267 : if (block_state == BLOCK_STATE_CHG) {
+ 1144 4599990 : if (block_state == BLOCK_STATE_CHG) {
1145 : /* we DO NOT mark them as bad to avoid to overwrite them with wrong data. */
1146 : /* if we don't have a hash, we always assume the first read of the block correct. */
1147 13843 : failed[failed_count].is_bad = 0; /* we assume the CHG block correct */
@@ -1218,39 +1218,39 @@
1156 13843 : continue;
1157 : }
1158 :
- 1159 4587424 : assert(block_state == BLOCK_STATE_BLK || block_state == BLOCK_STATE_REP);
+ 1159 4586147 : assert(block_state == BLOCK_STATE_BLK || block_state == BLOCK_STATE_REP);
1160 :
1161 : /* compute the hash of the block just read */
- 1162 4587424 : if (rehash) {
+ 1162 4586147 : if (rehash) {
1163 27243 : memhash(state->prevhash, state->prevhashseed, hash, buffer[j], read_size);
1164 : } else {
- 1165 4560181 : memhash(state->hash, state->hashseed, hash, buffer[j], read_size);
+ 1165 4558904 : memhash(state->hash, state->hashseed, hash, buffer[j], read_size);
1166 : }
1167 :
1168 : /* compare the hash */
- 1169 4587424 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
- 1170 12988 : unsigned diff = memdiff(hash, block->hash, BLOCK_HASH_SIZE);
+ 1169 4586147 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
+ 1170 12722 : unsigned diff = memdiff(hash, block->hash, BLOCK_HASH_SIZE);
1171 :
1172 : /* save the failed block for the check/fix */
- 1173 12988 : failed[failed_count].is_bad = 1; /* it's bad because the hash doesn't match */
- 1174 12988 : failed[failed_count].is_outofdate = 0;
- 1175 12988 : failed[failed_count].index = j;
- 1176 12988 : failed[failed_count].block = block;
- 1177 12988 : failed[failed_count].disk = disk;
- 1178 12988 : failed[failed_count].file = file;
- 1179 12988 : failed[failed_count].file_pos = file_pos;
- 1180 12988 : failed[failed_count].handle = &handle[j];
- 1181 12988 : ++failed_count;
+ 1173 12722 : failed[failed_count].is_bad = 1; /* it's bad because the hash doesn't match */
+ 1174 12722 : failed[failed_count].is_outofdate = 0;
+ 1175 12722 : failed[failed_count].index = j;
+ 1176 12722 : failed[failed_count].block = block;
+ 1177 12722 : failed[failed_count].disk = disk;
+ 1178 12722 : failed[failed_count].file = file;
+ 1179 12722 : failed[failed_count].file_pos = file_pos;
+ 1180 12722 : failed[failed_count].handle = &handle[j];
+ 1181 12722 : ++failed_count;
1182 :
- 1183 12988 : log_tag("error:%u:%s:%s: Data error at position %u, diff bits %u\n", i, disk->name, esc_tag(file->sub, esc_buffer), file_pos, diff);
- 1184 12988 : ++error;
- 1185 12988 : continue;
+ 1183 12722 : log_tag("error:%u:%s:%s: Data error at position %u, diff bits %u\n", i, disk->name, esc_tag(file->sub, esc_buffer), file_pos, diff);
+ 1184 12722 : ++error;
+ 1185 12722 : continue;
1186 : }
1187 :
1188 : /* always insert REP blocks, the repair functions needs all of them */
1189 : /* because the parity may be still referring at the old state */
1190 : /* and the repair must be aware of it */
- 1191 4574436 : if (block_state == BLOCK_STATE_REP) {
+ 1191 4573425 : if (block_state == BLOCK_STATE_REP) {
1192 53428 : failed[failed_count].is_bad = 0; /* it's not bad */
1193 53428 : failed[failed_count].is_outofdate = 0;
1194 53428 : failed[failed_count].index = j;
@@ -1297,35 +1297,35 @@
1235 870958 : ret = repair(state, rehash, i, diskmax, failed, failed_map, failed_count, buffer, buffer_recov, buffer_zero);
1236 870958 : if (ret != 0) {
1237 : /* increment the number of errors */
- 1238 47946 : if (ret > 0)
- 1239 4808 : error += ret;
- 1240 47946 : ++unrecoverable_error;
+ 1238 48053 : if (ret > 0)
+ 1239 4801 : error += ret;
+ 1240 48053 : ++unrecoverable_error;
1241 :
1242 : /* print a list of all the errors in files */
- 1243 219162 : for (j = 0; j < failed_count; ++j) {
- 1244 171216 : if (failed[j].is_bad)
- 1245 166694 : log_tag("unrecoverable:%u:%s:%s: Unrecoverable error at position %u\n", i, failed[j].disk->name, esc_tag(failed[j].file->sub, esc_buffer), failed[j].file_pos);
+ 1243 219490 : for (j = 0; j < failed_count; ++j) {
+ 1244 171437 : if (failed[j].is_bad)
+ 1245 166915 : log_tag("unrecoverable:%u:%s:%s: Unrecoverable error at position %u\n", i, failed[j].disk->name, esc_tag(failed[j].file->sub, esc_buffer), failed[j].file_pos);
1246 : }
1247 :
1248 : /* keep track of damaged files */
- 1249 219162 : for (j = 0; j < failed_count; ++j) {
- 1250 171216 : if (failed[j].is_bad)
- 1251 166694 : file_flag_set(failed[j].file, FILE_IS_DAMAGED);
+ 1249 219490 : for (j = 0; j < failed_count; ++j) {
+ 1250 171437 : if (failed[j].is_bad)
+ 1251 166915 : file_flag_set(failed[j].file, FILE_IS_DAMAGED);
1252 : }
1253 : } else {
1254 : /* now counts partial recovers */
1255 : /* note that this could happen only when we have an incomplete 'sync' */
1256 : /* and that we have recovered is the state before the 'sync' */
- 1257 823012 : int partial_recover_error = 0;
+ 1257 822905 : int partial_recover_error = 0;
1258 :
1259 : /* print a list of all the errors in files */
- 1260 1380352 : for (j = 0; j < failed_count; ++j) {
- 1261 557340 : if (failed[j].is_bad && failed[j].is_outofdate) {
+ 1260 1380849 : for (j = 0; j < failed_count; ++j) {
+ 1261 557944 : if (failed[j].is_bad && failed[j].is_outofdate) {
1262 8 : ++partial_recover_error;
1263 8 : log_tag("unrecoverable:%u:%s:%s: Unrecoverable unsynced error at position %u\n", i, failed[j].disk->name, esc_tag(failed[j].file->sub, esc_buffer), failed[j].file_pos);
1264 : }
1265 : }
- 1266 823012 : if (partial_recover_error != 0) {
+ 1266 822905 : if (partial_recover_error != 0) {
1267 8 : error += partial_recover_error;
1268 8 : ++unrecoverable_error;
1269 : }
@@ -1333,36 +1333,36 @@
1271 : /* now check parities, but only if all the blocks have it computed */
1272 : /* if you check/fix after a partial sync, it's OK to have parity errors on the blocks with invalid parity */
1273 : /* and doesn't make sense to try to fix it */
- 1274 823012 : if (valid_parity) {
+ 1274 822905 : if (valid_parity) {
1275 : /* check the parity */
- 1276 3728924 : for (l = 0; l < state->level; ++l) {
- 1277 2967497 : if (buffer_recov[l] != 0 && memcmp(buffer_recov[l], buffer[diskmax + l], state->block_size) != 0) {
- 1278 78683 : unsigned diff = memdiff(buffer_recov[l], buffer[diskmax + l], state->block_size);
+ 1276 3728710 : for (l = 0; l < state->level; ++l) {
+ 1277 2967390 : if (buffer_recov[l] != 0 && memcmp(buffer_recov[l], buffer[diskmax + l], state->block_size) != 0) {
+ 1278 78690 : unsigned diff = memdiff(buffer_recov[l], buffer[diskmax + l], state->block_size);
1279 :
1280 : /* mark that the read parity is wrong, setting ptr to 0 */
- 1281 78683 : buffer_recov[l] = 0;
+ 1281 78690 : buffer_recov[l] = 0;
1282 :
- 1283 78683 : log_tag("parity_error:%u:%s: Data error, diff bits %u\n", i, lev_config_name(l), diff);
- 1284 78683 : ++error;
+ 1283 78690 : log_tag("parity_error:%u:%s: Data error, diff bits %u\n", i, lev_config_name(l), diff);
+ 1284 78690 : ++error;
1285 : }
1286 : }
1287 : }
1288 :
1289 : /* now write recovered files */
- 1290 823012 : if (fix) {
+ 1290 822905 : if (fix) {
1291 : /* update the fixed files */
- 1292 652672 : for (j = 0; j < failed_count; ++j) {
+ 1292 652804 : for (j = 0; j < failed_count; ++j) {
1293 : /* nothing to do if it doesn't need recovering */
- 1294 337966 : if (!failed[j].is_bad)
+ 1294 338160 : if (!failed[j].is_bad)
1295 40318 : continue;
1296 :
1297 : /* do not fix if the file is excluded */
- 1298 297648 : if (file_flag_has(failed[j].file, FILE_IS_EXCLUDED)
- 1299 288368 : || (state->opt.syncedonly && file_flag_has(failed[j].file, FILE_IS_UNSYNCED)))
+ 1298 297842 : if (file_flag_has(failed[j].file, FILE_IS_EXCLUDED)
+ 1299 288562 : || (state->opt.syncedonly && file_flag_has(failed[j].file, FILE_IS_UNSYNCED)))
1300 9280 : continue;
1301 :
- 1302 288368 : ret = handle_write(failed[j].handle, failed[j].file_pos, buffer[failed[j].index], state->block_size);
- 1303 288368 : if (ret == -1) {
+ 1302 288562 : ret = handle_write(failed[j].handle, failed[j].file_pos, buffer[failed[j].index], state->block_size);
+ 1303 288562 : if (ret == -1) {
1304 : /* LCOV_EXCL_START */
1305 : /* mark the file as damaged */
1306 : file_flag_set(failed[j].file, FILE_IS_DAMAGED);
@@ -1380,7 +1380,7 @@
1318 : }
1319 :
1320 : /* if we are not sure that the recovered content is uptodate */
- 1321 288368 : if (failed[j].is_outofdate) {
+ 1321 288562 : if (failed[j].is_outofdate) {
1322 : /* mark the file as damaged */
1323 8 : file_flag_set(failed[j].file, FILE_IS_DAMAGED);
1324 8 : continue;
@@ -1388,20 +1388,20 @@
1326 :
1327 : /* mark the file as containing some fixes */
1328 : /* note that it could be also marked as damaged in other iterations */
- 1329 288360 : file_flag_set(failed[j].file, FILE_IS_FIXED);
+ 1329 288554 : file_flag_set(failed[j].file, FILE_IS_FIXED);
1330 :
- 1331 288360 : log_tag("fixed:%u:%s:%s: Fixed data error at position %u\n", i, failed[j].disk->name, esc_tag(failed[j].file->sub, esc_buffer), failed[j].file_pos);
- 1332 288360 : ++recovered_error;
+ 1331 288554 : log_tag("fixed:%u:%s:%s: Fixed data error at position %u\n", i, failed[j].disk->name, esc_tag(failed[j].file->sub, esc_buffer), failed[j].file_pos);
+ 1332 288554 : ++recovered_error;
1333 : }
1334 :
1335 : /* update parity only if all the blocks have it computed */
1336 : /* if you check/fix after a partial sync, you do not want to fix parity */
1337 : /* for blocks that are going to have it computed in the sync completion */
- 1338 314706 : if (valid_parity) {
+ 1338 314644 : if (valid_parity) {
1339 : /* update the parity */
- 1340 964137 : for (l = 0; l < state->level; ++l) {
+ 1340 964013 : for (l = 0; l < state->level; ++l) {
1341 : /* if the parity on disk is wrong */
- 1342 698611 : if (buffer_recov[l] == 0
+ 1342 698549 : if (buffer_recov[l] == 0
1343 : /* and we have access at the parity */
1344 72150 : && parity[l] != 0
1345 : /* and the parity is not excluded */
@@ -1426,9 +1426,9 @@
1364 : } else {
1365 : /* if we are not fixing, we just set the FIXED flag */
1366 : /* meaning that we could fix this file if we try */
- 1367 727680 : for (j = 0; j < failed_count; ++j) {
- 1368 219374 : if (failed[j].is_bad) {
- 1369 178489 : file_flag_set(failed[j].file, FILE_IS_FIXED);
+ 1367 728045 : for (j = 0; j < failed_count; ++j) {
+ 1368 219784 : if (failed[j].is_bad) {
+ 1369 178899 : file_flag_set(failed[j].file, FILE_IS_FIXED);
1370 : }
1371 : }
1372 : }
@@ -1436,9 +1436,9 @@
1374 : } else {
1375 : /* if we are not checking, we just set the DAMAGED flag */
1376 : /* to report that the file is damaged, and we don't know if we can fix it */
- 1377 44985 : for (j = 0; j < failed_count; ++j) {
- 1378 5710 : if (failed[j].is_bad) {
- 1379 5710 : file_flag_set(failed[j].file, FILE_IS_DAMAGED);
+ 1377 45171 : for (j = 0; j < failed_count; ++j) {
+ 1378 5896 : if (failed[j].is_bad) {
+ 1379 5896 : file_flag_set(failed[j].file, FILE_IS_DAMAGED);
1380 : }
1381 : }
1382 : }
@@ -1496,29 +1496,29 @@
1434 2783 : pathprint(path, sizeof(path), "%s%s", disk->dir, file->sub);
1435 2783 : ret = stat(path, &st);
1436 2783 : if (ret == -1) {
- 1437 174 : unsuccesful = 1;
+ 1437 165 : unsuccesful = 1;
1438 :
- 1439 174 : log_error("Error stating empty file '%s'. %s.\n", path, strerror(errno));
- 1440 174 : log_tag("error:%s:%s: Empty file stat error\n", disk->name, esc_tag(file->sub, esc_buffer));
- 1441 174 : ++error;
- 1442 2609 : } else if (!S_ISREG(st.st_mode)) {
+ 1439 165 : log_error("Error stating empty file '%s'. %s.\n", path, strerror(errno));
+ 1440 165 : log_tag("error:%s:%s: Empty file stat error\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 1441 165 : ++error;
+ 1442 2618 : } else if (!S_ISREG(st.st_mode)) {
1443 0 : unsuccesful = 1;
1444 :
1445 0 : log_tag("error:%s:%s: Empty file error for not regular file\n", disk->name, esc_tag(file->sub, esc_buffer));
1446 0 : ++error;
- 1447 2609 : } else if (st.st_size != 0) {
- 1448 4 : unsuccesful = 1;
+ 1447 2618 : } else if (st.st_size != 0) {
+ 1448 5 : unsuccesful = 1;
1449 :
- 1450 4 : log_tag("error:%s:%s: Empty file error for size '%" PRIu64 "'\n", disk->name, esc_tag(file->sub, esc_buffer), st.st_size);
- 1451 4 : ++error;
+ 1450 5 : log_tag("error:%s:%s: Empty file error for size '%" PRIu64 "'\n", disk->name, esc_tag(file->sub, esc_buffer), st.st_size);
+ 1451 5 : ++error;
1452 : }
1453 :
1454 2783 : if (fix && unsuccesful) {
1455 : int f;
1456 :
1457 : /* create the ancestor directories */
- 1458 157 : ret = mkancestor(path);
- 1459 157 : if (ret != 0) {
+ 1458 154 : ret = mkancestor(path);
+ 1459 154 : if (ret != 0) {
1460 : /* LCOV_EXCL_START */
1461 : log_fatal("WARNING! Without a working data disk, it isn't possible to fix errors on it.\n");
1462 : log_fatal("Stopping\n");
@@ -1529,8 +1529,8 @@
1467 :
1468 : /* create it */
1469 : /* O_NOFOLLOW: do not follow links to ensure to open the real file */
- 1470 157 : f = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_NOFOLLOW, 0600);
- 1471 157 : if (f == -1) {
+ 1470 154 : f = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_NOFOLLOW, 0600);
+ 1471 154 : if (f == -1) {
1472 : /* LCOV_EXCL_START */
1473 : log_fatal("Error creating empty file '%s'. %s.\n", path, strerror(errno));
1474 : if (errno == EACCES) {
@@ -1546,8 +1546,8 @@
1484 : }
1485 :
1486 : /* set the original modification time */
- 1487 157 : ret = fmtime(f, file->mtime_sec, file->mtime_nsec);
- 1488 157 : if (ret != 0) {
+ 1487 154 : ret = fmtime(f, file->mtime_sec, file->mtime_nsec);
+ 1488 154 : if (ret != 0) {
1489 : /* LCOV_EXCL_START */
1490 : close(f);
1491 :
@@ -1560,8 +1560,8 @@
1498 : }
1499 :
1500 : /* close it */
- 1501 157 : ret = close(f);
- 1502 157 : if (ret != 0) {
+ 1501 154 : ret = close(f);
+ 1502 154 : if (ret != 0) {
1503 : /* LCOV_EXCL_START */
1504 : log_fatal("WARNING! Without a working data disk, it isn't possible to fix errors on it.\n");
1505 : log_fatal("Stopping\n");
@@ -1570,11 +1570,11 @@
1508 : /* LCOV_EXCL_STOP */
1509 : }
1510 :
- 1511 157 : log_tag("fixed:%s:%s: Fixed empty file\n", disk->name, esc_tag(file->sub, esc_buffer));
- 1512 157 : ++recovered_error;
+ 1511 154 : log_tag("fixed:%s:%s: Fixed empty file\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 1512 154 : ++recovered_error;
1513 :
- 1514 157 : log_tag("status:recovered:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
- 1515 157 : msg_info("recovered %s\n", fmt_term(disk, file->sub, esc_buffer));
+ 1514 154 : log_tag("status:recovered:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
+ 1515 154 : msg_info("recovered %s\n", fmt_term(disk, file->sub, esc_buffer));
1516 : }
1517 : }
1518 :
@@ -1656,25 +1656,25 @@
1594 66532 : pathprint(path, sizeof(path), "%s%s", disk->dir, slink->sub);
1595 66532 : ret = readlink(path, linkto, sizeof(linkto));
1596 66532 : if (ret < 0) {
- 1597 4333 : unsuccesful = 1;
+ 1597 4292 : unsuccesful = 1;
1598 :
- 1599 4333 : log_error("Error reading symlink '%s'. %s.\n", path, strerror(errno));
- 1600 4333 : log_tag("symlink_error:%s:%s: Symlink read error\n", disk->name, esc_tag(slink->sub, esc_buffer));
- 1601 4333 : ++error;
- 1602 62199 : } else if (ret >= PATH_MAX) {
+ 1599 4292 : log_error("Error reading symlink '%s'. %s.\n", path, strerror(errno));
+ 1600 4292 : log_tag("symlink_error:%s:%s: Symlink read error\n", disk->name, esc_tag(slink->sub, esc_buffer));
+ 1601 4292 : ++error;
+ 1602 62240 : } else if (ret >= PATH_MAX) {
1603 0 : unsuccesful = 1;
1604 :
1605 0 : log_error("Error reading symlink '%s'. Symlink too long.\n", path);
1606 0 : log_tag("symlink_error:%s:%s: Symlink read error\n", disk->name, esc_tag(slink->sub, esc_buffer));
1607 0 : ++error;
1608 : } else {
- 1609 62199 : linkto[ret] = 0;
+ 1609 62240 : linkto[ret] = 0;
1610 :
- 1611 62199 : if (strcmp(linkto, slink->linkto) != 0) {
- 1612 503 : unsuccesful = 1;
+ 1611 62240 : if (strcmp(linkto, slink->linkto) != 0) {
+ 1612 544 : unsuccesful = 1;
1613 :
- 1614 503 : log_tag("symlink_error:%s:%s: Symlink data error '%s' instead of '%s'\n", disk->name, esc_tag(slink->sub, esc_buffer), linkto, slink->linkto);
- 1615 503 : ++error;
+ 1614 544 : log_tag("symlink_error:%s:%s: Symlink data error '%s' instead of '%s'\n", disk->name, esc_tag(slink->sub, esc_buffer), linkto, slink->linkto);
+ 1615 544 : ++error;
1616 : }
1617 : }
1618 : }
@@ -1862,13 +1862,13 @@
1800 : /* if the file was not created, meaning that it was already existing */
1801 870311 : if (!file_flag_has(file, FILE_IS_CREATED)) {
1802 : /* nothing to do */
- 1803 1627624 : continue;
+ 1803 1627487 : continue;
1804 : }
1805 :
1806 : /* if processing was finished */
- 1807 112998 : if (file_flag_has(file, FILE_IS_FINISHED)) {
+ 1807 113135 : if (file_flag_has(file, FILE_IS_FINISHED)) {
1808 : /* nothing to do */
- 1809 112998 : continue;
+ 1809 113135 : continue;
1810 : }
1811 :
1812 : /* if the file was originally missing, and processing not yet finished */
diff --git a/cov/cmdline/dry.c.func-sort-c.html b/cov/cmdline/dry.c.func-sort-c.html
index 0bea9388..57c0a78f 100644
--- a/cov/cmdline/dry.c.func-sort-c.html
+++ b/cov/cmdline/dry.c.func-sort-c.html
@@ -60,12 +60,12 @@
Hit count  |
- | dry_data_reader |
- 42603 |
+ dry_parity_reader |
+ 42604 |
- | dry_parity_reader |
- 42602 |
+ dry_data_reader |
+ 42590 |
| block_is_enabled |
diff --git a/cov/cmdline/dry.c.func.html b/cov/cmdline/dry.c.func.html
index 0d17ac83..141183a7 100644
--- a/cov/cmdline/dry.c.func.html
+++ b/cov/cmdline/dry.c.func.html
@@ -65,11 +65,11 @@
| dry_data_reader |
- 42603 |
+ 42590 |
| dry_parity_reader |
- 42602 |
+ 42604 |
| state_dry |
diff --git a/cov/cmdline/dry.c.gcov.html b/cov/cmdline/dry.c.gcov.html
index 0e2b5f14..52744e1f 100644
--- a/cov/cmdline/dry.c.gcov.html
+++ b/cov/cmdline/dry.c.gcov.html
@@ -101,30 +101,30 @@
39 7102 : return 1;
40 : }
41 :
- 42 42603 : static void dry_data_reader(struct snapraid_worker* worker, struct snapraid_task* task)
+ 42 42590 : static void dry_data_reader(struct snapraid_worker* worker, struct snapraid_task* task)
43 : {
- 44 42603 : struct snapraid_io* io = worker->io;
- 45 42603 : struct snapraid_state* state = io->state;
- 46 42603 : struct snapraid_handle* handle = worker->handle;
- 47 42603 : struct snapraid_disk* disk = handle->disk;
- 48 42603 : block_off_t blockcur = task->position;
- 49 42603 : unsigned char* buffer = task->buffer;
+ 44 42590 : struct snapraid_io* io = worker->io;
+ 45 42590 : struct snapraid_state* state = io->state;
+ 46 42590 : struct snapraid_handle* handle = worker->handle;
+ 47 42590 : struct snapraid_disk* disk = handle->disk;
+ 48 42590 : block_off_t blockcur = task->position;
+ 49 42590 : unsigned char* buffer = task->buffer;
50 : int ret;
51 : char esc_buffer[ESC_MAX];
52 :
53 : /* if the disk position is not used */
- 54 42603 : if (!disk) {
+ 54 42590 : if (!disk) {
55 : /* use an empty block */
- 56 4687 : memset(buffer, 0, state->block_size);
- 57 4687 : task->state = TASK_STATE_DONE;
- 58 9918 : return;
+ 56 4686 : memset(buffer, 0, state->block_size);
+ 57 4686 : task->state = TASK_STATE_DONE;
+ 58 9916 : return;
59 : }
60 :
61 : /* get the block */
- 62 37916 : task->block = fs_par2block_find(disk, blockcur);
+ 62 37904 : task->block = fs_par2block_find(disk, blockcur);
63 :
64 : /* if the block is not used */
- 65 37888 : if (!block_has_file(task->block)) {
+ 65 37878 : if (!block_has_file(task->block)) {
66 : /* use an empty block */
67 544 : memset(buffer, 0, state->block_size);
68 544 : task->state = TASK_STATE_DONE;
@@ -132,13 +132,13 @@
70 : }
71 :
72 : /* get the file of this block */
- 73 37334 : task->file = fs_par2file_get(disk, blockcur, &task->file_pos);
+ 73 37320 : task->file = fs_par2file_get(disk, blockcur, &task->file_pos);
74 :
75 : /* if the file is different than the current one, close it */
- 76 37352 : if (handle->file != 0 && handle->file != task->file) {
+ 76 37335 : if (handle->file != 0 && handle->file != task->file) {
77 : /* keep a pointer at the file we are going to close for error reporting */
- 78 15083 : struct snapraid_file* report = handle->file;
- 79 15083 : ret = handle_close(handle);
+ 78 15082 : struct snapraid_file* report = handle->file;
+ 79 15082 : ret = handle_close(handle);
80 15071 : if (ret == -1) {
81 : /* LCOV_EXCL_START */
82 : /* This one is really an unexpected error, because we are only reading */
@@ -162,8 +162,8 @@
100 : }
101 : }
102 :
- 103 37340 : ret = handle_open(handle, task->file, state->file_mode, log_error, 0);
- 104 37368 : if (ret == -1) {
+ 103 37324 : ret = handle_open(handle, task->file, state->file_mode, log_error, 0);
+ 104 37350 : if (ret == -1) {
105 0 : if (errno == EIO) {
106 : /* LCOV_EXCL_START */
107 : log_tag("error:%u:%s:%s: Open EIO error. %s\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer), strerror(errno));
@@ -180,8 +180,8 @@
118 0 : return;
119 : }
120 :
- 121 37368 : task->read_size = handle_read(handle, task->file_pos, buffer, state->block_size, log_error, 0);
- 122 37295 : if (task->read_size == -1) {
+ 121 37350 : task->read_size = handle_read(handle, task->file_pos, buffer, state->block_size, log_error, 0);
+ 122 37281 : if (task->read_size == -1) {
123 0 : if (errno == EIO) {
124 0 : log_tag("error:%u:%s:%s: Read EIO error at position %u. %s\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer), task->file_pos, strerror(errno));
125 0 : log_error("Input/Output error in file '%s' at position '%u'\n", handle->path, task->file_pos);
@@ -195,24 +195,24 @@
133 : }
134 :
135 : /* store the path of the opened file */
- 136 37295 : pathcpy(task->path, sizeof(task->path), handle->path);
+ 136 37281 : pathcpy(task->path, sizeof(task->path), handle->path);
137 :
- 138 37327 : task->state = TASK_STATE_DONE;
+ 138 37299 : task->state = TASK_STATE_DONE;
139 : }
140 :
- 141 42602 : static void dry_parity_reader(struct snapraid_worker* worker, struct snapraid_task* task)
+ 141 42604 : static void dry_parity_reader(struct snapraid_worker* worker, struct snapraid_task* task)
142 : {
- 143 42602 : struct snapraid_io* io = worker->io;
- 144 42602 : struct snapraid_state* state = io->state;
- 145 42602 : struct snapraid_parity_handle* parity_handle = worker->parity_handle;
- 146 42602 : unsigned level = parity_handle->level;
- 147 42602 : block_off_t blockcur = task->position;
- 148 42602 : unsigned char* buffer = task->buffer;
+ 143 42604 : struct snapraid_io* io = worker->io;
+ 144 42604 : struct snapraid_state* state = io->state;
+ 145 42604 : struct snapraid_parity_handle* parity_handle = worker->parity_handle;
+ 146 42604 : unsigned level = parity_handle->level;
+ 147 42604 : block_off_t blockcur = task->position;
+ 148 42604 : unsigned char* buffer = task->buffer;
149 : int ret;
150 :
151 : /* read the parity */
- 152 42602 : ret = parity_read(parity_handle, blockcur, buffer, state->block_size, log_error);
- 153 42572 : if (ret == -1) {
+ 152 42604 : ret = parity_read(parity_handle, blockcur, buffer, state->block_size, log_error);
+ 153 42568 : if (ret == -1) {
154 0 : if (errno == EIO) {
155 0 : log_tag("parity_error:%u:%s: Read EIO error. %s\n", blockcur, lev_config_name(level), strerror(errno));
156 0 : log_error("Input/Output error in parity '%s' at position '%u'\n", lev_config_name(level), blockcur);
@@ -225,7 +225,7 @@
163 0 : return;
164 : }
165 :
- 166 42572 : task->state = TASK_STATE_DONE;
+ 166 42568 : task->state = TASK_STATE_DONE;
167 : }
168 :
169 2 : static int state_dry_process(struct snapraid_state* state, struct snapraid_parity_handle* parity_handle, block_off_t blockstart, block_off_t blockmax)
diff --git a/cov/cmdline/elem.c.func-sort-c.html b/cov/cmdline/elem.c.func-sort-c.html
index c878e091..37d36fef 100644
--- a/cov/cmdline/elem.c.func-sort-c.html
+++ b/cov/cmdline/elem.c.func-sort-c.html
@@ -61,71 +61,71 @@
| extent_parity_inside_compare_unlock |
- 114112918 |
+ 113816358 |
| fs_lock |
- 53196997 |
+ 53194369 |
| fs_unlock |
- 53196517 |
+ 53193869 |
| extent_file_compare |
- 45010276 |
+ 45007856 |
| fs_file2block_get |
- 44947073 |
+ 44945080 |
| extent_parity_compare |
- 44514357 |
+ 44511012 |
| fs_par2extent_get_unlock |
- 39144190 |
+ 39142093 |
| fs_par2file_find |
- 39037624 |
+ 39035232 |
| fs_par2block_find |
- 27313808 |
+ 27312315 |
| extent_file_inside_compare_unlock |
- 21311558 |
+ 21314053 |
| filter_apply |
- 12457480 |
+ 12456124 |
| fs_file2extent_get_unlock |
- 10336534 |
+ 10336325 |
| fs_allocate |
- 9176132 |
+ 9175619 |
| file_block_size |
- 6823546 |
+ 6823060 |
| extent_file_check_foreach_unlock |
- 6584521 |
+ 6584437 |
| extent_parity_check_foreach_unlock |
- 6584521 |
+ 6584437 |
| filter_recurse |
- 6236835 |
+ 6236157 |
| file_block_is_last |
@@ -133,55 +133,55 @@
| fs_file2par_find |
- 4869430 |
+ 4869535 |
| extent_alloc |
- 3735733 |
+ 3735492 |
| file_alloc |
- 3691405 |
+ 3691209 |
| extent_free |
- 3564894 |
+ 3564805 |
| file_free |
- 3543810 |
+ 3543765 |
| filter_element |
- 3332962 |
+ 3332623 |
| filter_path |
- 3329865 |
+ 3329526 |
| filter_content |
- 3173426 |
+ 3173124 |
| file_inode_compare_to_arg |
- 987121 |
+ 987050 |
| time_compare |
- 683554 |
+ 684987 |
| fmt_term |
- 355785 |
+ 356004 |
| file_path_compare |
- 189479 |
+ 189434 |
| filter_type |
- 125137 |
+ 125245 |
| link_alloc |
@@ -193,43 +193,43 @@
| fs_deallocate |
- 106256 |
+ 106126 |
| file_path_compare_to_arg |
- 97502 |
+ 97552 |
| filter_existence |
80691 |
+
+ | file_physical_compare |
+ 63430 |
+
| extent_disk_size_compare_unlock |
- 50477 |
+ 50483 |
| file_name |
- 47958 |
+ 47954 |
| filter_correctness |
38646 |
-
- | file_physical_compare |
- 35166 |
-
| link_name_compare_to_arg |
33727 |
| file_namestamp_compare |
- 23979 |
+ 23977 |
| file_name_compare |
- 23979 |
+ 23977 |
| file_stamp_compare |
diff --git a/cov/cmdline/elem.c.func.html b/cov/cmdline/elem.c.func.html
index b920d883..4f769ce7 100644
--- a/cov/cmdline/elem.c.func.html
+++ b/cov/cmdline/elem.c.func.html
@@ -89,7 +89,7 @@
| extent_alloc |
- 3735733 |
+ 3735492 |
| extent_disk_empty_compare_unlock |
@@ -97,39 +97,39 @@
| extent_disk_size_compare_unlock |
- 50477 |
+ 50483 |
| extent_file_check_foreach_unlock |
- 6584521 |
+ 6584437 |
| extent_file_compare |
- 45010276 |
+ 45007856 |
| extent_file_inside_compare_unlock |
- 21311558 |
+ 21314053 |
| extent_free |
- 3564894 |
+ 3564805 |
| extent_parity_check_foreach_unlock |
- 6584521 |
+ 6584437 |
| extent_parity_compare |
- 44514357 |
+ 44511012 |
| extent_parity_inside_compare_unlock |
- 114112918 |
+ 113816358 |
| file_alloc |
- 3691405 |
+ 3691209 |
| file_block_is_last |
@@ -137,7 +137,7 @@
| file_block_size |
- 6823546 |
+ 6823060 |
| file_copy |
@@ -149,7 +149,7 @@
| file_free |
- 3543810 |
+ 3543765 |
| file_inode_compare |
@@ -157,27 +157,27 @@
| file_inode_compare_to_arg |
- 987121 |
+ 987050 |
| file_name |
- 47958 |
+ 47954 |
| file_name_compare |
- 23979 |
+ 23977 |
| file_namestamp_compare |
- 23979 |
+ 23977 |
| file_path_compare |
- 189479 |
+ 189434 |
| file_path_compare_to_arg |
- 97502 |
+ 97552 |
| file_pathstamp_compare |
@@ -185,7 +185,7 @@
| file_physical_compare |
- 35166 |
+ 63430 |
| file_rename |
@@ -205,11 +205,11 @@
| filter_apply |
- 12457480 |
+ 12456124 |
| filter_content |
- 3173426 |
+ 3173124 |
| filter_correctness |
@@ -217,7 +217,7 @@
| filter_element |
- 3332962 |
+ 3332623 |
| filter_emptydir |
@@ -233,11 +233,11 @@
| filter_path |
- 3329865 |
+ 3329526 |
| filter_recurse |
- 6236835 |
+ 6236157 |
| filter_subdir |
@@ -245,7 +245,7 @@
| filter_type |
- 125137 |
+ 125245 |
| fmt_poll |
@@ -253,11 +253,11 @@
| fmt_term |
- 355785 |
+ 356004 |
| fs_allocate |
- 9176132 |
+ 9175619 |
| fs_check |
@@ -265,19 +265,19 @@
| fs_deallocate |
- 106256 |
+ 106126 |
| fs_file2block_get |
- 44947073 |
+ 44945080 |
| fs_file2extent_get_unlock |
- 10336534 |
+ 10336325 |
| fs_file2par_find |
- 4869430 |
+ 4869535 |
| fs_is_empty |
@@ -285,19 +285,19 @@
| fs_lock |
- 53196997 |
+ 53194369 |
| fs_par2block_find |
- 27313808 |
+ 27312315 |
| fs_par2extent_get_unlock |
- 39144190 |
+ 39142093 |
| fs_par2file_find |
- 39037624 |
+ 39035232 |
| fs_size |
@@ -305,7 +305,7 @@
| fs_unlock |
- 53196517 |
+ 53193869 |
| link_alloc |
@@ -333,7 +333,7 @@
| time_compare |
- 683554 |
+ 684987 |
diff --git a/cov/cmdline/elem.c.gcov.html b/cov/cmdline/elem.c.gcov.html
index 416d87f8..dec010b8 100644
--- a/cov/cmdline/elem.c.gcov.html
+++ b/cov/cmdline/elem.c.gcov.html
@@ -212,96 +212,96 @@
150 497 : free(filter);
151 497 : }
152 :
- 153 125137 : const char* filter_type(struct snapraid_filter* filter, char* out, size_t out_size)
+ 153 125245 : const char* filter_type(struct snapraid_filter* filter, char* out, size_t out_size)
154 : {
155 : const char* direction;
156 :
- 157 125137 : if (filter->direction < 0)
- 158 124874 : direction = "exclude";
+ 157 125245 : if (filter->direction < 0)
+ 158 124982 : direction = "exclude";
159 : else
160 263 : direction = "include";
161 :
- 162 125137 : if (filter->is_disk)
+ 162 125245 : if (filter->is_disk)
163 0 : pathprint(out, out_size, "%s %s:", direction, filter->pattern);
- 164 125137 : else if (filter->is_dir)
+ 164 125245 : else if (filter->is_dir)
165 0 : pathprint(out, out_size, "%s %s/", direction, filter->pattern);
166 : else
- 167 125137 : pathprint(out, out_size, "%s %s", direction, filter->pattern);
+ 167 125245 : pathprint(out, out_size, "%s %s", direction, filter->pattern);
168 :
- 169 125137 : return out;
+ 169 125245 : return out;
170 : }
171 :
- 172 12457480 : static int filter_apply(struct snapraid_filter* filter, struct snapraid_filter** reason, const char* path, const char* name, int is_dir)
+ 172 12456124 : static int filter_apply(struct snapraid_filter* filter, struct snapraid_filter** reason, const char* path, const char* name, int is_dir)
173 : {
- 174 12457480 : int ret = 0;
+ 174 12456124 : int ret = 0;
175 :
176 : /* match dirs with dirs and files with files */
- 177 12457480 : if (filter->is_dir && !is_dir)
+ 177 12456124 : if (filter->is_dir && !is_dir)
178 2949 : return 0;
- 179 12454531 : if (!filter->is_dir && is_dir)
- 180 6223814 : return 0;
+ 179 12453175 : if (!filter->is_dir && is_dir)
+ 180 6223136 : return 0;
181 :
- 182 6230717 : if (filter->is_path) {
+ 182 6230039 : if (filter->is_path) {
183 : /* skip initial slash, as always missing from the path */
184 2949 : if (fnmatch(filter->pattern + 1, path, FNM_PATHNAME | FNM_CASEINSENSITIVE_FOR_WIN) == 0)
185 0 : ret = filter->direction;
186 : } else {
- 187 6227768 : if (fnmatch(filter->pattern, name, FNM_CASEINSENSITIVE_FOR_WIN) == 0)
- 188 127601 : ret = filter->direction;
+ 187 6227090 : if (fnmatch(filter->pattern, name, FNM_CASEINSENSITIVE_FOR_WIN) == 0)
+ 188 127709 : ret = filter->direction;
189 : }
190 :
- 191 6230717 : if (reason != 0 && ret < 0)
- 192 124611 : *reason = filter;
+ 191 6230039 : if (reason != 0 && ret < 0)
+ 192 124719 : *reason = filter;
193 :
- 194 6230717 : return ret;
+ 194 6230039 : return ret;
195 : }
196 :
- 197 6236835 : static int filter_recurse(struct snapraid_filter* filter, struct snapraid_filter** reason, const char* const_path, int is_dir)
+ 197 6236157 : static int filter_recurse(struct snapraid_filter* filter, struct snapraid_filter** reason, const char* const_path, int is_dir)
198 : {
199 : char path[PATH_MAX];
200 : char* name;
201 : unsigned i;
202 :
- 203 6236835 : pathcpy(path, sizeof(path), const_path);
+ 203 6236157 : pathcpy(path, sizeof(path), const_path);
204 :
205 : /* filter for all the directories */
- 206 6236835 : name = path;
- 207 89825040 : for (i = 0; path[i] != 0; ++i) {
- 208 83591195 : if (path[i] == '/') {
+ 206 6236157 : name = path;
+ 207 89818142 : for (i = 0; path[i] != 0; ++i) {
+ 208 83584975 : if (path[i] == '/') {
209 : /* set a terminator */
- 210 6223635 : path[i] = 0;
+ 210 6222957 : path[i] = 0;
211 :
212 : /* filter the directory */
- 213 6223635 : if (filter_apply(filter, reason, path, name, 1) != 0)
+ 213 6222957 : if (filter_apply(filter, reason, path, name, 1) != 0)
214 2990 : return filter->direction;
215 :
216 : /* restore the slash */
- 217 6220645 : path[i] = '/';
+ 217 6219967 : path[i] = '/';
218 :
219 : /* next name */
- 220 6220645 : name = path + i + 1;
+ 220 6219967 : name = path + i + 1;
221 : }
222 : }
223 :
224 : /* filter the final file */
- 225 6233845 : if (filter_apply(filter, reason, path, name, is_dir) != 0)
- 226 124611 : return filter->direction;
+ 225 6233167 : if (filter_apply(filter, reason, path, name, is_dir) != 0)
+ 226 124719 : return filter->direction;
227 :
- 228 6109234 : return 0;
+ 228 6108448 : return 0;
229 : }
230 :
- 231 3332962 : static int filter_element(tommy_list* filterlist, struct snapraid_filter** reason, const char* disk, const char* sub, int is_dir, int is_def_include)
+ 231 3332623 : static int filter_element(tommy_list* filterlist, struct snapraid_filter** reason, const char* disk, const char* sub, int is_dir, int is_def_include)
232 : {
233 : tommy_node* i;
234 :
- 235 3332962 : int direction = 1; /* by default include all */
+ 235 3332623 : int direction = 1; /* by default include all */
236 :
237 : /* for each filter */
- 238 9543504 : for (i = tommy_list_head(filterlist); i != 0; i = i->next) {
+ 238 9542379 : for (i = tommy_list_head(filterlist); i != 0; i = i->next) {
239 : int ret;
- 240 6346823 : struct snapraid_filter* filter = i->data;
+ 240 6346145 : struct snapraid_filter* filter = i->data;
241 :
- 242 6346823 : if (filter->is_disk) {
+ 242 6346145 : if (filter->is_disk) {
243 109988 : if (fnmatch(filter->pattern, disk, FNM_CASEINSENSITIVE_FOR_WIN) == 0)
244 8680 : ret = filter->direction;
245 : else
@@ -309,39 +309,39 @@
247 109988 : if (reason != 0 && ret < 0)
248 0 : *reason = filter;
249 : } else {
- 250 6236835 : ret = filter_recurse(filter, reason, sub, is_dir);
+ 250 6236157 : ret = filter_recurse(filter, reason, sub, is_dir);
251 : }
252 :
- 253 6346823 : if (ret > 0) {
+ 253 6346145 : if (ret > 0) {
254 : /* include the file */
255 11670 : return 0;
- 256 6335153 : } else if (ret < 0) {
+ 256 6334475 : } else if (ret < 0) {
257 : /* exclude the file */
- 258 124611 : return -1;
+ 258 124719 : return -1;
259 : } else {
260 : /* default is opposite of the last filter */
- 261 6210542 : direction = -filter->direction;
- 262 6210542 : if (reason != 0 && direction < 0)
- 263 3111004 : *reason = filter;
+ 261 6209756 : direction = -filter->direction;
+ 262 6209756 : if (reason != 0 && direction < 0)
+ 263 3110665 : *reason = filter;
264 : /* continue with the next one */
265 : }
266 : }
267 :
268 : /* directories are always included by default, otherwise we cannot apply rules */
269 : /* to the contained files */
- 270 3196681 : if (is_def_include)
+ 270 3196234 : if (is_def_include)
271 3052 : return 0;
272 :
273 : /* files are excluded/included depending of the last rule processed */
- 274 3193629 : if (direction < 0)
+ 274 3193182 : if (direction < 0)
275 57608 : return -1;
276 :
- 277 3136021 : return 0;
+ 277 3135574 : return 0;
278 : }
279 :
- 280 3329865 : int filter_path(tommy_list* filterlist, struct snapraid_filter** reason, const char* disk, const char* sub)
+ 280 3329526 : int filter_path(tommy_list* filterlist, struct snapraid_filter** reason, const char* disk, const char* sub)
281 : {
- 282 3329865 : return filter_element(filterlist, reason, disk, sub, 0, 0);
+ 282 3329526 : return filter_element(filterlist, reason, disk, sub, 0, 0);
283 : }
284 :
285 3052 : int filter_subdir(tommy_list* filterlist, struct snapraid_filter** reason, const char* disk, const char* sub)
@@ -387,67 +387,67 @@
325 16098 : return 0;
326 :
327 : /* check each block of the file */
- 328 60520 : for (i = 0; i < file->blockmax; ++i) {
- 329 46295 : block_off_t parity_pos = fs_file2par_get(disk, file, i);
- 330 46295 : snapraid_info info = info_get(infoarr, parity_pos);
+ 328 60655 : for (i = 0; i < file->blockmax; ++i) {
+ 329 46442 : block_off_t parity_pos = fs_file2par_get(disk, file, i);
+ 330 46442 : snapraid_info info = info_get(infoarr, parity_pos);
331 :
332 : /* if the file has a bad block, don't exclude it */
- 333 46295 : if (info_get_bad(info))
- 334 8323 : return 0;
+ 333 46442 : if (info_get_bad(info))
+ 334 8335 : return 0;
335 : }
336 :
337 : /* the file is correct, so we filter it out */
- 338 14225 : return 1;
+ 338 14213 : return 1;
339 : }
340 :
- 341 3173426 : int filter_content(tommy_list* contentlist, const char* path)
+ 341 3173124 : int filter_content(tommy_list* contentlist, const char* path)
342 : {
343 : tommy_node* i;
344 :
- 345 40913424 : for (i = tommy_list_head(contentlist); i != 0; i = i->next) {
- 346 17283286 : struct snapraid_content* content = i->data;
+ 345 40911380 : for (i = tommy_list_head(contentlist); i != 0; i = i->next) {
+ 346 17282566 : struct snapraid_content* content = i->data;
347 : char tmp[PATH_MAX];
348 :
- 349 17283286 : if (pathcmp(content->content, path) == 0)
+ 349 17282566 : if (pathcmp(content->content, path) == 0)
350 0 : return -1;
351 :
352 : /* exclude also the ".tmp" copy used to save it */
- 353 17283286 : pathprint(tmp, sizeof(tmp), "%s.tmp", content->content);
- 354 17283286 : if (pathcmp(tmp, path) == 0)
+ 353 17282566 : pathprint(tmp, sizeof(tmp), "%s.tmp", content->content);
+ 354 17282566 : if (pathcmp(tmp, path) == 0)
355 0 : return -1;
356 :
357 : /* exclude also the ".lock" file */
- 358 17283286 : pathprint(tmp, sizeof(tmp), "%s.lock", content->content);
- 359 17283286 : if (pathcmp(tmp, path) == 0)
+ 358 17282566 : pathprint(tmp, sizeof(tmp), "%s.lock", content->content);
+ 359 17282566 : if (pathcmp(tmp, path) == 0)
360 0 : return -1;
361 : }
362 :
- 363 3173426 : return 0;
+ 363 3173124 : return 0;
364 : }
365 :
- 366 3691405 : struct snapraid_file* file_alloc(unsigned block_size, const char* sub, data_off_t size, uint64_t mtime_sec, int mtime_nsec, uint64_t inode, uint64_t physical)
+ 366 3691209 : struct snapraid_file* file_alloc(unsigned block_size, const char* sub, data_off_t size, uint64_t mtime_sec, int mtime_nsec, uint64_t inode, uint64_t physical)
367 : {
368 : struct snapraid_file* file;
369 : block_off_t i;
370 :
- 371 3691405 : file = malloc_nofail(sizeof(struct snapraid_file));
- 372 3691405 : file->sub = strdup_nofail(sub);
- 373 3691405 : file->size = size;
- 374 3691405 : file->blockmax = (size + block_size - 1) / block_size;
- 375 3691405 : file->mtime_sec = mtime_sec;
- 376 3691405 : file->mtime_nsec = mtime_nsec;
- 377 3691405 : file->inode = inode;
- 378 3691405 : file->physical = physical;
- 379 3691405 : file->flag = 0;
- 380 3691405 : file->blockvec = malloc_nofail(file->blockmax * block_sizeof());
+ 371 3691209 : file = malloc_nofail(sizeof(struct snapraid_file));
+ 372 3691209 : file->sub = strdup_nofail(sub);
+ 373 3691209 : file->size = size;
+ 374 3691209 : file->blockmax = (size + block_size - 1) / block_size;
+ 375 3691209 : file->mtime_sec = mtime_sec;
+ 376 3691209 : file->mtime_nsec = mtime_nsec;
+ 377 3691209 : file->inode = inode;
+ 378 3691209 : file->physical = physical;
+ 379 3691209 : file->flag = 0;
+ 380 3691209 : file->blockvec = malloc_nofail(file->blockmax * block_sizeof());
381 :
- 382 12811625 : for (i = 0; i < file->blockmax; ++i) {
- 383 9120220 : struct snapraid_block* block = file_block(file, i);
- 384 9120220 : block_state_set(block, BLOCK_STATE_CHG);
- 385 9120220 : hash_invalid_set(block->hash);
+ 382 12810920 : for (i = 0; i < file->blockmax; ++i) {
+ 383 9119711 : struct snapraid_block* block = file_block(file, i);
+ 384 9119711 : block_state_set(block, BLOCK_STATE_CHG);
+ 385 9119711 : hash_invalid_set(block->hash);
386 : }
387 :
- 388 3691405 : return file;
+ 388 3691209 : return file;
389 : }
390 :
391 22680 : struct snapraid_file* file_dup(struct snapraid_file* copy)
@@ -476,14 +476,14 @@
414 22680 : return file;
415 : }
416 :
- 417 3543810 : void file_free(struct snapraid_file* file)
+ 417 3543765 : void file_free(struct snapraid_file* file)
418 : {
- 419 3543810 : free(file->sub);
- 420 3543810 : file->sub = 0;
- 421 3543810 : free(file->blockvec);
- 422 3543810 : file->blockvec = 0;
- 423 3543810 : free(file);
- 424 3543810 : }
+ 419 3543765 : free(file->sub);
+ 420 3543765 : file->sub = 0;
+ 421 3543765 : free(file->blockvec);
+ 422 3543765 : file->blockvec = 0;
+ 423 3543765 : free(file);
+ 424 3543765 : }
425 :
426 155 : void file_rename(struct snapraid_file* file, const char* sub)
427 : {
@@ -527,31 +527,31 @@
465 23636 : file_flag_set(dst_file, FILE_IS_COPY);
466 23636 : }
467 :
- 468 47958 : const char* file_name(const struct snapraid_file* file)
+ 468 47954 : const char* file_name(const struct snapraid_file* file)
469 : {
- 470 47958 : const char* r = strrchr(file->sub, '/');
+ 470 47954 : const char* r = strrchr(file->sub, '/');
471 :
- 472 47958 : if (!r)
+ 472 47954 : if (!r)
473 78 : r = file->sub;
474 : else
- 475 47880 : ++r;
- 476 47958 : return r;
+ 475 47876 : ++r;
+ 476 47954 : return r;
477 : }
478 :
- 479 6823546 : unsigned file_block_size(struct snapraid_file* file, block_off_t file_pos, unsigned block_size)
+ 479 6823060 : unsigned file_block_size(struct snapraid_file* file, block_off_t file_pos, unsigned block_size)
480 : {
481 : /* if it's the last block */
- 482 6823546 : if (file_pos + 1 == file->blockmax) {
+ 482 6823060 : if (file_pos + 1 == file->blockmax) {
483 : unsigned block_remainder;
- 484 2775648 : if (file->size == 0)
+ 484 2775047 : if (file->size == 0)
485 0 : return 0;
- 486 2775648 : block_remainder = file->size % block_size;
- 487 2775648 : if (block_remainder == 0)
- 488 3048 : block_remainder = block_size;
- 489 2775648 : return block_remainder;
+ 486 2775047 : block_remainder = file->size % block_size;
+ 487 2775047 : if (block_remainder == 0)
+ 488 3052 : block_remainder = block_size;
+ 489 2775047 : return block_remainder;
490 : }
491 :
- 492 4047898 : return block_size;
+ 492 4048013 : return block_size;
493 : }
494 :
495 5329167 : int file_block_is_last(struct snapraid_file* file, block_off_t file_pos)
@@ -569,16 +569,16 @@
507 5329167 : return file_pos == file->blockmax - 1;
508 : }
509 :
- 510 987121 : int file_inode_compare_to_arg(const void* void_arg, const void* void_data)
+ 510 987050 : int file_inode_compare_to_arg(const void* void_arg, const void* void_data)
511 : {
- 512 987121 : const uint64_t* arg = void_arg;
- 513 987121 : const struct snapraid_file* file = void_data;
+ 512 987050 : const uint64_t* arg = void_arg;
+ 513 987050 : const struct snapraid_file* file = void_data;
514 :
- 515 987121 : if (*arg < file->inode)
+ 515 987050 : if (*arg < file->inode)
516 0 : return -1;
- 517 987121 : if (*arg > file->inode)
+ 517 987050 : if (*arg > file->inode)
518 0 : return 1;
- 519 987121 : return 0;
+ 519 987050 : return 0;
520 : }
521 :
522 0 : int file_inode_compare(const void* void_a, const void* void_b)
@@ -593,42 +593,42 @@
531 0 : return 0;
532 : }
533 :
- 534 189479 : int file_path_compare(const void* void_a, const void* void_b)
+ 534 189434 : int file_path_compare(const void* void_a, const void* void_b)
535 : {
- 536 189479 : const struct snapraid_file* file_a = void_a;
- 537 189479 : const struct snapraid_file* file_b = void_b;
+ 536 189434 : const struct snapraid_file* file_a = void_a;
+ 537 189434 : const struct snapraid_file* file_b = void_b;
538 :
- 539 189479 : return strcmp(file_a->sub, file_b->sub);
+ 539 189434 : return strcmp(file_a->sub, file_b->sub);
540 : }
541 :
- 542 35166 : int file_physical_compare(const void* void_a, const void* void_b)
+ 542 63430 : int file_physical_compare(const void* void_a, const void* void_b)
543 : {
- 544 35166 : const struct snapraid_file* file_a = void_a;
- 545 35166 : const struct snapraid_file* file_b = void_b;
+ 544 63430 : const struct snapraid_file* file_a = void_a;
+ 545 63430 : const struct snapraid_file* file_b = void_b;
546 :
- 547 35166 : if (file_a->physical < file_b->physical)
- 548 25408 : return -1;
- 549 9758 : if (file_a->physical > file_b->physical)
- 550 9756 : return 1;
+ 547 63430 : if (file_a->physical < file_b->physical)
+ 548 38882 : return -1;
+ 549 24548 : if (file_a->physical > file_b->physical)
+ 550 24546 : return 1;
551 2 : return 0;
552 : }
553 :
- 554 97502 : int file_path_compare_to_arg(const void* void_arg, const void* void_data)
+ 554 97552 : int file_path_compare_to_arg(const void* void_arg, const void* void_data)
555 : {
- 556 97502 : const char* arg = void_arg;
- 557 97502 : const struct snapraid_file* file = void_data;
+ 556 97552 : const char* arg = void_arg;
+ 557 97552 : const struct snapraid_file* file = void_data;
558 :
- 559 97502 : return strcmp(arg, file->sub);
+ 559 97552 : return strcmp(arg, file->sub);
560 : }
561 :
- 562 23979 : int file_name_compare(const void* void_a, const void* void_b)
+ 562 23977 : int file_name_compare(const void* void_a, const void* void_b)
563 : {
- 564 23979 : const struct snapraid_file* file_a = void_a;
- 565 23979 : const struct snapraid_file* file_b = void_b;
- 566 23979 : const char* name_a = file_name(file_a);
- 567 23979 : const char* name_b = file_name(file_b);
+ 564 23977 : const struct snapraid_file* file_a = void_a;
+ 565 23977 : const struct snapraid_file* file_b = void_b;
+ 566 23977 : const char* name_a = file_name(file_a);
+ 567 23977 : const char* name_b = file_name(file_b);
568 :
- 569 23979 : return strcmp(name_a, name_b);
+ 569 23977 : return strcmp(name_a, name_b);
570 : }
571 :
572 23670 : int file_stamp_compare(const void* void_a, const void* void_b)
@@ -654,13 +654,13 @@
592 23670 : return 0;
593 : }
594 :
- 595 23979 : int file_namestamp_compare(const void* void_a, const void* void_b)
+ 595 23977 : int file_namestamp_compare(const void* void_a, const void* void_b)
596 : {
597 : int ret;
598 :
- 599 23979 : ret = file_name_compare(void_a, void_b);
- 600 23979 : if (ret != 0)
- 601 309 : return ret;
+ 599 23977 : ret = file_name_compare(void_a, void_b);
+ 600 23977 : if (ret != 0)
+ 601 307 : return ret;
602 :
603 23670 : return file_stamp_compare(void_a, void_b);
604 : }
@@ -676,66 +676,66 @@
614 0 : return file_stamp_compare(void_a, void_b);
615 : }
616 :
- 617 3735733 : struct snapraid_extent* extent_alloc(block_off_t parity_pos, struct snapraid_file* file, block_off_t file_pos, block_off_t count)
+ 617 3735492 : struct snapraid_extent* extent_alloc(block_off_t parity_pos, struct snapraid_file* file, block_off_t file_pos, block_off_t count)
618 : {
619 : struct snapraid_extent* extent;
620 :
- 621 3735733 : if (count == 0) {
+ 621 3735492 : if (count == 0) {
622 : /* LCOV_EXCL_START */
623 : log_fatal("Internal inconsistency when allocating empty extent for file '%s' at position '%u/%u'\n", file->sub, file_pos, file->blockmax);
624 : os_abort();
625 : /* LCOV_EXCL_STOP */
626 : }
- 627 3735733 : if (file_pos + count > file->blockmax) {
+ 627 3735492 : if (file_pos + count > file->blockmax) {
628 : /* LCOV_EXCL_START */
629 : log_fatal("Internal inconsistency when allocating overflowing extent for file '%s' at position '%u:%u/%u'\n", file->sub, file_pos, count, file->blockmax);
630 : os_abort();
631 : /* LCOV_EXCL_STOP */
632 : }
633 :
- 634 3735733 : extent = malloc_nofail(sizeof(struct snapraid_extent));
- 635 3735733 : extent->parity_pos = parity_pos;
- 636 3735733 : extent->file = file;
- 637 3735733 : extent->file_pos = file_pos;
- 638 3735733 : extent->count = count;
+ 634 3735492 : extent = malloc_nofail(sizeof(struct snapraid_extent));
+ 635 3735492 : extent->parity_pos = parity_pos;
+ 636 3735492 : extent->file = file;
+ 637 3735492 : extent->file_pos = file_pos;
+ 638 3735492 : extent->count = count;
639 :
- 640 3735733 : return extent;
+ 640 3735492 : return extent;
641 : }
642 :
- 643 3564894 : void extent_free(struct snapraid_extent* extent)
+ 643 3564805 : void extent_free(struct snapraid_extent* extent)
644 : {
- 645 3564894 : free(extent);
- 646 3564894 : }
+ 645 3564805 : free(extent);
+ 646 3564805 : }
647 :
- 648 44514357 : int extent_parity_compare(const void* void_a, const void* void_b)
+ 648 44511012 : int extent_parity_compare(const void* void_a, const void* void_b)
649 : {
- 650 44514357 : const struct snapraid_extent* arg_a = void_a;
- 651 44514357 : const struct snapraid_extent* arg_b = void_b;
+ 650 44511012 : const struct snapraid_extent* arg_a = void_a;
+ 651 44511012 : const struct snapraid_extent* arg_b = void_b;
652 :
- 653 44514357 : if (arg_a->parity_pos < arg_b->parity_pos)
- 654 960382 : return -1;
- 655 43553975 : if (arg_a->parity_pos > arg_b->parity_pos)
- 656 43514318 : return 1;
+ 653 44511012 : if (arg_a->parity_pos < arg_b->parity_pos)
+ 654 959727 : return -1;
+ 655 43551285 : if (arg_a->parity_pos > arg_b->parity_pos)
+ 656 43511675 : return 1;
657 :
- 658 39657 : return 0;
+ 658 39610 : return 0;
659 : }
660 :
- 661 45010276 : int extent_file_compare(const void* void_a, const void* void_b)
+ 661 45007856 : int extent_file_compare(const void* void_a, const void* void_b)
662 : {
- 663 45010276 : const struct snapraid_extent* arg_a = void_a;
- 664 45010276 : const struct snapraid_extent* arg_b = void_b;
+ 663 45007856 : const struct snapraid_extent* arg_a = void_a;
+ 664 45007856 : const struct snapraid_extent* arg_b = void_b;
665 :
- 666 45010276 : if (arg_a->file < arg_b->file)
- 667 869393 : return -1;
- 668 44140883 : if (arg_a->file > arg_b->file)
- 669 44070015 : return 1;
+ 666 45007856 : if (arg_a->file < arg_b->file)
+ 667 879576 : return -1;
+ 668 44128280 : if (arg_a->file > arg_b->file)
+ 669 44057503 : return 1;
670 :
- 671 70868 : if (arg_a->file_pos < arg_b->file_pos)
+ 671 70777 : if (arg_a->file_pos < arg_b->file_pos)
672 208 : return -1;
- 673 70660 : if (arg_a->file_pos > arg_b->file_pos)
- 674 31003 : return 1;
+ 673 70569 : if (arg_a->file_pos > arg_b->file_pos)
+ 674 30959 : return 1;
675 :
- 676 39657 : return 0;
+ 676 39610 : return 0;
677 : }
678 :
679 119522 : struct snapraid_link* link_alloc(const char* sub, const char* linkto, unsigned link_flag)
@@ -864,23 +864,23 @@
802 1453 : free(disk);
803 1453 : }
804 :
- 805 53196997 : static inline void fs_lock(struct snapraid_disk* disk)
+ 805 53194369 : static inline void fs_lock(struct snapraid_disk* disk)
806 : {
807 : #if HAVE_PTHREAD
- 808 53196997 : thread_mutex_lock(&disk->fs_mutex);
+ 808 53194369 : thread_mutex_lock(&disk->fs_mutex);
809 : #else
810 : (void)disk;
811 : #endif
- 812 53197354 : }
+ 812 53194899 : }
813 :
- 814 53196517 : static inline void fs_unlock(struct snapraid_disk* disk)
+ 814 53193869 : static inline void fs_unlock(struct snapraid_disk* disk)
815 : {
816 : #if HAVE_PTHREAD
- 817 53196517 : thread_mutex_unlock(&disk->fs_mutex);
+ 817 53193869 : thread_mutex_unlock(&disk->fs_mutex);
818 : #else
819 : (void)disk;
820 : #endif
- 821 53197458 : }
+ 821 53194703 : }
822 :
823 : struct extent_disk_empty {
824 : block_off_t blockmax;
@@ -937,17 +937,17 @@
875 : *
876 : * The maximum parity position is stored as size.
877 : */
- 878 50477 : static int extent_disk_size_compare_unlock(const void* void_a, const void* void_b)
+ 878 50483 : static int extent_disk_size_compare_unlock(const void* void_a, const void* void_b)
879 : {
- 880 50477 : struct extent_disk_size* arg_a = (void*)void_a;
- 881 50477 : const struct snapraid_extent* arg_b = void_b;
+ 880 50483 : struct extent_disk_size* arg_a = (void*)void_a;
+ 881 50483 : const struct snapraid_extent* arg_b = void_b;
882 :
883 : /* get the maximum size */
- 884 50477 : if (arg_a->size < arg_b->parity_pos + arg_b->count)
- 885 50477 : arg_a->size = arg_b->parity_pos + arg_b->count;
+ 884 50483 : if (arg_a->size < arg_b->parity_pos + arg_b->count)
+ 885 50483 : arg_a->size = arg_b->parity_pos + arg_b->count;
886 :
887 : /* search always for a bigger one */
- 888 50477 : return 1;
+ 888 50483 : return 1;
889 : }
890 :
891 4339 : block_off_t fs_size(struct snapraid_disk* disk)
@@ -968,23 +968,23 @@
906 : int result;
907 : };
908 :
- 909 6584521 : static void extent_parity_check_foreach_unlock(void* void_arg, void* void_obj)
+ 909 6584437 : static void extent_parity_check_foreach_unlock(void* void_arg, void* void_obj)
910 : {
- 911 6584521 : struct extent_check* arg = void_arg;
- 912 6584521 : const struct snapraid_extent* obj = void_obj;
- 913 6584521 : const struct snapraid_extent* prev = arg->prev;
+ 911 6584437 : struct extent_check* arg = void_arg;
+ 912 6584437 : const struct snapraid_extent* obj = void_obj;
+ 913 6584437 : const struct snapraid_extent* prev = arg->prev;
914 :
915 : /* set the next previous block */
- 916 6584521 : arg->prev = obj;
+ 916 6584437 : arg->prev = obj;
917 :
918 : /* stop reporting if too many errors */
- 919 6584521 : if (arg->result > 100) {
+ 919 6584437 : if (arg->result > 100) {
920 : /* LCOV_EXCL_START */
921 : return;
922 : /* LCOV_EXCL_STOP */
923 : }
924 :
- 925 6584521 : if (obj->count == 0) {
+ 925 6584437 : if (obj->count == 0) {
926 : /* LCOV_EXCL_START */
927 : log_fatal("Internal inconsistency in parity count zero for file '%s' at '%u'\n",
928 : obj->file->sub, obj->parity_pos);
@@ -994,11 +994,11 @@
932 : }
933 :
934 : /* check only if there is a previous block */
- 935 6584521 : if (!prev)
+ 935 6584437 : if (!prev)
936 2708 : return;
937 :
938 : /* check the order */
- 939 6581813 : if (prev->parity_pos >= obj->parity_pos) {
+ 939 6581729 : if (prev->parity_pos >= obj->parity_pos) {
940 : /* LCOV_EXCL_START */
941 : log_fatal("Internal inconsistency in parity order for files '%s' at '%u:%u' and '%s' at '%u:%u'\n",
942 : prev->file->sub, prev->parity_pos, prev->count, obj->file->sub, obj->parity_pos, obj->count);
@@ -1008,7 +1008,7 @@
946 : }
947 :
948 : /* check that the extents don't overlap */
- 949 6581813 : if (prev->parity_pos + prev->count > obj->parity_pos) {
+ 949 6581729 : if (prev->parity_pos + prev->count > obj->parity_pos) {
950 : /* LCOV_EXCL_START */
951 : log_fatal("Internal inconsistency for parity overlap for files '%s' at '%u:%u' and '%s' at '%u:%u'\n",
952 : prev->file->sub, prev->parity_pos, prev->count, obj->file->sub, obj->parity_pos, obj->count);
@@ -1018,23 +1018,23 @@
956 : }
957 : }
958 :
- 959 6584521 : static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
+ 959 6584437 : static void extent_file_check_foreach_unlock(void* void_arg, void* void_obj)
960 : {
- 961 6584521 : struct extent_check* arg = void_arg;
- 962 6584521 : const struct snapraid_extent* obj = void_obj;
- 963 6584521 : const struct snapraid_extent* prev = arg->prev;
+ 961 6584437 : struct extent_check* arg = void_arg;
+ 962 6584437 : const struct snapraid_extent* obj = void_obj;
+ 963 6584437 : const struct snapraid_extent* prev = arg->prev;
964 :
965 : /* set the next previous block */
- 966 6584521 : arg->prev = obj;
+ 966 6584437 : arg->prev = obj;
967 :
968 : /* stop reporting if too many errors */
- 969 6584521 : if (arg->result > 100) {
+ 969 6584437 : if (arg->result > 100) {
970 : /* LCOV_EXCL_START */
971 : return;
972 : /* LCOV_EXCL_STOP */
973 : }
974 :
- 975 6584521 : if (obj->count == 0) {
+ 975 6584437 : if (obj->count == 0) {
976 : /* LCOV_EXCL_START */
977 : log_fatal("Internal inconsistency in file count zero for file '%s' at '%u'\n",
978 : obj->file->sub, obj->file_pos);
@@ -1046,7 +1046,7 @@
984 : /* note that for deleted files, some extents may be missing */
985 :
986 : /* if the files are different */
- 987 6584521 : if (!prev || prev->file != obj->file) {
+ 987 6584437 : if (!prev || prev->file != obj->file) {
988 6538233 : if (prev != 0) {
989 6535525 : if (file_flag_has(prev->file, FILE_IS_DELETED)) {
990 : /* check that the extent doesn't overflow the file */
@@ -1094,7 +1094,7 @@
1032 : }
1033 : } else {
1034 : /* check the order */
- 1035 46288 : if (prev->file_pos >= obj->file_pos) {
+ 1035 46204 : if (prev->file_pos >= obj->file_pos) {
1036 : /* LCOV_EXCL_START */
1037 : log_fatal("Internal inconsistency in file order for file '%s' at '%u:%u' and at '%u:%u'\n",
1038 : prev->file->sub, prev->file_pos, prev->count, obj->file_pos, obj->count);
@@ -1103,7 +1103,7 @@
1041 : /* LCOV_EXCL_STOP */
1042 : }
1043 :
- 1044 46288 : if (file_flag_has(obj->file, FILE_IS_DELETED)) {
+ 1044 46204 : if (file_flag_has(obj->file, FILE_IS_DELETED)) {
1045 : /* check that the extents don't overlap */
1046 27 : if (prev->file_pos + prev->count > obj->file_pos) {
1047 : /* LCOV_EXCL_START */
@@ -1115,7 +1115,7 @@
1053 : }
1054 : } else {
1055 : /* check that the extents are sequential */
- 1056 46261 : if (prev->file_pos + prev->count != obj->file_pos) {
+ 1056 46177 : if (prev->file_pos + prev->count != obj->file_pos) {
1057 : /* LCOV_EXCL_START */
1058 : log_fatal("Internal inconsistency in file sequence for file '%s' at '%u:%u' and at '%u:%u'\n",
1059 : prev->file->sub, prev->file_pos, prev->count, obj->file_pos, obj->count);
@@ -1159,17 +1159,17 @@
1097 : /**
1098 : * Compare the extent if containing the specified parity position.
1099 : */
- 1100 114112918 : static int extent_parity_inside_compare_unlock(const void* void_a, const void* void_b)
+ 1100 113816358 : static int extent_parity_inside_compare_unlock(const void* void_a, const void* void_b)
1101 : {
- 1102 114112918 : const struct extent_parity_inside* arg_a = void_a;
- 1103 114112918 : const struct snapraid_extent* arg_b = void_b;
+ 1102 113816358 : const struct extent_parity_inside* arg_a = void_a;
+ 1103 113816358 : const struct snapraid_extent* arg_b = void_b;
1104 :
- 1105 114112918 : if (arg_a->parity_pos < arg_b->parity_pos)
- 1106 40359187 : return -1;
- 1107 73753731 : if (arg_a->parity_pos >= arg_b->parity_pos + arg_b->count)
- 1108 65013840 : return 1;
+ 1105 113816358 : if (arg_a->parity_pos < arg_b->parity_pos)
+ 1106 40236710 : return -1;
+ 1107 73579648 : if (arg_a->parity_pos >= arg_b->parity_pos + arg_b->count)
+ 1108 64869306 : return 1;
1109 :
- 1110 8739891 : return 0;
+ 1110 8710342 : return 0;
1111 : }
1112 :
1113 : /**
@@ -1177,28 +1177,28 @@
1115 : * The search is optimized for sequential accesses.
1116 : * \return If not found return 0
1117 : */
- 1118 39144190 : static struct snapraid_extent* fs_par2extent_get_unlock(struct snapraid_disk* disk, struct snapraid_extent** fs_last, block_off_t parity_pos)
+ 1118 39142093 : static struct snapraid_extent* fs_par2extent_get_unlock(struct snapraid_disk* disk, struct snapraid_extent** fs_last, block_off_t parity_pos)
1119 : {
1120 : struct snapraid_extent* extent;
1121 :
1122 : /* check if the last accessed extent matches */
- 1123 39144190 : if (*fs_last
- 1124 39125793 : && parity_pos >= (*fs_last)->parity_pos
- 1125 38379285 : && parity_pos < (*fs_last)->parity_pos + (*fs_last)->count
+ 1123 39142093 : if (*fs_last
+ 1124 39123712 : && parity_pos >= (*fs_last)->parity_pos
+ 1125 38405576 : && parity_pos < (*fs_last)->parity_pos + (*fs_last)->count
1126 : ) {
- 1127 28820135 : extent = *fs_last;
+ 1127 28847581 : extent = *fs_last;
1128 : } else {
- 1129 10324055 : struct extent_parity_inside arg = { parity_pos };
- 1130 10324055 : extent = tommy_tree_search_compare(&disk->fs_parity, extent_parity_inside_compare_unlock, &arg);
+ 1129 10294512 : struct extent_parity_inside arg = { parity_pos };
+ 1130 10294512 : extent = tommy_tree_search_compare(&disk->fs_parity, extent_parity_inside_compare_unlock, &arg);
1131 : }
1132 :
- 1133 39144121 : if (!extent)
- 1134 1584196 : return 0;
+ 1133 39141955 : if (!extent)
+ 1134 1584132 : return 0;
1135 :
1136 : /* store the last accessed extent */
- 1137 37559925 : *fs_last = extent;
+ 1137 37557823 : *fs_last = extent;
1138 :
- 1139 37559925 : return extent;
+ 1139 37557823 : return extent;
1140 : }
1141 :
1142 : struct extent_file_inside {
@@ -1209,22 +1209,22 @@
1147 : /**
1148 : * Compare the extent if containing the specified file position.
1149 : */
- 1150 21311558 : static int extent_file_inside_compare_unlock(const void* void_a, const void* void_b)
+ 1150 21314053 : static int extent_file_inside_compare_unlock(const void* void_a, const void* void_b)
1151 : {
- 1152 21311558 : const struct extent_file_inside* arg_a = void_a;
- 1153 21311558 : const struct snapraid_extent* arg_b = void_b;
+ 1152 21314053 : const struct extent_file_inside* arg_a = void_a;
+ 1153 21314053 : const struct snapraid_extent* arg_b = void_b;
1154 :
- 1155 21311558 : if (arg_a->file < arg_b->file)
- 1156 8886305 : return -1;
- 1157 12425253 : if (arg_a->file > arg_b->file)
- 1158 10405427 : return 1;
+ 1155 21314053 : if (arg_a->file < arg_b->file)
+ 1156 8882877 : return -1;
+ 1157 12431176 : if (arg_a->file > arg_b->file)
+ 1158 10411547 : return 1;
1159 :
- 1160 2019826 : if (arg_a->file_pos < arg_b->file_pos)
- 1161 8348 : return -1;
- 1162 2011478 : if (arg_a->file_pos >= arg_b->file_pos + arg_b->count)
- 1163 8013 : return 1;
+ 1160 2019629 : if (arg_a->file_pos < arg_b->file_pos)
+ 1161 8339 : return -1;
+ 1162 2011290 : if (arg_a->file_pos >= arg_b->file_pos + arg_b->count)
+ 1163 7952 : return 1;
1164 :
- 1165 2003465 : return 0;
+ 1165 2003338 : return 0;
1166 : }
1167 :
1168 : /**
@@ -1232,88 +1232,88 @@
1170 : * The search is optimized for sequential accesses.
1171 : * \return If not found return 0
1172 : */
- 1173 10336534 : static struct snapraid_extent* fs_file2extent_get_unlock(struct snapraid_disk* disk, struct snapraid_extent** fs_last, struct snapraid_file* file, block_off_t file_pos)
+ 1173 10336325 : static struct snapraid_extent* fs_file2extent_get_unlock(struct snapraid_disk* disk, struct snapraid_extent** fs_last, struct snapraid_file* file, block_off_t file_pos)
1174 : {
1175 : struct snapraid_extent* extent;
1176 :
1177 : /* check if the last accessed extent matches */
- 1178 10336534 : if (*fs_last
- 1179 10312854 : && file == (*fs_last)->file
- 1180 8347340 : && file_pos >= (*fs_last)->file_pos
- 1181 8347340 : && file_pos < (*fs_last)->file_pos + (*fs_last)->count
+ 1178 10336325 : if (*fs_last
+ 1179 10312676 : && file == (*fs_last)->file
+ 1180 8347214 : && file_pos >= (*fs_last)->file_pos
+ 1181 8347214 : && file_pos < (*fs_last)->file_pos + (*fs_last)->count
1182 : ) {
- 1183 8333061 : extent = *fs_last;
+ 1183 8332979 : extent = *fs_last;
1184 : } else {
- 1185 2003473 : struct extent_file_inside arg = { file, file_pos };
- 1186 2003473 : extent = tommy_tree_search_compare(&disk->fs_file, extent_file_inside_compare_unlock, &arg);
+ 1185 2003346 : struct extent_file_inside arg = { file, file_pos };
+ 1186 2003346 : extent = tommy_tree_search_compare(&disk->fs_file, extent_file_inside_compare_unlock, &arg);
1187 : }
1188 :
- 1189 10336534 : if (!extent)
+ 1189 10336325 : if (!extent)
1190 8 : return 0;
1191 :
1192 : /* store the last accessed extent */
- 1193 10336526 : *fs_last = extent;
+ 1193 10336317 : *fs_last = extent;
1194 :
- 1195 10336526 : return extent;
+ 1195 10336317 : return extent;
1196 : }
1197 :
- 1198 39037624 : struct snapraid_file* fs_par2file_find(struct snapraid_disk* disk, block_off_t parity_pos, block_off_t* file_pos)
+ 1198 39035232 : struct snapraid_file* fs_par2file_find(struct snapraid_disk* disk, block_off_t parity_pos, block_off_t* file_pos)
1199 : {
1200 : struct snapraid_extent* extent;
1201 : struct snapraid_file* file;
1202 :
- 1203 39037624 : fs_lock(disk);
+ 1203 39035232 : fs_lock(disk);
1204 :
- 1205 39038326 : extent = fs_par2extent_get_unlock(disk, &disk->fs_last, parity_pos);
+ 1205 39036374 : extent = fs_par2extent_get_unlock(disk, &disk->fs_last, parity_pos);
1206 :
- 1207 39037565 : if (!extent) {
- 1208 1584197 : fs_unlock(disk);
- 1209 1584213 : return 0;
+ 1207 39035521 : if (!extent) {
+ 1208 1584134 : fs_unlock(disk);
+ 1209 1584150 : return 0;
1210 : }
1211 :
- 1212 37453368 : if (file_pos)
- 1213 37108689 : *file_pos = extent->file_pos + (parity_pos - extent->parity_pos);
+ 1212 37451387 : if (file_pos)
+ 1213 37106669 : *file_pos = extent->file_pos + (parity_pos - extent->parity_pos);
1214 :
- 1215 37453368 : file = extent->file;
+ 1215 37451387 : file = extent->file;
1216 :
- 1217 37453368 : fs_unlock(disk);
- 1218 37454144 : return file;
+ 1217 37451387 : fs_unlock(disk);
+ 1218 37452141 : return file;
1219 : }
1220 :
- 1221 4869430 : block_off_t fs_file2par_find(struct snapraid_disk* disk, struct snapraid_file* file, block_off_t file_pos)
+ 1221 4869535 : block_off_t fs_file2par_find(struct snapraid_disk* disk, struct snapraid_file* file, block_off_t file_pos)
1222 : {
1223 : struct snapraid_extent* extent;
1224 : block_off_t ret;
1225 :
- 1226 4869430 : fs_lock(disk);
+ 1226 4869535 : fs_lock(disk);
1227 :
- 1228 4869430 : extent = fs_file2extent_get_unlock(disk, &disk->fs_last, file, file_pos);
- 1229 4869430 : if (!extent) {
+ 1228 4869535 : extent = fs_file2extent_get_unlock(disk, &disk->fs_last, file, file_pos);
+ 1229 4869535 : if (!extent) {
1230 8 : fs_unlock(disk);
1231 8 : return POS_NULL;
1232 : }
1233 :
- 1234 4869422 : ret = extent->parity_pos + (file_pos - extent->file_pos);
+ 1234 4869527 : ret = extent->parity_pos + (file_pos - extent->file_pos);
1235 :
- 1236 4869422 : fs_unlock(disk);
- 1237 4869422 : return ret;
+ 1236 4869527 : fs_unlock(disk);
+ 1237 4869527 : return ret;
1238 : }
1239 :
- 1240 9176132 : void fs_allocate(struct snapraid_disk* disk, block_off_t parity_pos, struct snapraid_file* file, block_off_t file_pos)
+ 1240 9175619 : void fs_allocate(struct snapraid_disk* disk, block_off_t parity_pos, struct snapraid_file* file, block_off_t file_pos)
1241 : {
1242 : struct snapraid_extent* extent;
1243 : struct snapraid_extent* parity_extent;
1244 : struct snapraid_extent* file_extent;
1245 :
- 1246 9176132 : fs_lock(disk);
+ 1246 9175619 : fs_lock(disk);
1247 :
- 1248 9176132 : if (file_pos > 0) {
+ 1248 9175619 : if (file_pos > 0) {
1249 : /* search an existing extent for the previous file_pos */
- 1250 5467104 : extent = fs_file2extent_get_unlock(disk, &disk->fs_last, file, file_pos - 1);
+ 1250 5466790 : extent = fs_file2extent_get_unlock(disk, &disk->fs_last, file, file_pos - 1);
1251 :
- 1252 5467104 : if (extent != 0 && parity_pos == extent->parity_pos + extent->count) {
+ 1252 5466790 : if (extent != 0 && parity_pos == extent->parity_pos + extent->count) {
1253 : /* ensure that we are extending the extent at the end */
- 1254 5440400 : if (file_pos != extent->file_pos + extent->count) {
+ 1254 5440128 : if (file_pos != extent->file_pos + extent->count) {
1255 : /* LCOV_EXCL_START */
1256 : log_fatal("Internal inconsistency when allocating file '%s' at position '%u/%u' in the middle of extent '%u:%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, extent->file_pos, extent->count, disk->name);
1257 : os_abort();
@@ -1321,21 +1321,21 @@
1259 : }
1260 :
1261 : /* extend the existing extent */
- 1262 5440400 : ++extent->count;
+ 1262 5440128 : ++extent->count;
1263 :
- 1264 5440400 : fs_unlock(disk);
- 1265 14616532 : return;
+ 1264 5440128 : fs_unlock(disk);
+ 1265 14615747 : return;
1266 : }
1267 : }
1268 :
1269 : /* a extent doesn't exist, and we have to create a new one */
- 1270 3735732 : extent = extent_alloc(parity_pos, file, file_pos, 1);
+ 1270 3735491 : extent = extent_alloc(parity_pos, file, file_pos, 1);
1271 :
1272 : /* insert the extent in the trees */
- 1273 3735732 : parity_extent = tommy_tree_insert(&disk->fs_parity, &extent->parity_node, extent);
- 1274 3735732 : file_extent = tommy_tree_insert(&disk->fs_file, &extent->file_node, extent);
+ 1273 3735491 : parity_extent = tommy_tree_insert(&disk->fs_parity, &extent->parity_node, extent);
+ 1274 3735491 : file_extent = tommy_tree_insert(&disk->fs_file, &extent->file_node, extent);
1275 :
- 1276 3735732 : if (parity_extent != extent || file_extent != extent) {
+ 1276 3735491 : if (parity_extent != extent || file_extent != extent) {
1277 : /* LCOV_EXCL_START */
1278 : log_fatal("Internal inconsistency when allocating file '%s' at position '%u/%u' for existing extent '%u:%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, extent->file_pos, extent->count, disk->name);
1279 : os_abort();
@@ -1343,12 +1343,12 @@
1281 : }
1282 :
1283 : /* store the last accessed extent */
- 1284 3735732 : disk->fs_last = extent;
+ 1284 3735491 : disk->fs_last = extent;
1285 :
- 1286 3735732 : fs_unlock(disk);
+ 1286 3735491 : fs_unlock(disk);
1287 : }
1288 :
- 1289 106256 : void fs_deallocate(struct snapraid_disk* disk, block_off_t parity_pos)
+ 1289 106126 : void fs_deallocate(struct snapraid_disk* disk, block_off_t parity_pos)
1290 : {
1291 : struct snapraid_extent* extent;
1292 : struct snapraid_extent* second_extent;
@@ -1356,10 +1356,10 @@
1294 : struct snapraid_extent* file_extent;
1295 : block_off_t first_count, second_count;
1296 :
- 1297 106256 : fs_lock(disk);
+ 1297 106126 : fs_lock(disk);
1298 :
- 1299 106256 : extent = fs_par2extent_get_unlock(disk, &disk->fs_last, parity_pos);
- 1300 106256 : if (!extent) {
+ 1299 106126 : extent = fs_par2extent_get_unlock(disk, &disk->fs_last, parity_pos);
+ 1300 106126 : if (!extent) {
1301 : /* LCOV_EXCL_START */
1302 : log_fatal("Internal inconsistency when deallocating parity position '%u' for not existing extent in disk '%s'\n", parity_pos, disk->name);
1303 : os_abort();
@@ -1367,29 +1367,29 @@
1305 : }
1306 :
1307 : /* if it's the only block of the extent, delete it */
- 1308 106256 : if (extent->count == 1) {
+ 1308 106126 : if (extent->count == 1) {
1309 : /* remove from the trees */
- 1310 39657 : tommy_tree_remove(&disk->fs_parity, extent);
- 1311 39657 : tommy_tree_remove(&disk->fs_file, extent);
+ 1310 39610 : tommy_tree_remove(&disk->fs_parity, extent);
+ 1311 39610 : tommy_tree_remove(&disk->fs_file, extent);
1312 :
1313 : /* deallocate */
- 1314 39657 : extent_free(extent);
+ 1314 39610 : extent_free(extent);
1315 :
1316 : /* clear the last accessed extent */
- 1317 39657 : disk->fs_last = 0;
+ 1317 39610 : disk->fs_last = 0;
1318 :
- 1319 39657 : fs_unlock(disk);
- 1320 39657 : return;
+ 1319 39610 : fs_unlock(disk);
+ 1320 39610 : return;
1321 : }
1322 :
1323 : /* if it's at the start of the extent, shrink the extent */
- 1324 66599 : if (parity_pos == extent->parity_pos) {
- 1325 66597 : ++extent->parity_pos;
- 1326 66597 : ++extent->file_pos;
- 1327 66597 : --extent->count;
+ 1324 66516 : if (parity_pos == extent->parity_pos) {
+ 1325 66514 : ++extent->parity_pos;
+ 1326 66514 : ++extent->file_pos;
+ 1327 66514 : --extent->count;
1328 :
- 1329 66597 : fs_unlock(disk);
- 1330 66597 : return;
+ 1329 66514 : fs_unlock(disk);
+ 1330 66514 : return;
1331 : }
1332 :
1333 : /* if it's at the end of the extent, shrink the extent */
@@ -1427,28 +1427,28 @@
1365 1 : fs_unlock(disk);
1366 : }
1367 :
- 1368 44947073 : struct snapraid_block* fs_file2block_get(struct snapraid_file* file, block_off_t file_pos)
+ 1368 44945080 : struct snapraid_block* fs_file2block_get(struct snapraid_file* file, block_off_t file_pos)
1369 : {
- 1370 44947073 : if (file_pos >= file->blockmax) {
+ 1370 44945080 : if (file_pos >= file->blockmax) {
1371 : /* LCOV_EXCL_START */
1372 : log_fatal("Internal inconsistency when dereferencing file '%s' at position '%u/%u'\n", file->sub, file_pos, file->blockmax);
1373 : os_abort();
1374 : /* LCOV_EXCL_STOP */
1375 : }
1376 :
- 1377 44947073 : return file_block(file, file_pos);
+ 1377 44945080 : return file_block(file, file_pos);
1378 : }
1379 :
- 1380 27313808 : struct snapraid_block* fs_par2block_find(struct snapraid_disk* disk, block_off_t parity_pos)
+ 1380 27312315 : struct snapraid_block* fs_par2block_find(struct snapraid_disk* disk, block_off_t parity_pos)
1381 : {
1382 : struct snapraid_file* file;
1383 : block_off_t file_pos;
1384 :
- 1385 27313808 : file = fs_par2file_find(disk, parity_pos, &file_pos);
- 1386 27314021 : if (file == 0)
- 1387 1584214 : return BLOCK_NULL;
+ 1385 27312315 : file = fs_par2file_find(disk, parity_pos, &file_pos);
+ 1386 27312544 : if (file == 0)
+ 1387 1584149 : return BLOCK_NULL;
1388 :
- 1389 25729807 : return fs_file2block_get(file, file_pos);
+ 1389 25728395 : return fs_file2block_get(file, file_pos);
1390 : }
1391 :
1392 1549 : struct snapraid_map* map_alloc(const char* name, unsigned position, block_off_t total_blocks, block_off_t free_blocks, const char* uuid)
@@ -1470,16 +1470,16 @@
1408 1429 : free(map);
1409 1429 : }
1410 :
- 1411 683554 : int time_compare(const void* void_a, const void* void_b)
+ 1411 684987 : int time_compare(const void* void_a, const void* void_b)
1412 : {
- 1413 683554 : const time_t* time_a = void_a;
- 1414 683554 : const time_t* time_b = void_b;
+ 1413 684987 : const time_t* time_a = void_a;
+ 1414 684987 : const time_t* time_b = void_b;
1415 :
- 1416 683554 : if (*time_a < *time_b)
- 1417 11358 : return -1;
- 1418 672196 : if (*time_a > *time_b)
- 1419 119633 : return 1;
- 1420 552563 : return 0;
+ 1416 684987 : if (*time_a < *time_b)
+ 1417 16532 : return -1;
+ 1418 668455 : if (*time_a > *time_b)
+ 1419 119824 : return 1;
+ 1420 548631 : return 0;
1421 : }
1422 :
1423 : /****************************************************************************/
@@ -1499,14 +1499,14 @@
1437 : /**
1438 : * Format a path name for terminal reference
1439 : */
- 1440 355785 : const char* fmt_term(const struct snapraid_disk* disk, const char* str, char* buffer)
+ 1440 356004 : const char* fmt_term(const struct snapraid_disk* disk, const char* str, char* buffer)
1441 : {
1442 : const char* out[3];
1443 :
- 1444 355785 : switch (FMT_MODE) {
+ 1444 356004 : switch (FMT_MODE) {
1445 : case FMT_FILE :
1446 : default :
- 1447 331725 : return esc_shell(str, buffer);
+ 1447 331944 : return esc_shell(str, buffer);
1448 : case FMT_DISK :
1449 12030 : out[0] = disk->name;
1450 12030 : out[1] = ":";
diff --git a/cov/cmdline/elem.h.func-sort-c.html b/cov/cmdline/elem.h.func-sort-c.html
index fad43e65..6462c4b2 100644
--- a/cov/cmdline/elem.h.func-sort-c.html
+++ b/cov/cmdline/elem.h.func-sort-c.html
@@ -61,99 +61,99 @@
| block_sizeof |
- 58067981 |
+ 58065323 |
| file_block |
- 54353544 |
+ 54351240 |
| block_state_get |
- 52305148 |
+ 52304798 |
| file_flag_has |
- 34094875 |
+ 34094547 |
| block_state_set |
- 19119503 |
+ 19117787 |
| block_has_file |
- 14591698 |
+ 14590544 |
| block_has_invalid_parity |
- 12320608 |
+ 12320061 |
| fs_par2file_get |
- 11724320 |
+ 11723736 |
| hash_invalid_set |
- 9234981 |
+ 9234472 |
| file_stamp_hash |
- 6275777 |
+ 6275914 |
| file_flag_set |
- 5299884 |
+ 5301349 |
| info_get |
- 5093871 |
+ 5098374 |
| file_inode_hash |
- 5047944 |
+ 5047846 |
| fs_file2par_get |
- 4755275 |
+ 4755380 |
| file_path_hash |
- 3886220 |
+ 3886074 |
| filter_hidden |
- 3173426 |
+ 3173124 |
| block_has_past_hash |
- 2543126 |
+ 2542743 |
| block_has_updated_hash |
- 2216978 |
+ 2217692 |
| info_get_rehash |
- 2042164 |
+ 2046653 |
| info_set |
- 1698035 |
+ 1697965 |
| info_get_time |
- 878516 |
+ 883104 |
| hash_is_zero |
- 759899 |
+ 760617 |
| hash_is_invalid |
- 758437 |
+ 759156 |
| info_get_bad |
- 347310 |
+ 351943 |
| block_has_file_and_valid_parity |
@@ -165,7 +165,7 @@
| info_make |
- 183427 |
+ 194583 |
| link_name_hash |
@@ -181,11 +181,11 @@
| info_get_justsynced |
- 63947 |
+ 68535 |
| hash_is_unique |
- 44326 |
+ 44219 |
| link_flag_set |
@@ -193,7 +193,7 @@
| file_flag_clear |
- 16752 |
+ 16739 |
| fs_par2block_get |
diff --git a/cov/cmdline/elem.h.func.html b/cov/cmdline/elem.h.func.html
index 344b36da..db662b11 100644
--- a/cov/cmdline/elem.h.func.html
+++ b/cov/cmdline/elem.h.func.html
@@ -61,7 +61,7 @@
| block_has_file |
- 14591698 |
+ 14590544 |
| block_has_file_and_valid_parity |
@@ -69,27 +69,27 @@
| block_has_invalid_parity |
- 12320608 |
+ 12320061 |
| block_has_past_hash |
- 2543126 |
+ 2542743 |
| block_has_updated_hash |
- 2216978 |
+ 2217692 |
| block_sizeof |
- 58067981 |
+ 58065323 |
| block_state_get |
- 52305148 |
+ 52304798 |
| block_state_set |
- 19119503 |
+ 19117787 |
| dir_flag_has |
@@ -105,39 +105,39 @@
| file_block |
- 54353544 |
+ 54351240 |
| file_flag_clear |
- 16752 |
+ 16739 |
| file_flag_has |
- 34094875 |
+ 34094547 |
| file_flag_set |
- 5299884 |
+ 5301349 |
| file_inode_hash |
- 5047944 |
+ 5047846 |
| file_path_hash |
- 3886220 |
+ 3886074 |
| file_stamp_hash |
- 6275777 |
+ 6275914 |
| filter_hidden |
- 3173426 |
+ 3173124 |
| fs_file2par_get |
- 4755275 |
+ 4755380 |
| fs_par2block_get |
@@ -145,23 +145,23 @@
| fs_par2file_get |
- 11724320 |
+ 11723736 |
| hash_invalid_set |
- 9234981 |
+ 9234472 |
| hash_is_invalid |
- 758437 |
+ 759156 |
| hash_is_unique |
- 44326 |
+ 44219 |
| hash_is_zero |
- 759899 |
+ 760617 |
| hash_zero_set |
@@ -169,31 +169,31 @@
| info_get |
- 5093871 |
+ 5098374 |
| info_get_bad |
- 347310 |
+ 351943 |
| info_get_justsynced |
- 63947 |
+ 68535 |
| info_get_rehash |
- 2042164 |
+ 2046653 |
| info_get_time |
- 878516 |
+ 883104 |
| info_make |
- 183427 |
+ 194583 |
| info_set |
- 1698035 |
+ 1697965 |
| info_set_bad |
diff --git a/cov/cmdline/elem.h.gcov.html b/cov/cmdline/elem.h.gcov.html
index 052b2bf7..724a4396 100644
--- a/cov/cmdline/elem.h.gcov.html
+++ b/cov/cmdline/elem.h.gcov.html
@@ -571,13 +571,13 @@
509 : * Filter hidden files.
510 : * Return !=0 if it matches and it should be excluded.
511 : */
- 512 3173426 : static inline int filter_hidden(int enable, struct dirent* dd)
+ 512 3173124 : static inline int filter_hidden(int enable, struct dirent* dd)
513 : {
- 514 3173426 : if (enable && dirent_hidden(dd)) {
+ 514 3173124 : if (enable && dirent_hidden(dd)) {
515 0 : return 1; /* filter out */
516 : }
517 :
- 518 3173426 : return 0;
+ 518 3173124 : return 0;
519 : }
520 :
521 : /**
@@ -628,17 +628,17 @@
566 : *
567 : * If working with reduced hash lengths, this function always return 0.
568 : */
- 569 758437 : static inline int hash_is_invalid(const unsigned char* hash)
+ 569 759156 : static inline int hash_is_invalid(const unsigned char* hash)
570 : {
571 : int i;
572 :
573 : /* if the hash is reduced, we cannot grant that it's a specific kind of hash */
- 574 758437 : if (BLOCK_HASH_SIZE != HASH_MAX)
+ 574 759156 : if (BLOCK_HASH_SIZE != HASH_MAX)
575 0 : return 0;
576 :
- 577 1178475 : for (i = 0; i < BLOCK_HASH_SIZE; ++i)
- 578 1152411 : if (hash[i] != 0x00)
- 579 732373 : return 0;
+ 577 1179374 : for (i = 0; i < BLOCK_HASH_SIZE; ++i)
+ 578 1153310 : if (hash[i] != 0x00)
+ 579 733092 : return 0;
580 :
581 26064 : return 1;
582 : }
@@ -650,19 +650,19 @@
588 : *
589 : * If working with reduced hash lengths, this function always return 0.
590 : */
- 591 759899 : static inline int hash_is_zero(const unsigned char* hash)
+ 591 760617 : static inline int hash_is_zero(const unsigned char* hash)
592 : {
593 : int i;
594 :
595 : /* if the hash is reduced, we cannot grant that it's a specific kind of hash */
- 596 759899 : if (BLOCK_HASH_SIZE != HASH_MAX)
+ 596 760617 : if (BLOCK_HASH_SIZE != HASH_MAX)
597 0 : return 0;
598 :
- 599 994501 : for (i = 0; i < BLOCK_HASH_SIZE; ++i)
- 600 980032 : if (hash[i] != 0xFF)
- 601 745430 : return 0;
+ 599 994968 : for (i = 0; i < BLOCK_HASH_SIZE; ++i)
+ 600 980500 : if (hash[i] != 0xFF)
+ 601 746149 : return 0;
602 :
- 603 14469 : return 1;
+ 603 14468 : return 1;
604 : }
605 :
606 : /**
@@ -670,22 +670,22 @@
608 : *
609 : * If working with reduced hash lengths, this function always return 0.
610 : */
- 611 44326 : static inline int hash_is_unique(const unsigned char* hash)
+ 611 44219 : static inline int hash_is_unique(const unsigned char* hash)
612 : {
613 : /* if the hash is reduced, we cannot grant that it's a specific kind of hash */
- 614 44326 : if (BLOCK_HASH_SIZE != HASH_MAX)
+ 614 44219 : if (BLOCK_HASH_SIZE != HASH_MAX)
615 0 : return 0;
616 :
- 617 44326 : return !hash_is_zero(hash) && !hash_is_invalid(hash);
+ 617 44219 : return !hash_is_zero(hash) && !hash_is_invalid(hash);
618 : }
619 :
620 : /**
621 : * Set the hash to the special INVALID value.
622 : */
- 623 9234981 : static inline void hash_invalid_set(unsigned char* hash)
+ 623 9234472 : static inline void hash_invalid_set(unsigned char* hash)
624 : {
- 625 9234981 : memset(hash, 0x00, BLOCK_HASH_SIZE);
- 626 9234981 : }
+ 625 9234472 : memset(hash, 0x00, BLOCK_HASH_SIZE);
+ 626 9234472 : }
627 :
628 : /**
629 : * Set the hash to the special ZERO value.
@@ -698,9 +698,9 @@
636 : /**
637 : * Allocated space for block.
638 : */
- 639 58067981 : static inline size_t block_sizeof(void)
+ 639 58065323 : static inline size_t block_sizeof(void)
640 : {
- 641 58067981 : return 1 + BLOCK_HASH_SIZE;
+ 641 58065323 : return 1 + BLOCK_HASH_SIZE;
642 : }
643 :
644 : /**
@@ -709,32 +709,32 @@
647 : * For this function, it's allowed to pass a NULL block
648 : * pointer than results in the BLOCK_STATE_EMPTY state.
649 : */
- 650 52305148 : static inline unsigned block_state_get(const struct snapraid_block* block)
+ 650 52304798 : static inline unsigned block_state_get(const struct snapraid_block* block)
651 : {
- 652 52305148 : if (block == BLOCK_NULL)
- 653 1721828 : return BLOCK_STATE_EMPTY;
+ 652 52304798 : if (block == BLOCK_NULL)
+ 653 1721706 : return BLOCK_STATE_EMPTY;
654 :
- 655 50583320 : return block->state;
+ 655 50583092 : return block->state;
656 : }
657 :
658 : /**
659 : * Set the state of the block.
660 : */
- 661 19119503 : static inline void block_state_set(struct snapraid_block* block, unsigned state)
+ 661 19117787 : static inline void block_state_set(struct snapraid_block* block, unsigned state)
662 : {
- 663 19119503 : block->state = state;
- 664 19119503 : }
+ 663 19117787 : block->state = state;
+ 664 19117787 : }
665 :
666 : /**
667 : * Check if the specified block has an updated hash.
668 : *
669 : * Note that EMPTY / CHG / DELETED return 0.
670 : */
- 671 2216978 : static inline int block_has_updated_hash(const struct snapraid_block* block)
+ 671 2217692 : static inline int block_has_updated_hash(const struct snapraid_block* block)
672 : {
- 673 2216978 : unsigned state = block_state_get(block);
+ 673 2217692 : unsigned state = block_state_get(block);
674 :
- 675 2216978 : return state == BLOCK_STATE_BLK || state == BLOCK_STATE_REP;
+ 675 2217692 : return state == BLOCK_STATE_BLK || state == BLOCK_STATE_REP;
676 : }
677 :
678 : /**
@@ -743,11 +743,11 @@
681 : *
682 : * Note that EMPTY / BLK / REP return 0.
683 : */
- 684 2543126 : static inline int block_has_past_hash(const struct snapraid_block* block)
+ 684 2542743 : static inline int block_has_past_hash(const struct snapraid_block* block)
685 : {
- 686 2543126 : unsigned state = block_state_get(block);
+ 686 2542743 : unsigned state = block_state_get(block);
687 :
- 688 2543126 : return state == BLOCK_STATE_CHG || state == BLOCK_STATE_DELETED;
+ 688 2542743 : return state == BLOCK_STATE_CHG || state == BLOCK_STATE_DELETED;
689 : }
690 :
691 : /**
@@ -755,12 +755,12 @@
693 : *
694 : * Note that EMPTY / DELETED return 0.
695 : */
- 696 14591698 : static inline int block_has_file(const struct snapraid_block* block)
+ 696 14590544 : static inline int block_has_file(const struct snapraid_block* block)
697 : {
- 698 14591698 : unsigned state = block_state_get(block);
+ 698 14590544 : unsigned state = block_state_get(block);
699 :
- 700 14591866 : return state == BLOCK_STATE_BLK
- 701 14591866 : || state == BLOCK_STATE_CHG || state == BLOCK_STATE_REP;
+ 700 14590800 : return state == BLOCK_STATE_BLK
+ 701 14590800 : || state == BLOCK_STATE_CHG || state == BLOCK_STATE_REP;
702 : }
703 :
704 : /**
@@ -768,12 +768,12 @@
706 : *
707 : * Note that EMPTY / BLK return 0.
708 : */
- 709 12320608 : static inline int block_has_invalid_parity(const struct snapraid_block* block)
+ 709 12320061 : static inline int block_has_invalid_parity(const struct snapraid_block* block)
710 : {
- 711 12320608 : unsigned state = block_state_get(block);
+ 711 12320061 : unsigned state = block_state_get(block);
712 :
- 713 12320608 : return state == BLOCK_STATE_DELETED
- 714 12320608 : || state == BLOCK_STATE_CHG || state == BLOCK_STATE_REP;
+ 713 12320061 : return state == BLOCK_STATE_DELETED
+ 714 12320061 : || state == BLOCK_STATE_CHG || state == BLOCK_STATE_REP;
715 : }
716 :
717 : /**
@@ -788,20 +788,20 @@
726 220959 : return state == BLOCK_STATE_BLK;
727 : }
728 :
- 729 34094875 : static inline int file_flag_has(const struct snapraid_file* file, unsigned mask)
+ 729 34094547 : static inline int file_flag_has(const struct snapraid_file* file, unsigned mask)
730 : {
- 731 34094875 : return (file->flag & mask) == mask;
+ 731 34094547 : return (file->flag & mask) == mask;
732 : }
733 :
- 734 5299884 : static inline void file_flag_set(struct snapraid_file* file, unsigned mask)
+ 734 5301349 : static inline void file_flag_set(struct snapraid_file* file, unsigned mask)
735 : {
- 736 5299884 : file->flag |= mask;
- 737 5299884 : }
+ 736 5301349 : file->flag |= mask;
+ 737 5301349 : }
738 :
- 739 16752 : static inline void file_flag_clear(struct snapraid_file* file, unsigned mask)
+ 739 16739 : static inline void file_flag_clear(struct snapraid_file* file, unsigned mask)
740 : {
- 741 16752 : file->flag &= ~mask;
- 742 16752 : }
+ 741 16739 : file->flag &= ~mask;
+ 742 16739 : }
743 :
744 : /**
745 : * Allocate a file.
@@ -833,11 +833,11 @@
771 : *
772 : * Note that the block size if a runtime value.
773 : */
- 774 54353544 : static inline struct snapraid_block* file_block(struct snapraid_file* file, size_t pos)
+ 774 54351240 : static inline struct snapraid_block* file_block(struct snapraid_file* file, size_t pos)
775 : {
- 776 54353544 : unsigned char* ptr = (unsigned char*)file->blockvec;
+ 776 54351240 : unsigned char* ptr = (unsigned char*)file->blockvec;
777 :
- 778 54353544 : return (struct snapraid_block*)(ptr + pos * block_sizeof());
+ 778 54351240 : return (struct snapraid_block*)(ptr + pos * block_sizeof());
779 : }
780 :
781 : /**
@@ -879,9 +879,9 @@
817 : /**
818 : * Compute the hash of a file inode.
819 : */
- 820 5047944 : static inline tommy_uint32_t file_inode_hash(uint64_t inode)
+ 820 5047846 : static inline tommy_uint32_t file_inode_hash(uint64_t inode)
821 : {
- 822 5047944 : return (tommy_uint32_t)tommy_inthash_u64(inode);
+ 822 5047846 : return (tommy_uint32_t)tommy_inthash_u64(inode);
823 : }
824 :
825 : /**
@@ -900,17 +900,17 @@
838 : /**
839 : * Compute the hash of a file path.
840 : */
- 841 3886220 : static inline tommy_uint32_t file_path_hash(const char* sub)
+ 841 3886074 : static inline tommy_uint32_t file_path_hash(const char* sub)
842 : {
- 843 3886220 : return tommy_hash_u32(0, sub, strlen(sub));
+ 843 3886074 : return tommy_hash_u32(0, sub, strlen(sub));
844 : }
845 :
846 : /**
847 : * Compute the hash of a file stamp.
848 : */
- 849 6275777 : static inline tommy_uint32_t file_stamp_hash(data_off_t size, int64_t mtime_sec, int mtime_nsec)
+ 849 6275914 : static inline tommy_uint32_t file_stamp_hash(data_off_t size, int64_t mtime_sec, int mtime_nsec)
850 : {
- 851 6275777 : return tommy_inthash_u32((tommy_uint32_t)size ^ tommy_inthash_u32(mtime_sec ^ tommy_inthash_u32(mtime_nsec)));
+ 851 6275914 : return tommy_inthash_u32((tommy_uint32_t)size ^ tommy_inthash_u32(mtime_sec ^ tommy_inthash_u32(mtime_nsec)));
852 : }
853 :
854 : /**
@@ -1088,19 +1088,19 @@
1026 : /**
1027 : * Get the file position from the parity position.
1028 : */
- 1029 11724320 : static inline struct snapraid_file* fs_par2file_get(struct snapraid_disk* disk, block_off_t parity_pos, block_off_t* file_pos)
+ 1029 11723736 : static inline struct snapraid_file* fs_par2file_get(struct snapraid_disk* disk, block_off_t parity_pos, block_off_t* file_pos)
1030 : {
1031 : struct snapraid_file* ret;
1032 :
- 1033 11724320 : ret = fs_par2file_find(disk, parity_pos, file_pos);
- 1034 11724505 : if (ret == 0) {
+ 1033 11723736 : ret = fs_par2file_find(disk, parity_pos, file_pos);
+ 1034 11723887 : if (ret == 0) {
1035 : /* LCOV_EXCL_START */
1036 : log_fatal("Internal inconsistency when deresolving parity to file at position '%u' in disk '%s'\n", parity_pos, disk->name);
1037 : os_abort();
1038 : /* LCOV_EXCL_STOP */
1039 : }
1040 :
- 1041 11724505 : return ret;
+ 1041 11723887 : return ret;
1042 : }
1043 :
1044 : /**
@@ -1112,19 +1112,19 @@
1050 : /**
1051 : * Get the parity position from the file position.
1052 : */
- 1053 4755275 : static inline block_off_t fs_file2par_get(struct snapraid_disk* disk, struct snapraid_file* file, block_off_t file_pos)
+ 1053 4755380 : static inline block_off_t fs_file2par_get(struct snapraid_disk* disk, struct snapraid_file* file, block_off_t file_pos)
1054 : {
1055 : block_off_t ret;
1056 :
- 1057 4755275 : ret = fs_file2par_find(disk, file, file_pos);
- 1058 4755275 : if (ret == POS_NULL) {
+ 1057 4755380 : ret = fs_file2par_find(disk, file, file_pos);
+ 1058 4755380 : if (ret == POS_NULL) {
1059 : /* LCOV_EXCL_START */
1060 : log_fatal("Internal inconsistency when resolving file '%s' at position '%u/%u' in disk '%s'\n", file->sub, file_pos, file->blockmax, disk->name);
1061 : os_abort();
1062 : /* LCOV_EXCL_STOP */
1063 : }
1064 :
- 1065 4755275 : return ret;
+ 1065 4755380 : return ret;
1066 : }
1067 :
1068 : /**
@@ -1172,18 +1172,18 @@
1110 : /**
1111 : * Make an info.
1112 : */
- 1113 183427 : static inline snapraid_info info_make(time_t last_access, int error, int rehash, int justsynced)
+ 1113 194583 : static inline snapraid_info info_make(time_t last_access, int error, int rehash, int justsynced)
1114 : {
1115 : /* clear the lowest bits as reserved for other information */
- 1116 183427 : snapraid_info info = last_access & ~INFO_MASK;
+ 1116 194583 : snapraid_info info = last_access & ~INFO_MASK;
1117 :
- 1118 183427 : if (error != 0)
- 1119 5308 : info |= 0x1;
- 1120 183427 : if (rehash != 0)
- 1121 14181 : info |= 0x2;
- 1122 183427 : if (justsynced != 0)
- 1123 131834 : info |= 0x4;
- 1124 183427 : return info;
+ 1118 194583 : if (error != 0)
+ 1119 5380 : info |= 0x1;
+ 1120 194583 : if (rehash != 0)
+ 1121 14426 : info |= 0x2;
+ 1122 194583 : if (justsynced != 0)
+ 1123 142978 : info |= 0x4;
+ 1124 194583 : return info;
1125 : }
1126 :
1127 : /**
@@ -1191,36 +1191,36 @@
1129 : * This is the last time when the block was know to be correct.
1130 : * The "scrubbed" info tells if the time is referreing at the latest sync or scrub.
1131 : */
- 1132 878516 : static inline time_t info_get_time(snapraid_info info)
+ 1132 883104 : static inline time_t info_get_time(snapraid_info info)
1133 : {
- 1134 878516 : return info & ~INFO_MASK;
+ 1134 883104 : return info & ~INFO_MASK;
1135 : }
1136 :
1137 : /**
1138 : * Extract the error information.
1139 : * Report if the block address had some problem.
1140 : */
- 1141 347310 : static inline int info_get_bad(snapraid_info info)
+ 1141 351943 : static inline int info_get_bad(snapraid_info info)
1142 : {
- 1143 347310 : return (info & 0x1) != 0;
+ 1143 351943 : return (info & 0x1) != 0;
1144 : }
1145 :
1146 : /**
1147 : * Extract the rehash information.
1148 : * Report if the block address is using the old hash and needs to be rehashed.
1149 : */
- 1150 2042164 : static inline int info_get_rehash(snapraid_info info)
+ 1150 2046653 : static inline int info_get_rehash(snapraid_info info)
1151 : {
- 1152 2042164 : return (info & 0x2) != 0;
+ 1152 2046653 : return (info & 0x2) != 0;
1153 : }
1154 :
1155 : /**
1156 : * Extract the scrubbed information.
1157 : * Report if the block address was never scrubbed.
1158 : */
- 1159 63947 : static inline int info_get_justsynced(snapraid_info info)
+ 1159 68535 : static inline int info_get_justsynced(snapraid_info info)
1160 : {
- 1161 63947 : return (info & 0x4) != 0;
+ 1161 68535 : return (info & 0x4) != 0;
1162 : }
1163 :
1164 : /**
@@ -1243,27 +1243,27 @@
1181 : * Set the info at the specified position.
1182 : * The position is allocated if not yet done.
1183 : */
- 1184 1698035 : static inline void info_set(tommy_arrayblkof* array, block_off_t pos, snapraid_info info)
+ 1184 1697965 : static inline void info_set(tommy_arrayblkof* array, block_off_t pos, snapraid_info info)
1185 : {
- 1186 1698035 : tommy_arrayblkof_grow(array, pos + 1);
+ 1186 1697965 : tommy_arrayblkof_grow(array, pos + 1);
1187 :
- 1188 1698035 : memcpy(tommy_arrayblkof_ref(array, pos), &info, sizeof(snapraid_info));
- 1189 1698035 : }
+ 1188 1697965 : memcpy(tommy_arrayblkof_ref(array, pos), &info, sizeof(snapraid_info));
+ 1189 1697965 : }
1190 :
1191 : /**
1192 : * Get the info at the specified position.
1193 : * For not allocated position, 0 is returned.
1194 : */
- 1195 5093871 : static inline snapraid_info info_get(tommy_arrayblkof* array, block_off_t pos)
+ 1195 5098374 : static inline snapraid_info info_get(tommy_arrayblkof* array, block_off_t pos)
1196 : {
1197 : snapraid_info info;
1198 :
- 1199 5093871 : if (pos >= tommy_arrayblkof_size(array))
+ 1199 5098374 : if (pos >= tommy_arrayblkof_size(array))
1200 262643 : return 0;
1201 :
- 1202 4831228 : memcpy(&info, tommy_arrayblkof_ref(array, pos), sizeof(snapraid_info));
+ 1202 4835731 : memcpy(&info, tommy_arrayblkof_ref(array, pos), sizeof(snapraid_info));
1203 :
- 1204 4831228 : return info;
+ 1204 4835731 : return info;
1205 : }
1206 :
1207 : /**
diff --git a/cov/cmdline/handle.c.func-sort-c.html b/cov/cmdline/handle.c.func-sort-c.html
index 2c451c28..edff826c 100644
--- a/cov/cmdline/handle.c.func-sort-c.html
+++ b/cov/cmdline/handle.c.func-sort-c.html
@@ -61,31 +61,31 @@
| handle_read |
- 5856976 |
+ 5855349 |
| handle_close |
- 4647242 |
+ 4647511 |
| handle_open |
- 2186381 |
+ 2185867 |
| handle_create |
- 771297 |
+ 771311 |
| handle_write |
- 288368 |
+ 288562 |
| handle_utime |
- 119415 |
+ 119431 |
| handle_truncate |
- 3236 |
+ 3222 |
| handle_mapping |
diff --git a/cov/cmdline/handle.c.func.html b/cov/cmdline/handle.c.func.html
index d7d39888..6ead080c 100644
--- a/cov/cmdline/handle.c.func.html
+++ b/cov/cmdline/handle.c.func.html
@@ -61,11 +61,11 @@
| handle_close |
- 4647242 |
+ 4647511 |
| handle_create |
- 771297 |
+ 771311 |
| handle_mapping |
@@ -73,23 +73,23 @@
| handle_open |
- 2186381 |
+ 2185867 |
| handle_read |
- 5856976 |
+ 5855349 |
| handle_truncate |
- 3236 |
+ 3222 |
| handle_utime |
- 119415 |
+ 119431 |
| handle_write |
- 288368 |
+ 288562 |
diff --git a/cov/cmdline/handle.c.gcov.html b/cov/cmdline/handle.c.gcov.html
index bc5ecf22..98afa115 100644
--- a/cov/cmdline/handle.c.gcov.html
+++ b/cov/cmdline/handle.c.gcov.html
@@ -86,64 +86,64 @@
24 : /****************************************************************************/
25 : /* handle */
26 :
- 27 771297 : int handle_create(struct snapraid_handle* handle, struct snapraid_file* file, int mode)
+ 27 771311 : int handle_create(struct snapraid_handle* handle, struct snapraid_file* file, int mode)
28 : {
29 : int ret;
30 : int flags;
31 :
32 : /* if it's the same file, and already opened, nothing to do */
- 33 771297 : if (handle->file == file && handle->f != -1) {
+ 33 771311 : if (handle->file == file && handle->f != -1) {
34 0 : return 0;
35 : }
36 :
- 37 771297 : advise_init(&handle->advise, mode);
- 38 771297 : pathprint(handle->path, sizeof(handle->path), "%s%s", handle->disk->dir, file->sub);
+ 37 771311 : advise_init(&handle->advise, mode);
+ 38 771311 : pathprint(handle->path, sizeof(handle->path), "%s%s", handle->disk->dir, file->sub);
39 :
- 40 771297 : ret = mkancestor(handle->path);
- 41 771297 : if (ret != 0) {
+ 40 771311 : ret = mkancestor(handle->path);
+ 41 771311 : if (ret != 0) {
42 : /* LCOV_EXCL_START */
43 : return -1;
44 : /* LCOV_EXCL_STOP */
45 : }
46 :
47 : /* initial values, changed later if required */
- 48 771297 : handle->created = 0;
+ 48 771311 : handle->created = 0;
49 :
50 : /* flags for opening */
51 : /* O_BINARY: open as binary file (Windows only) */
52 : /* O_NOFOLLOW: do not follow links to ensure to open the real file */
- 53 771297 : flags = O_BINARY | O_NOFOLLOW | advise_flags(&handle->advise);
+ 53 771311 : flags = O_BINARY | O_NOFOLLOW | advise_flags(&handle->advise);
54 :
55 : /* open for read write */
- 56 771297 : handle->f = open(handle->path, flags | O_RDWR);
+ 56 771311 : handle->f = open(handle->path, flags | O_RDWR);
57 :
58 : /* if failed for missing write permission */
- 59 771297 : if (handle->f == -1 && (errno == EACCES || errno == EROFS)) {
+ 59 771311 : if (handle->f == -1 && (errno == EACCES || errno == EROFS)) {
60 : /* open for real-only */
61 0 : handle->f = open(handle->path, flags | O_RDONLY);
62 : }
63 :
64 : /* if failed for missing file */
- 65 771297 : if (handle->f == -1 && errno == ENOENT) {
+ 65 771311 : if (handle->f == -1 && errno == ENOENT) {
66 : char path_from[PATH_MAX];
67 :
68 : /* check if exists a .unrecoverable copy, and rename to the real one */
- 69 176226 : pathprint(path_from, sizeof(path_from), "%s.unrecoverable", handle->path);
+ 69 176417 : pathprint(path_from, sizeof(path_from), "%s.unrecoverable", handle->path);
70 :
- 71 176226 : if (rename(path_from, handle->path) == 0) {
+ 71 176417 : if (rename(path_from, handle->path) == 0) {
72 : /* open for read write */
- 73 63228 : handle->f = open(handle->path, flags | O_RDWR);
+ 73 63282 : handle->f = open(handle->path, flags | O_RDWR);
74 : } else {
75 : /* create it */
- 76 112998 : handle->f = open(handle->path, flags | O_RDWR | O_CREAT, 0600);
- 77 112998 : if (handle->f != -1) {
+ 76 113135 : handle->f = open(handle->path, flags | O_RDWR | O_CREAT, 0600);
+ 77 113135 : if (handle->f != -1) {
78 : /* mark it as created if really done */
- 79 112998 : handle->created = 1;
+ 79 113135 : handle->created = 1;
80 : }
81 : }
82 : }
83 :
- 84 771297 : if (handle->f == -1) {
+ 84 771311 : if (handle->f == -1) {
85 : /* LCOV_EXCL_START */
86 : /* invalidate for error */
87 : handle->file = 0;
@@ -156,11 +156,11 @@
94 : }
95 :
96 : /* just opened */
- 97 771297 : handle->file = file;
+ 97 771311 : handle->file = file;
98 :
99 : /* get the stat info */
- 100 771297 : ret = fstat(handle->f, &handle->st);
- 101 771297 : if (ret != 0) {
+ 100 771311 : ret = fstat(handle->f, &handle->st);
+ 101 771311 : if (ret != 0) {
102 : /* LCOV_EXCL_START */
103 : log_fatal("Error accessing file '%s'. %s.\n", handle->path, strerror(errno));
104 : return -1;
@@ -168,25 +168,25 @@
106 : }
107 :
108 : /* get the size of the existing data */
- 109 771297 : handle->valid_size = handle->st.st_size;
+ 109 771311 : handle->valid_size = handle->st.st_size;
110 :
- 111 771297 : ret = advise_open(&handle->advise, handle->f);
- 112 771297 : if (ret != 0) {
+ 111 771311 : ret = advise_open(&handle->advise, handle->f);
+ 112 771311 : if (ret != 0) {
113 : /* LCOV_EXCL_START */
114 : log_fatal("Error advising file '%s'. %s.\n", handle->path, strerror(errno));
115 : return -1;
116 : /* LCOV_EXCL_STOP */
117 : }
118 :
- 119 771297 : return 0;
+ 119 771311 : return 0;
120 : }
121 :
- 122 3236 : int handle_truncate(struct snapraid_handle* handle, struct snapraid_file* file)
+ 122 3222 : int handle_truncate(struct snapraid_handle* handle, struct snapraid_file* file)
123 : {
124 : int ret;
125 :
- 126 3236 : ret = ftruncate(handle->f, file->size);
- 127 3236 : if (ret != 0) {
+ 126 3222 : ret = ftruncate(handle->f, file->size);
+ 127 3222 : if (ret != 0) {
128 : /* LCOV_EXCL_START */
129 : if (errno == EACCES) {
130 : log_fatal("Failed to truncate file '%s' for missing write permission.\n", handle->path);
@@ -198,56 +198,56 @@
136 : }
137 :
138 : /* adjust the size to the truncated size */
- 139 3236 : handle->valid_size = file->size;
+ 139 3222 : handle->valid_size = file->size;
140 :
- 141 3236 : return 0;
+ 141 3222 : return 0;
142 : }
143 :
- 144 2186381 : int handle_open(struct snapraid_handle* handle, struct snapraid_file* file, int mode, fptr* out, fptr* out_missing)
+ 144 2185867 : int handle_open(struct snapraid_handle* handle, struct snapraid_file* file, int mode, fptr* out, fptr* out_missing)
145 : {
146 : int ret;
147 : int flags;
148 :
- 149 2186381 : if (!out_missing)
- 150 2186033 : out_missing = out;
+ 149 2185867 : if (!out_missing)
+ 150 2185464 : out_missing = out;
151 :
152 : /* if already opened, nothing to do */
- 153 2186381 : if (handle->file == file && handle->file != 0 && handle->f != -1) {
- 154 468716 : return 0;
+ 153 2185867 : if (handle->file == file && handle->file != 0 && handle->f != -1) {
+ 154 468345 : return 0;
155 : }
156 :
- 157 1717665 : advise_init(&handle->advise, mode);
- 158 1717888 : pathprint(handle->path, sizeof(handle->path), "%s%s", handle->disk->dir, file->sub);
+ 157 1717522 : advise_init(&handle->advise, mode);
+ 158 1717676 : pathprint(handle->path, sizeof(handle->path), "%s%s", handle->disk->dir, file->sub);
159 :
160 : /* for sure not created */
- 161 1718027 : handle->created = 0;
+ 161 1717807 : handle->created = 0;
162 :
163 : /* flags for opening */
164 : /* O_BINARY: open as binary file (Windows only) */
165 : /* O_NOFOLLOW: do not follow links to ensure to open the real file */
- 166 1718027 : flags = O_BINARY | O_NOFOLLOW | advise_flags(&handle->advise);
+ 166 1717807 : flags = O_BINARY | O_NOFOLLOW | advise_flags(&handle->advise);
167 :
168 : /* open for read */
- 169 1717978 : handle->f = open_noatime(handle->path, flags | O_RDONLY);
- 170 1718011 : if (handle->f == -1) {
+ 169 1717764 : handle->f = open_noatime(handle->path, flags | O_RDONLY);
+ 170 1717748 : if (handle->f == -1) {
171 : /* invalidate for error */
- 172 78453 : handle->file = 0;
- 173 78453 : handle->f = -1;
- 174 78453 : handle->valid_size = 0;
+ 172 78757 : handle->file = 0;
+ 173 78757 : handle->f = -1;
+ 174 78757 : handle->valid_size = 0;
175 :
- 176 78453 : if (errno == ENOENT)
- 177 78441 : out_missing("Missing file '%s'.\n", handle->path);
+ 176 78757 : if (errno == ENOENT)
+ 177 78745 : out_missing("Missing file '%s'.\n", handle->path);
178 : else
179 12 : out("Error opening file '%s'. %s.\n", handle->path, strerror(errno));
- 180 78453 : return -1;
+ 180 78757 : return -1;
181 : }
182 :
183 : /* just opened */
- 184 1639558 : handle->file = file;
+ 184 1638991 : handle->file = file;
185 :
186 : /* get the stat info */
- 187 1639558 : ret = fstat(handle->f, &handle->st);
- 188 1639532 : if (ret != 0) {
+ 187 1638991 : ret = fstat(handle->f, &handle->st);
+ 188 1639031 : if (ret != 0) {
189 : /* LCOV_EXCL_START */
190 : out("Error accessing file '%s'. %s.\n", handle->path, strerror(errno));
191 : return -1;
@@ -255,27 +255,27 @@
193 : }
194 :
195 : /* get the size of the existing data */
- 196 1639532 : handle->valid_size = handle->st.st_size;
+ 196 1639031 : handle->valid_size = handle->st.st_size;
197 :
- 198 1639532 : ret = advise_open(&handle->advise, handle->f);
- 199 1639561 : if (ret != 0) {
+ 198 1639031 : ret = advise_open(&handle->advise, handle->f);
+ 199 1639026 : if (ret != 0) {
200 : /* LCOV_EXCL_START */
201 : out("Error advising file '%s'. %s.\n", handle->path, strerror(errno));
202 : return -1;
203 : /* LCOV_EXCL_STOP */
204 : }
205 :
- 206 1639561 : return 0;
+ 206 1639026 : return 0;
207 : }
208 :
- 209 4647242 : int handle_close(struct snapraid_handle* handle)
+ 209 4647511 : int handle_close(struct snapraid_handle* handle)
210 : {
211 : int ret;
212 :
213 : /* close if open */
- 214 4647242 : if (handle->f != -1) {
- 215 2410862 : ret = close(handle->f);
- 216 2410894 : if (ret != 0) {
+ 214 4647511 : if (handle->f != -1) {
+ 215 2410343 : ret = close(handle->f);
+ 216 2410377 : if (ret != 0) {
217 : /* LCOV_EXCL_START */
218 : log_fatal("Error closing file '%s'. %s.\n", handle->file->sub, strerror(errno));
219 :
@@ -289,14 +289,14 @@
227 : }
228 :
229 : /* reset the descriptor */
- 230 4647274 : handle->file = 0;
- 231 4647274 : handle->f = -1;
- 232 4647274 : handle->valid_size = 0;
+ 230 4647545 : handle->file = 0;
+ 231 4647545 : handle->f = -1;
+ 232 4647545 : handle->valid_size = 0;
233 :
- 234 4647274 : return 0;
+ 234 4647545 : return 0;
235 : }
236 :
- 237 5856976 : int handle_read(struct snapraid_handle* handle, block_off_t file_pos, unsigned char* block_buffer, unsigned block_size, fptr* out, fptr* out_missing)
+ 237 5855349 : int handle_read(struct snapraid_handle* handle, block_off_t file_pos, unsigned char* block_buffer, unsigned block_size, fptr* out, fptr* out_missing)
238 : {
239 : ssize_t read_ret;
240 : data_off_t offset;
@@ -304,70 +304,70 @@
242 : unsigned count;
243 : int ret;
244 :
- 245 5856976 : offset = file_pos * (data_off_t)block_size;
+ 245 5855349 : offset = file_pos * (data_off_t)block_size;
246 :
- 247 5856976 : if (!out_missing)
- 248 5844038 : out_missing = out;
+ 247 5855349 : if (!out_missing)
+ 248 5842393 : out_missing = out;
249 :
250 : /* check if we are going to read only not initialized data */
- 251 5856976 : if (offset >= handle->valid_size) {
+ 251 5855349 : if (offset >= handle->valid_size) {
252 : /* if the file is missing, it's at 0 size, or it's rebuilt while reading */
- 253 433024 : if (offset == handle->valid_size || handle->valid_size == 0)
- 254 431748 : out_missing("Reading data from missing file '%s' at offset %" PRIu64 ".\n", handle->path, offset);
+ 253 433464 : if (offset == handle->valid_size || handle->valid_size == 0)
+ 254 432215 : out_missing("Reading data from missing file '%s' at offset %" PRIu64 ".\n", handle->path, offset);
255 : else
- 256 1276 : out("Reading missing data from file '%s' at offset %" PRIu64 ".\n", handle->path, offset);
- 257 433024 : return -1;
+ 256 1249 : out("Reading missing data from file '%s' at offset %" PRIu64 ".\n", handle->path, offset);
+ 257 433464 : return -1;
258 : }
259 :
- 260 5423952 : read_size = file_block_size(handle->file, file_pos, block_size);
+ 260 5421885 : read_size = file_block_size(handle->file, file_pos, block_size);
261 :
- 262 5423917 : count = 0;
+ 262 5421858 : count = 0;
263 : do {
264 : /* read the full block to support O_DIRECT */
- 265 5432696 : read_ret = pread(handle->f, block_buffer + count, block_size - count, offset + count);
- 266 5432323 : if (read_ret < 0) {
+ 265 5430464 : read_ret = pread(handle->f, block_buffer + count, block_size - count, offset + count);
+ 266 5430098 : if (read_ret < 0) {
267 : /* LCOV_EXCL_START */
268 : out("Error reading file '%s' at offset %" PRIu64 " for size %u. %s.\n", handle->path, offset + count, block_size - count, strerror(errno));
269 : return -1;
270 : /* LCOV_EXCL_STOP */
271 : }
- 272 5432323 : if (read_ret == 0) {
- 273 8940 : out("Unexpected end of file '%s' at offset %" PRIu64 ". %s.\n", handle->path, offset, strerror(errno));
- 274 8940 : return -1;
+ 272 5430098 : if (read_ret == 0) {
+ 273 8705 : out("Unexpected end of file '%s' at offset %" PRIu64 ". %s.\n", handle->path, offset, strerror(errno));
+ 274 8705 : return -1;
275 : }
276 :
- 277 5423383 : count += read_ret;
- 278 5423383 : } while (count < read_size);
+ 277 5421393 : count += read_ret;
+ 278 5421393 : } while (count < read_size);
279 :
280 : /* pad with 0 */
- 281 5414604 : if (read_size < block_size) {
- 282 2188899 : memset(block_buffer + read_size, 0, block_size - read_size);
+ 281 5412787 : if (read_size < block_size) {
+ 282 2188487 : memset(block_buffer + read_size, 0, block_size - read_size);
283 : }
284 :
- 285 5414604 : ret = advise_read(&handle->advise, handle->f, offset, block_size);
- 286 5414548 : if (ret != 0) {
+ 285 5412787 : ret = advise_read(&handle->advise, handle->f, offset, block_size);
+ 286 5412784 : if (ret != 0) {
287 : /* LCOV_EXCL_START */
288 : out("Error advising file '%s'. %s.\n", handle->path, strerror(errno));
289 : return -1;
290 : /* LCOV_EXCL_STOP */
291 : }
292 :
- 293 5414548 : return read_size;
+ 293 5412784 : return read_size;
294 : }
295 :
- 296 288368 : int handle_write(struct snapraid_handle* handle, block_off_t file_pos, unsigned char* block_buffer, unsigned block_size)
+ 296 288562 : int handle_write(struct snapraid_handle* handle, block_off_t file_pos, unsigned char* block_buffer, unsigned block_size)
297 : {
298 : ssize_t write_ret;
299 : data_off_t offset;
300 : unsigned write_size;
301 : int ret;
302 :
- 303 288368 : offset = file_pos * (data_off_t)block_size;
+ 303 288562 : offset = file_pos * (data_off_t)block_size;
304 :
- 305 288368 : write_size = file_block_size(handle->file, file_pos, block_size);
+ 305 288562 : write_size = file_block_size(handle->file, file_pos, block_size);
306 :
- 307 288368 : write_ret = pwrite(handle->f, block_buffer, write_size, offset);
- 308 288368 : if (write_ret != (ssize_t)write_size) { /* conversion is safe because block_size is always small */
+ 307 288562 : write_ret = pwrite(handle->f, block_buffer, write_size, offset);
+ 308 288562 : if (write_ret != (ssize_t)write_size) { /* conversion is safe because block_size is always small */
309 : /* LCOV_EXCL_START */
310 : log_fatal("Error writing file '%s'. %s.\n", handle->path, strerror(errno));
311 : return -1;
@@ -375,39 +375,39 @@
313 : }
314 :
315 : /* adjust the size of the valid data */
- 316 288368 : if (handle->valid_size < offset + write_size) {
- 317 282259 : handle->valid_size = offset + write_size;
+ 316 288562 : if (handle->valid_size < offset + write_size) {
+ 317 282510 : handle->valid_size = offset + write_size;
318 : }
319 :
- 320 288368 : ret = advise_write(&handle->advise, handle->f, offset, block_size);
- 321 288368 : if (ret != 0) {
+ 320 288562 : ret = advise_write(&handle->advise, handle->f, offset, block_size);
+ 321 288562 : if (ret != 0) {
322 : /* LCOV_EXCL_START */
323 : log_fatal("Error advising file '%s'. %s.\n", handle->path, strerror(errno));
324 : return -1;
325 : /* LCOV_EXCL_STOP */
326 : }
327 :
- 328 288368 : return 0;
+ 328 288562 : return 0;
329 : }
330 :
- 331 119415 : int handle_utime(struct snapraid_handle* handle)
+ 331 119431 : int handle_utime(struct snapraid_handle* handle)
332 : {
333 : int ret;
334 :
335 : /* do nothing if not opened */
- 336 119415 : if (handle->f == -1)
+ 336 119431 : if (handle->f == -1)
337 0 : return 0;
338 :
- 339 119415 : ret = fmtime(handle->f, handle->file->mtime_sec, handle->file->mtime_nsec);
+ 339 119431 : ret = fmtime(handle->f, handle->file->mtime_sec, handle->file->mtime_nsec);
340 :
- 341 119415 : if (ret != 0) {
+ 341 119431 : if (ret != 0) {
342 : /* LCOV_EXCL_START */
343 : log_fatal("Error timing file '%s'. %s.\n", handle->file->sub, strerror(errno));
344 : return -1;
345 : /* LCOV_EXCL_STOP */
346 : }
347 :
- 348 119415 : return 0;
+ 348 119431 : return 0;
349 : }
350 :
351 221 : struct snapraid_handle* handle_mapping(struct snapraid_state* state, unsigned* handlemax)
diff --git a/cov/cmdline/import.c.func-sort-c.html b/cov/cmdline/import.c.func-sort-c.html
index ac69ca1b..9c1827ee 100644
--- a/cov/cmdline/import.c.func-sort-c.html
+++ b/cov/cmdline/import.c.func-sort-c.html
@@ -61,11 +61,11 @@
| import_block_hash |
- 656339 |
+ 657164 |
| state_import_fetch |
- 651867 |
+ 652692 |
| import_block_hash_compare |
diff --git a/cov/cmdline/import.c.func.html b/cov/cmdline/import.c.func.html
index 63b95b38..8e60bbce 100644
--- a/cov/cmdline/import.c.func.html
+++ b/cov/cmdline/import.c.func.html
@@ -61,7 +61,7 @@
| import_block_hash |
- 656339 |
+ 657164 |
| import_block_hash_compare |
@@ -89,7 +89,7 @@
| state_import_fetch |
- 651867 |
+ 652692 |
diff --git a/cov/cmdline/import.c.gcov.html b/cov/cmdline/import.c.gcov.html
index 1acf63b1..f65eeec5 100644
--- a/cov/cmdline/import.c.gcov.html
+++ b/cov/cmdline/import.c.gcov.html
@@ -108,10 +108,10 @@
46 : * Compute the hash of the hash for an import block.
47 : * We just use the first 32 bit of the hash itself.
48 : */
- 49 656339 : static inline tommy_uint32_t import_block_hash(const unsigned char* hash)
+ 49 657164 : static inline tommy_uint32_t import_block_hash(const unsigned char* hash)
50 : {
51 : /* the hash data is not aligned, and we cannot access it with a direct cast */
- 52 656339 : return hash[0] | ((uint32_t)hash[1] << 8) | ((uint32_t)hash[2] << 16) | ((uint32_t)hash[3] << 24);
+ 52 657164 : return hash[0] | ((uint32_t)hash[1] << 8) | ((uint32_t)hash[2] << 16) | ((uint32_t)hash[3] << 24);
53 : }
54 :
55 1750 : static void import_file(struct snapraid_state* state, const char* path, uint64_t size)
@@ -207,24 +207,24 @@
145 1750 : free(file);
146 1750 : }
147 :
- 148 651867 : int state_import_fetch(struct snapraid_state* state, int rehash, struct snapraid_block* missing_block, unsigned char* buffer)
+ 148 652692 : int state_import_fetch(struct snapraid_state* state, int rehash, struct snapraid_block* missing_block, unsigned char* buffer)
149 : {
150 : struct snapraid_import_block* block;
151 : int ret;
152 : int f;
- 153 651867 : const unsigned char* hash = missing_block->hash;
- 154 651867 : unsigned block_size = state->block_size;
+ 153 652692 : const unsigned char* hash = missing_block->hash;
+ 154 652692 : unsigned block_size = state->block_size;
155 : unsigned read_size;
156 : unsigned char buffer_hash[HASH_MAX];
157 : const char* path;
158 :
- 159 651867 : if (rehash) {
+ 159 652692 : if (rehash) {
160 0 : block = tommy_hashdyn_search(&state->previmportset, import_block_prevhash_compare, hash, import_block_hash(hash));
161 : } else {
- 162 651867 : block = tommy_hashdyn_search(&state->importset, import_block_hash_compare, hash, import_block_hash(hash));
+ 162 652692 : block = tommy_hashdyn_search(&state->importset, import_block_hash_compare, hash, import_block_hash(hash));
163 : }
- 164 651867 : if (!block)
- 165 647395 : return -1;
+ 164 652692 : if (!block)
+ 165 648220 : return -1;
166 :
167 4472 : path = block->file->path;
168 4472 : read_size = block->size;
diff --git a/cov/cmdline/index-sort-f.html b/cov/cmdline/index-sort-f.html
index 298cac0f..598b0f01 100644
--- a/cov/cmdline/index-sort-f.html
+++ b/cov/cmdline/index-sort-f.html
@@ -31,18 +31,18 @@
|
-
-
-
+
+
+
|
-
+
-
+
 |
@@ -69,16 +69,6 @@
Line Coverage  |
Functions  |
-
- | io.c |
-
-
- |
- 78.2 % |
- 326 / 417 |
- 64.5 % |
- 20 / 31 |
-
| unix.c |
@@ -99,6 +89,16 @@
| 87.5 % |
7 / 8 |
+
+ | io.c |
+
+
+ |
+ 92.6 % |
+ 386 / 417 |
+ 90.3 % |
+ 28 / 31 |
+
| stream.h |
@@ -232,10 +232,10 @@
|
| speed.c |
-
+
|
- 89.9 % |
- 363 / 404 |
+ 99.8 % |
+ 403 / 404 |
100.0 % |
2 / 2 |
@@ -332,10 +332,10 @@
| sync.c |
-
+
|
- 89.1 % |
- 500 / 561 |
+ 89.5 % |
+ 502 / 561 |
100.0 % |
7 / 7 |
@@ -355,7 +355,7 @@
100.0 % |
- 143 / 143 |
+ 145 / 145 |
100.0 % |
8 / 8 |
@@ -382,10 +382,10 @@
| snapraid.c |
-
+
|
- 90.6 % |
- 491 / 542 |
+ 91.1 % |
+ 494 / 542 |
100.0 % |
9 / 9 |
diff --git a/cov/cmdline/index-sort-l.html b/cov/cmdline/index-sort-l.html
index a8a749d6..6dc33db4 100644
--- a/cov/cmdline/index-sort-l.html
+++ b/cov/cmdline/index-sort-l.html
@@ -31,18 +31,18 @@
|
-
-
-
+
+
+
|
-
+
-
+
 |
@@ -89,16 +89,6 @@
100.0 % |
5 / 5 |
-
- | io.c |
-
-
- |
- 78.2 % |
- 326 / 417 |
- 64.5 % |
- 20 / 31 |
-
| scrub.c |
@@ -129,16 +119,6 @@
| 94.7 % |
18 / 19 |
-
- | sync.c |
-
-
- |
- 89.1 % |
- 500 / 561 |
- 100.0 % |
- 7 / 7 |
-
| scan.c |
@@ -150,14 +130,14 @@
| 23 / 23 |
- | speed.c |
+ sync.c |
-
+
|
- 89.9 % |
- 363 / 404 |
+ 89.5 % |
+ 502 / 561 |
100.0 % |
- 2 / 2 |
+ 7 / 7 |
| state.c |
@@ -189,16 +169,6 @@
87.5 % |
7 / 8 |
-
- | snapraid.c |
-
-
- |
- 90.6 % |
- 491 / 542 |
- 100.0 % |
- 9 / 9 |
-
| check.c |
@@ -229,6 +199,26 @@
| 100.0 % |
7 / 7 |
+
+ | snapraid.c |
+
+
+ |
+ 91.1 % |
+ 494 / 542 |
+ 100.0 % |
+ 9 / 9 |
+
+
+ | io.c |
+
+
+ |
+ 92.6 % |
+ 386 / 417 |
+ 90.3 % |
+ 28 / 31 |
+
| util.c |
@@ -349,6 +339,16 @@
| 100.0 % |
8 / 8 |
+
+ | speed.c |
+
+
+ |
+ 99.8 % |
+ 403 / 404 |
+ 100.0 % |
+ 2 / 2 |
+
| portable.h |
@@ -415,7 +415,7 @@
|
100.0 % |
- 143 / 143 |
+ 145 / 145 |
100.0 % |
8 / 8 |
diff --git a/cov/cmdline/index.html b/cov/cmdline/index.html
index e38d7b1f..f74b2cb2 100644
--- a/cov/cmdline/index.html
+++ b/cov/cmdline/index.html
@@ -31,18 +31,18 @@
|
-
-
-
+
+
+
|
-
+
-
+
 |
@@ -152,12 +152,12 @@
| io.c |
-
+
|
- 78.2 % |
- 326 / 417 |
- 64.5 % |
- 20 / 31 |
+ 92.6 % |
+ 386 / 417 |
+ 90.3 % |
+ 28 / 31 |
| list.c |
@@ -275,27 +275,27 @@
100.0 % |
- 143 / 143 |
+ 145 / 145 |
100.0 % |
8 / 8 |
| snapraid.c |
-
+
|
- 90.6 % |
- 491 / 542 |
+ 91.1 % |
+ 494 / 542 |
100.0 % |
9 / 9 |
| speed.c |
-
+
|
- 89.9 % |
- 363 / 404 |
+ 99.8 % |
+ 403 / 404 |
100.0 % |
2 / 2 |
@@ -372,10 +372,10 @@
| sync.c |
-
+
|
- 89.1 % |
- 500 / 561 |
+ 89.5 % |
+ 502 / 561 |
100.0 % |
7 / 7 |
diff --git a/cov/cmdline/io.c.func-sort-c.html b/cov/cmdline/io.c.func-sort-c.html
index 051e32d0..5904027b 100644
--- a/cov/cmdline/io.c.func-sort-c.html
+++ b/cov/cmdline/io.c.func-sort-c.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
+
-
+
 |
@@ -61,27 +61,27 @@
| io_reader_step |
- 1192431 |
-
-
- | io_reader_worker |
- 1110427 |
+ 1162427 |
| io_task_read_thread |
- 1110414 |
+ 1081698 |
+
+
+ | io_reader_worker |
+ 1081680 |
| io_data_read_thread |
- 899610 |
+ 870894 |
| io_writer_step |
- 559155 |
+ 553871 |
| io_parity_write_thread |
- 558701 |
+ 553420 |
| io_parity_read_thread |
@@ -89,68 +89,92 @@
| io_position_next |
- 162223 |
+ 161997 |
| io_reader_sched |
- 162223 |
+ 161997 |
| io_read_next_thread |
- 150031 |
-
-
- | io_write_preset_thread |
- 114801 |
-
-
- | io_write_next_thread |
- 114801 |
+ 145244 |
| io_writer_sched |
- 112466 |
+ 112401 |
+
+
+ | io_write_preset_thread |
+ 110015 |
+
+
+ | io_write_next_thread |
+ 110015 |
+
+
+ | io_task_read_mono |
+ 28122 |
+
+
+ | io_data_read_mono |
+ 28122 |
+
+
+ | io_read_next_mono |
+ 4688 |
+
+
+ | io_parity_write_mono |
+ 4687 |
+
+
+ | io_write_next_mono |
+ 4687 |
+
+
+ | io_write_preset_mono |
+ 4687 |
| io_writer_sched_empty |
- 2335 |
+ 2301 |
| io_reader_thread |
- 654 |
+ 647 |
| io_writer_thread |
- 463 |
+ 462 |
| io_init |
96 |
-
- | io_start_thread |
- 96 |
-
| io_done |
96 |
+
+ | io_start_thread |
+ 95 |
+
| io_stop_thread |
- 96 |
+ 95 |
+
+
+ | io_start_mono |
+ 1 |
+
+
+ | io_stop_mono |
+ 1 |
| io_refresh_mono |
0 |
-
- | io_parity_write_mono |
- 0 |
-
-
- | io_read_next_mono |
- 0 |
-
| io_refresh_thread |
0 |
@@ -159,30 +183,6 @@
io_parity_read_mono |
0 |
-
- | io_start_mono |
- 0 |
-
-
- | io_stop_mono |
- 0 |
-
-
- | io_write_next_mono |
- 0 |
-
-
- | io_write_preset_mono |
- 0 |
-
-
- | io_task_read_mono |
- 0 |
-
-
- | io_data_read_mono |
- 0 |
-
diff --git a/cov/cmdline/io.c.func.html b/cov/cmdline/io.c.func.html
index 6846cb8c..d5364ee0 100644
--- a/cov/cmdline/io.c.func.html
+++ b/cov/cmdline/io.c.func.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
+
-
+
 |
@@ -61,11 +61,11 @@
| io_data_read_mono |
- 0 |
+ 28122 |
| io_data_read_thread |
- 899610 |
+ 870894 |
| io_done |
@@ -85,39 +85,39 @@
| io_parity_write_mono |
- 0 |
+ 4687 |
| io_parity_write_thread |
- 558701 |
+ 553420 |
| io_position_next |
- 162223 |
+ 161997 |
| io_read_next_mono |
- 0 |
+ 4688 |
| io_read_next_thread |
- 150031 |
+ 145244 |
| io_reader_sched |
- 162223 |
+ 161997 |
| io_reader_step |
- 1192431 |
+ 1162427 |
| io_reader_thread |
- 654 |
+ 647 |
| io_reader_worker |
- 1110427 |
+ 1081680 |
| io_refresh_mono |
@@ -129,59 +129,59 @@
| io_start_mono |
- 0 |
+ 1 |
| io_start_thread |
- 96 |
+ 95 |
| io_stop_mono |
- 0 |
+ 1 |
| io_stop_thread |
- 96 |
+ 95 |
| io_task_read_mono |
- 0 |
+ 28122 |
| io_task_read_thread |
- 1110414 |
+ 1081698 |
| io_write_next_mono |
- 0 |
+ 4687 |
| io_write_next_thread |
- 114801 |
+ 110015 |
| io_write_preset_mono |
- 0 |
+ 4687 |
| io_write_preset_thread |
- 114801 |
+ 110015 |
| io_writer_sched |
- 112466 |
+ 112401 |
| io_writer_sched_empty |
- 2335 |
+ 2301 |
| io_writer_step |
- 559155 |
+ 553871 |
| io_writer_thread |
- 463 |
+ 462 |
diff --git a/cov/cmdline/io.c.gcov.html b/cov/cmdline/io.c.gcov.html
index d766ed64..448aa441 100644
--- a/cov/cmdline/io.c.gcov.html
+++ b/cov/cmdline/io.c.gcov.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
+
-
+
 |
@@ -84,146 +84,146 @@
22 : /**
23 : * Get the next block position to process.
24 : */
- 25 162223 : static block_off_t io_position_next(struct snapraid_io* io)
+ 25 161997 : static block_off_t io_position_next(struct snapraid_io* io)
26 : {
27 : block_off_t blockcur;
28 :
29 : /* get the next position */
- 30 647783 : while (io->block_next < io->block_max && !io->block_is_enabled(io->block_arg, io->block_next))
- 31 323337 : ++io->block_next;
+ 30 647430 : while (io->block_next < io->block_max && !io->block_is_enabled(io->block_arg, io->block_next))
+ 31 323436 : ++io->block_next;
32 :
- 33 162223 : blockcur = io->block_next;
+ 33 161997 : blockcur = io->block_next;
34 :
35 : /* next block for the next call */
- 36 162223 : ++io->block_next;
+ 36 161997 : ++io->block_next;
37 :
- 38 162223 : return blockcur;
+ 38 161997 : return blockcur;
39 : }
40 :
41 : /**
42 : * Setup the next pending task for all readers.
43 : */
- 44 162223 : static void io_reader_sched(struct snapraid_io* io, int task_index, block_off_t blockcur)
+ 44 161997 : static void io_reader_sched(struct snapraid_io* io, int task_index, block_off_t blockcur)
45 : {
46 : unsigned i;
47 :
- 48 1356349 : for (i = 0; i < io->reader_max; ++i) {
- 49 1194126 : struct snapraid_worker* worker = &io->reader_map[i];
- 50 1194126 : struct snapraid_task* task = &worker->task_map[task_index];
+ 48 1354767 : for (i = 0; i < io->reader_max; ++i) {
+ 49 1192770 : struct snapraid_worker* worker = &io->reader_map[i];
+ 50 1192770 : struct snapraid_task* task = &worker->task_map[task_index];
51 :
52 : /* setup the new pending task */
- 53 1194126 : if (blockcur < io->block_max)
- 54 1110414 : task->state = TASK_STATE_READY;
+ 53 1192770 : if (blockcur < io->block_max)
+ 54 1109820 : task->state = TASK_STATE_READY;
55 : else
- 56 83712 : task->state = TASK_STATE_EMPTY;
+ 56 82950 : task->state = TASK_STATE_EMPTY;
57 :
- 58 1194126 : task->path[0] = 0;
- 59 1194126 : if (worker->handle)
- 60 973338 : task->disk = worker->handle->disk;
+ 58 1192770 : task->path[0] = 0;
+ 59 1192770 : if (worker->handle)
+ 60 971982 : task->disk = worker->handle->disk;
61 : else
62 220788 : task->disk = 0;
- 63 1194126 : task->buffer = io->buffer_map[task_index][worker->buffer_skew + i];
- 64 1194126 : task->position = blockcur;
- 65 1194126 : task->block = 0;
- 66 1194126 : task->file = 0;
- 67 1194126 : task->file_pos = 0;
- 68 1194126 : task->read_size = 0;
- 69 1194126 : task->is_timestamp_different = 0;
+ 63 1192770 : task->buffer = io->buffer_map[task_index][worker->buffer_skew + i];
+ 64 1192770 : task->position = blockcur;
+ 65 1192770 : task->block = 0;
+ 66 1192770 : task->file = 0;
+ 67 1192770 : task->file_pos = 0;
+ 68 1192770 : task->read_size = 0;
+ 69 1192770 : task->is_timestamp_different = 0;
70 : }
- 71 162223 : }
+ 71 161997 : }
72 :
73 : /**
74 : * Setup the next pending task for all writers.
75 : */
- 76 112466 : static void io_writer_sched(struct snapraid_io* io, int task_index, block_off_t blockcur)
+ 76 112401 : static void io_writer_sched(struct snapraid_io* io, int task_index, block_off_t blockcur)
77 : {
78 : unsigned i;
79 :
- 80 657157 : for (i = 0; i < io->writer_max; ++i) {
- 81 544691 : struct snapraid_worker* worker = &io->writer_map[i];
- 82 544691 : struct snapraid_task* task = &worker->task_map[task_index];
+ 80 656702 : for (i = 0; i < io->writer_max; ++i) {
+ 81 544301 : struct snapraid_worker* worker = &io->writer_map[i];
+ 82 544301 : struct snapraid_task* task = &worker->task_map[task_index];
83 :
84 : /* setup the new pending task */
- 85 544691 : task->state = TASK_STATE_READY;
- 86 544691 : task->path[0] = 0;
- 87 544691 : task->disk = 0;
- 88 544691 : task->buffer = io->buffer_map[task_index][worker->buffer_skew + i];
- 89 544691 : task->position = blockcur;
- 90 544691 : task->block = 0;
- 91 544691 : task->file = 0;
- 92 544691 : task->file_pos = 0;
- 93 544691 : task->read_size = 0;
- 94 544691 : task->is_timestamp_different = 0;
+ 85 544301 : task->state = TASK_STATE_READY;
+ 86 544301 : task->path[0] = 0;
+ 87 544301 : task->disk = 0;
+ 88 544301 : task->buffer = io->buffer_map[task_index][worker->buffer_skew + i];
+ 89 544301 : task->position = blockcur;
+ 90 544301 : task->block = 0;
+ 91 544301 : task->file = 0;
+ 92 544301 : task->file_pos = 0;
+ 93 544301 : task->read_size = 0;
+ 94 544301 : task->is_timestamp_different = 0;
95 : }
- 96 112466 : }
+ 96 112401 : }
97 :
98 : /**
99 : * Setup an empty next pending task for all writers.
100 : */
- 101 2335 : static void io_writer_sched_empty(struct snapraid_io* io, int task_index, block_off_t blockcur)
+ 101 2301 : static void io_writer_sched_empty(struct snapraid_io* io, int task_index, block_off_t blockcur)
102 : {
103 : unsigned i;
104 :
- 105 16345 : for (i = 0; i < io->writer_max; ++i) {
- 106 14010 : struct snapraid_worker* worker = &io->writer_map[i];
- 107 14010 : struct snapraid_task* task = &worker->task_map[task_index];
+ 105 16107 : for (i = 0; i < io->writer_max; ++i) {
+ 106 13806 : struct snapraid_worker* worker = &io->writer_map[i];
+ 107 13806 : struct snapraid_task* task = &worker->task_map[task_index];
108 :
109 : /* setup the new pending task */
- 110 14010 : task->state = TASK_STATE_EMPTY;
- 111 14010 : task->path[0] = 0;
- 112 14010 : task->disk = 0;
- 113 14010 : task->buffer = 0;
- 114 14010 : task->position = blockcur;
- 115 14010 : task->block = 0;
- 116 14010 : task->file = 0;
- 117 14010 : task->file_pos = 0;
- 118 14010 : task->read_size = 0;
- 119 14010 : task->is_timestamp_different = 0;
+ 110 13806 : task->state = TASK_STATE_EMPTY;
+ 111 13806 : task->path[0] = 0;
+ 112 13806 : task->disk = 0;
+ 113 13806 : task->buffer = 0;
+ 114 13806 : task->position = blockcur;
+ 115 13806 : task->block = 0;
+ 116 13806 : task->file = 0;
+ 117 13806 : task->file_pos = 0;
+ 118 13806 : task->read_size = 0;
+ 119 13806 : task->is_timestamp_different = 0;
120 : }
- 121 2335 : }
+ 121 2301 : }
122 :
123 : /*****************************************************************************/
124 : /* mono thread */
125 :
- 126 0 : static block_off_t io_read_next_mono(struct snapraid_io* io, void*** buffer)
+ 126 4688 : static block_off_t io_read_next_mono(struct snapraid_io* io, void*** buffer)
127 : {
128 : block_off_t blockcur_schedule;
129 :
130 : /* reset the index */
- 131 0 : io->reader_index = 0;
+ 131 4688 : io->reader_index = 0;
132 :
- 133 0 : blockcur_schedule = io_position_next(io);
+ 133 4688 : blockcur_schedule = io_position_next(io);
134 :
135 : /* schedule the next read */
- 136 0 : io_reader_sched(io, 0, blockcur_schedule);
+ 136 4688 : io_reader_sched(io, 0, blockcur_schedule);
137 :
138 : /* set the buffer to use */
- 139 0 : *buffer = io->buffer_map[0];
+ 139 4688 : *buffer = io->buffer_map[0];
140 :
- 141 0 : return blockcur_schedule;
+ 141 4688 : return blockcur_schedule;
142 : }
143 :
- 144 0 : static void io_write_preset_mono(struct snapraid_io* io, block_off_t blockcur, int skip)
+ 144 4687 : static void io_write_preset_mono(struct snapraid_io* io, block_off_t blockcur, int skip)
145 : {
146 : unsigned i;
147 :
148 : /* reset the index */
- 149 0 : io->writer_index = 0;
+ 149 4687 : io->writer_index = 0;
150 :
151 : /* clear errors */
- 152 0 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i)
- 153 0 : io->writer_error[i] = 0;
+ 152 23435 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i)
+ 153 18748 : io->writer_error[i] = 0;
154 :
- 155 0 : if (skip) {
+ 155 4687 : if (skip) {
156 : /* skip the next write */
157 0 : io_writer_sched_empty(io, 0, blockcur);
158 : } else {
159 : /* schedule the next write */
- 160 0 : io_writer_sched(io, 0, blockcur);
+ 160 4687 : io_writer_sched(io, 0, blockcur);
161 : }
- 162 0 : }
+ 162 4687 : }
163 :
- 164 0 : static void io_write_next_mono(struct snapraid_io* io, block_off_t blockcur, int skip, int* writer_error)
+ 164 4687 : static void io_write_next_mono(struct snapraid_io* io, block_off_t blockcur, int skip, int* writer_error)
165 : {
166 : unsigned i;
167 :
@@ -231,46 +231,46 @@
169 : (void)skip;
170 :
171 : /* report errors */
- 172 0 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i)
- 173 0 : writer_error[i] = io->writer_error[i];
- 174 0 : }
+ 172 23435 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i)
+ 173 18748 : writer_error[i] = io->writer_error[i];
+ 174 4687 : }
175 :
176 0 : static void io_refresh_mono(struct snapraid_io* io)
177 : {
178 : (void)io;
179 0 : }
180 :
- 181 0 : static struct snapraid_task* io_task_read_mono(struct snapraid_io* io, unsigned base, unsigned count, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
+ 181 28122 : static struct snapraid_task* io_task_read_mono(struct snapraid_io* io, unsigned base, unsigned count, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
182 : {
183 : struct snapraid_worker* worker;
184 : struct snapraid_task* task;
185 : unsigned i;
186 :
187 : /* get the next task */
- 188 0 : i = io->reader_index++;
+ 188 28122 : i = io->reader_index++;
189 :
- 190 0 : assert(base <= i && i < base + count);
+ 190 28122 : assert(base <= i && i < base + count);
191 :
- 192 0 : worker = &io->reader_map[i];
- 193 0 : task = &worker->task_map[0];
+ 192 28122 : worker = &io->reader_map[i];
+ 193 28122 : task = &worker->task_map[0];
194 :
195 : /* do the work */
- 196 0 : if (task->state != TASK_STATE_EMPTY)
- 197 0 : worker->func(worker, task);
+ 196 28122 : if (task->state != TASK_STATE_EMPTY)
+ 197 28122 : worker->func(worker, task);
198 :
199 : /* return the position */
- 200 0 : *pos = i - base;
+ 200 28122 : *pos = i - base;
201 :
202 : /* store the waiting index */
- 203 0 : waiting_map[0] = i - base;
- 204 0 : *waiting_mac = 1;
+ 203 28122 : waiting_map[0] = i - base;
+ 204 28122 : *waiting_mac = 1;
205 :
- 206 0 : return task;
+ 206 28122 : return task;
207 : }
208 :
- 209 0 : static struct snapraid_task* io_data_read_mono(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
+ 209 28122 : static struct snapraid_task* io_data_read_mono(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
210 : {
- 211 0 : return io_task_read_mono(io, io->data_base, io->data_count, pos, waiting_map, waiting_mac);
+ 211 28122 : return io_task_read_mono(io, io->data_base, io->data_count, pos, waiting_map, waiting_mac);
212 : }
213 :
214 0 : static struct snapraid_task* io_parity_read_mono(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
@@ -278,47 +278,47 @@
216 0 : return io_task_read_mono(io, io->parity_base, io->parity_count, pos, waiting_map, waiting_mac);
217 : }
218 :
- 219 0 : static void io_parity_write_mono(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
+ 219 4687 : static void io_parity_write_mono(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
220 : {
221 : struct snapraid_worker* worker;
222 : struct snapraid_task* task;
223 : unsigned i;
224 :
225 : /* get the next task */
- 226 0 : i = io->writer_index++;
+ 226 4687 : i = io->writer_index++;
227 :
- 228 0 : worker = &io->writer_map[i];
- 229 0 : task = &worker->task_map[0];
+ 228 4687 : worker = &io->writer_map[i];
+ 229 4687 : task = &worker->task_map[0];
230 :
- 231 0 : io->writer_error[i] = 0;
+ 231 4687 : io->writer_error[i] = 0;
232 :
233 : /* do the work */
- 234 0 : if (task->state != TASK_STATE_EMPTY)
- 235 0 : worker->func(worker, task);
+ 234 4687 : if (task->state != TASK_STATE_EMPTY)
+ 235 4687 : worker->func(worker, task);
236 :
237 : /* return the position */
- 238 0 : *pos = i;
+ 238 4687 : *pos = i;
239 :
240 : /* store the waiting index */
- 241 0 : waiting_map[0] = i;
- 242 0 : *waiting_mac = 1;
- 243 0 : }
+ 241 4687 : waiting_map[0] = i;
+ 242 4687 : *waiting_mac = 1;
+ 243 4687 : }
244 :
- 245 0 : static void io_start_mono(struct snapraid_io* io,
+ 245 1 : static void io_start_mono(struct snapraid_io* io,
246 : block_off_t blockstart, block_off_t blockmax,
247 : int (*block_is_enabled)(void* arg, block_off_t), void* blockarg)
248 : {
- 249 0 : io->block_start = blockstart;
- 250 0 : io->block_max = blockmax;
- 251 0 : io->block_is_enabled = block_is_enabled;
- 252 0 : io->block_arg = blockarg;
- 253 0 : io->block_next = blockstart;
- 254 0 : }
+ 249 1 : io->block_start = blockstart;
+ 250 1 : io->block_max = blockmax;
+ 251 1 : io->block_is_enabled = block_is_enabled;
+ 252 1 : io->block_arg = blockarg;
+ 253 1 : io->block_next = blockstart;
+ 254 1 : }
255 :
- 256 0 : static void io_stop_mono(struct snapraid_io* io)
+ 256 1 : static void io_stop_mono(struct snapraid_io* io)
257 : {
258 : (void)io;
- 259 0 : }
+ 259 1 : }
260 :
261 : /*****************************************************************************/
262 : /* multi thread */
@@ -331,55 +331,55 @@
269 : *
270 : * This is the synchronization point for workers with the io.
271 : */
- 272 1192431 : static struct snapraid_task* io_reader_step(struct snapraid_worker* worker)
+ 272 1162427 : static struct snapraid_task* io_reader_step(struct snapraid_worker* worker)
273 : {
- 274 1192431 : struct snapraid_io* io = worker->io;
+ 274 1162427 : struct snapraid_io* io = worker->io;
275 :
276 : /* the synchronization is protected by the io mutex */
- 277 1192431 : thread_mutex_lock(&io->io_mutex);
+ 277 1162427 : thread_mutex_lock(&io->io_mutex);
278 :
279 : while (1) {
280 : unsigned next_index;
281 :
282 : /* check if the worker has to exit */
283 : /* even if there is work to do */
- 284 2189373 : if (io->done) {
- 285 654 : thread_mutex_unlock(&io->io_mutex);
- 286 654 : return 0;
+ 284 2113405 : if (io->done) {
+ 285 648 : thread_mutex_unlock(&io->io_mutex);
+ 286 648 : return 0;
287 : }
288 :
289 : /* get the next pending task */
- 290 2188719 : next_index = (worker->index + 1) % io->io_max;
+ 290 2112757 : next_index = (worker->index + 1) % io->io_max;
291 :
292 : /* if the queue of pending tasks is not empty */
- 293 2188719 : if (next_index != io->reader_index) {
+ 293 2112757 : if (next_index != io->reader_index) {
294 : struct snapraid_task* task;
295 :
296 : /* the index that the IO may be waiting for */
- 297 1192780 : unsigned waiting_index = io->reader_index;
+ 297 1162458 : unsigned waiting_index = io->reader_index;
298 :
299 : /* the index that worker just completed */
- 300 1192780 : unsigned done_index = worker->index;
+ 300 1162458 : unsigned done_index = worker->index;
301 :
302 : /* get the new working task */
- 303 1192780 : worker->index = next_index;
- 304 1192780 : task = &worker->task_map[worker->index];
+ 303 1162458 : worker->index = next_index;
+ 304 1162458 : task = &worker->task_map[worker->index];
305 :
306 : /* if the just completed task is at this index */
- 307 1192780 : if (done_index == waiting_index) {
+ 307 1162458 : if (done_index == waiting_index) {
308 : /* notify the IO that a new read is complete */
- 309 1809 : thread_cond_signal_and_unlock(&io->read_done, &io->io_mutex);
+ 309 2144 : thread_cond_signal_and_unlock(&io->read_done, &io->io_mutex);
310 : } else {
- 311 1190971 : thread_mutex_unlock(&io->io_mutex);
+ 311 1160314 : thread_mutex_unlock(&io->io_mutex);
312 : }
313 :
314 : /* return the new task */
- 315 1192656 : return task;
+ 315 1162363 : return task;
316 : }
317 :
318 : /* otherwise wait for a read_sched event */
- 319 995939 : thread_cond_wait(&io->read_sched, &io->io_mutex);
- 320 995939 : }
+ 319 950299 : thread_cond_wait(&io->read_sched, &io->io_mutex);
+ 320 950299 : }
321 : }
322 :
323 : /**
@@ -387,61 +387,61 @@
325 : *
326 : * This is the synchronization point for workers with the io.
327 : */
- 328 559155 : static struct snapraid_task* io_writer_step(struct snapraid_worker* worker, int state)
+ 328 553871 : static struct snapraid_task* io_writer_step(struct snapraid_worker* worker, int state)
329 : {
- 330 559155 : struct snapraid_io* io = worker->io;
+ 330 553871 : struct snapraid_io* io = worker->io;
331 : int error_index;
332 :
333 : /* the synchronization is protected by the io mutex */
- 334 559155 : thread_mutex_lock(&io->io_mutex);
+ 334 553871 : thread_mutex_lock(&io->io_mutex);
335 :
336 : /* counts the number of errors in the global state */
- 337 559164 : error_index = state - IO_WRITER_ERROR_BASE;
- 338 559164 : if (error_index >= 0 && error_index < IO_WRITER_ERROR_MAX)
+ 337 553882 : error_index = state - IO_WRITER_ERROR_BASE;
+ 338 553882 : if (error_index >= 0 && error_index < IO_WRITER_ERROR_MAX)
339 0 : ++io->writer_error[error_index];
340 :
341 : while (1) {
342 : unsigned next_index;
343 :
344 : /* get the next pending task */
- 345 620524 : next_index = (worker->index + 1) % io->io_max;
+ 345 630858 : next_index = (worker->index + 1) % io->io_max;
346 :
347 : /* if the queue of pending tasks is not empty */
- 348 620524 : if (next_index != io->writer_index) {
+ 348 630858 : if (next_index != io->writer_index) {
349 : struct snapraid_task* task;
350 :
351 : /* the index that the IO may be waiting for */
- 352 558701 : unsigned waiting_index = (io->writer_index + 1) % io->io_max;
+ 352 553420 : unsigned waiting_index = (io->writer_index + 1) % io->io_max;
353 :
354 : /* the index that worker just completed */
- 355 558701 : unsigned done_index = worker->index;
+ 355 553420 : unsigned done_index = worker->index;
356 :
357 : /* get the new working task */
- 358 558701 : worker->index = next_index;
- 359 558701 : task = &worker->task_map[worker->index];
+ 358 553420 : worker->index = next_index;
+ 359 553420 : task = &worker->task_map[worker->index];
360 :
361 : /* if the just completed task is at this index */
- 362 558701 : if (done_index == waiting_index) {
+ 362 553420 : if (done_index == waiting_index) {
363 : /* notify the IO that a new write is complete */
- 364 85443 : thread_cond_signal_and_unlock(&io->write_done, &io->io_mutex);
+ 364 82404 : thread_cond_signal_and_unlock(&io->write_done, &io->io_mutex);
365 : } else {
- 366 473258 : thread_mutex_unlock(&io->io_mutex);
+ 366 471016 : thread_mutex_unlock(&io->io_mutex);
367 : }
368 :
369 : /* return the new task */
- 370 558690 : return task;
+ 370 553404 : return task;
371 : }
372 :
373 : /* check if the worker has to exit */
374 : /* but only if there is no work to do */
- 375 61823 : if (io->done) {
- 376 463 : thread_mutex_unlock(&io->io_mutex);
- 377 463 : return 0;
+ 375 77438 : if (io->done) {
+ 376 462 : thread_mutex_unlock(&io->io_mutex);
+ 377 462 : return 0;
378 : }
379 :
380 : /* otherwise wait for a write_sched event */
- 381 61360 : thread_cond_wait(&io->write_sched, &io->io_mutex);
- 382 61360 : }
+ 381 76976 : thread_cond_wait(&io->write_sched, &io->io_mutex);
+ 382 76976 : }
383 : }
384 :
385 : /**
@@ -449,87 +449,87 @@
387 : *
388 : * This is the synchronization point for workers with the io.
389 : */
- 390 150031 : static block_off_t io_read_next_thread(struct snapraid_io* io, void*** buffer)
+ 390 145244 : static block_off_t io_read_next_thread(struct snapraid_io* io, void*** buffer)
391 : {
392 : block_off_t blockcur_schedule;
393 : block_off_t blockcur_caller;
394 : unsigned i;
395 :
396 : /* get the next parity position to process */
- 397 150031 : blockcur_schedule = io_position_next(io);
+ 397 145244 : blockcur_schedule = io_position_next(io);
398 :
399 : /* ensure that all data/parity was read */
- 400 150031 : assert(io->reader_list[0] == io->reader_max);
+ 400 145244 : assert(io->reader_list[0] == io->reader_max);
401 :
402 : /* setup the list of workers to process */
- 403 1411130 : for (i = 0; i <= io->reader_max; ++i)
- 404 1261099 : io->reader_list[i] = i;
+ 403 1372834 : for (i = 0; i <= io->reader_max; ++i)
+ 404 1227590 : io->reader_list[i] = i;
405 :
406 : /* the synchronization is protected by the io mutex */
- 407 150031 : thread_mutex_lock(&io->io_mutex);
+ 407 145244 : thread_mutex_lock(&io->io_mutex);
408 :
409 : /* schedule the next read */
- 410 150031 : io_reader_sched(io, io->reader_index, blockcur_schedule);
+ 410 145244 : io_reader_sched(io, io->reader_index, blockcur_schedule);
411 :
412 : /* set the index for the tasks to return to the caller */
- 413 150031 : io->reader_index = (io->reader_index + 1) % io->io_max;
+ 413 145244 : io->reader_index = (io->reader_index + 1) % io->io_max;
414 :
415 : /* get the position to operate at high level from one task */
- 416 150031 : blockcur_caller = io->reader_map[0].task_map[io->reader_index].position;
+ 416 145244 : blockcur_caller = io->reader_map[0].task_map[io->reader_index].position;
417 :
418 : /* set the buffer to use */
- 419 150031 : *buffer = io->buffer_map[io->reader_index];
+ 419 145244 : *buffer = io->buffer_map[io->reader_index];
420 :
421 : /* signal all the workers that there is a new pending task */
- 422 150031 : thread_cond_broadcast_and_unlock(&io->read_sched, &io->io_mutex);
+ 422 145244 : thread_cond_broadcast_and_unlock(&io->read_sched, &io->io_mutex);
423 :
- 424 150031 : return blockcur_caller;
+ 424 145244 : return blockcur_caller;
425 : }
426 :
- 427 114801 : static void io_write_preset_thread(struct snapraid_io* io, block_off_t blockcur, int skip)
+ 427 110015 : static void io_write_preset_thread(struct snapraid_io* io, block_off_t blockcur, int skip)
428 : {
429 : (void)io;
430 : (void)blockcur;
431 : (void)skip;
- 432 114801 : }
+ 432 110015 : }
433 :
- 434 114801 : static void io_write_next_thread(struct snapraid_io* io, block_off_t blockcur, int skip, int* writer_error)
+ 434 110015 : static void io_write_next_thread(struct snapraid_io* io, block_off_t blockcur, int skip, int* writer_error)
435 : {
436 : unsigned i;
437 :
438 : /* ensure that all parity was written */
- 439 114801 : assert(io->writer_list[0] == io->writer_max);
+ 439 110015 : assert(io->writer_list[0] == io->writer_max);
440 :
441 : /* setup the list of workers to process */
- 442 788303 : for (i = 0; i <= io->writer_max; ++i)
- 443 673502 : io->writer_list[i] = i;
+ 442 773450 : for (i = 0; i <= io->writer_max; ++i)
+ 443 663435 : io->writer_list[i] = i;
444 :
445 : /* the synchronization is protected by the io mutex */
- 446 114801 : thread_mutex_lock(&io->io_mutex);
+ 446 110015 : thread_mutex_lock(&io->io_mutex);
447 :
448 : /* report errors */
- 449 574005 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i) {
- 450 459204 : writer_error[i] = io->writer_error[i];
- 451 459204 : io->writer_error[i] = 0;
+ 449 550075 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i) {
+ 450 440060 : writer_error[i] = io->writer_error[i];
+ 451 440060 : io->writer_error[i] = 0;
452 : }
453 :
- 454 114801 : if (skip) {
+ 454 110015 : if (skip) {
455 : /* skip the next write */
- 456 2335 : io_writer_sched_empty(io, io->writer_index, blockcur);
+ 456 2301 : io_writer_sched_empty(io, io->writer_index, blockcur);
457 : } else {
458 : /* schedule the next write */
- 459 112466 : io_writer_sched(io, io->writer_index, blockcur);
+ 459 107714 : io_writer_sched(io, io->writer_index, blockcur);
460 : }
461 :
462 : /* at this point the writers must be in sync with the readers */
- 463 114801 : assert(io->writer_index == io->reader_index);
+ 463 110015 : assert(io->writer_index == io->reader_index);
464 :
465 : /* set the index to be used for the next write */
- 466 114801 : io->writer_index = (io->writer_index + 1) % io->io_max;
+ 466 110015 : io->writer_index = (io->writer_index + 1) % io->io_max;
467 :
468 : /* signal all the workers that there is a new pending task */
- 469 114801 : thread_cond_broadcast_and_unlock(&io->write_sched, &io->io_mutex);
- 470 114801 : }
+ 469 110015 : thread_cond_broadcast_and_unlock(&io->write_sched, &io->io_mutex);
+ 470 110015 : }
471 :
472 0 : static void io_refresh_thread(struct snapraid_io* io)
473 : {
@@ -577,18 +577,18 @@
515 0 : thread_mutex_unlock(&io->io_mutex);
516 0 : }
517 :
- 518 1110414 : static struct snapraid_task* io_task_read_thread(struct snapraid_io* io, unsigned base, unsigned count, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
+ 518 1081698 : static struct snapraid_task* io_task_read_thread(struct snapraid_io* io, unsigned base, unsigned count, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
519 : {
520 : unsigned waiting_cycle;
521 :
522 : /* count the waiting cycle */
- 523 1110414 : waiting_cycle = 0;
+ 523 1081698 : waiting_cycle = 0;
524 :
525 : /* clear the waiting indexes */
- 526 1110414 : *waiting_mac = 0;
+ 526 1081698 : *waiting_mac = 0;
527 :
528 : /* the synchronization is protected by the io mutex */
- 529 1110414 : thread_mutex_lock(&io->io_mutex);
+ 529 1081698 : thread_mutex_lock(&io->io_mutex);
530 :
531 : while (1) {
532 : unsigned char* let;
@@ -597,67 +597,67 @@
535 : /* get the index the IO is using */
536 : /* we must ensure that this index has not a read in progress */
537 : /* to avoid a concurrent access */
- 538 1112080 : busy_index = io->reader_index;
+ 538 1083699 : busy_index = io->reader_index;
539 :
540 : /* search for a worker that has already finished */
- 541 1112080 : let = &io->reader_list[0];
+ 541 1083699 : let = &io->reader_list[0];
542 : while (1) {
- 543 1120487 : unsigned i = *let;
+ 543 1091880 : unsigned i = *let;
544 :
545 : /* if we are at the end */
- 546 1120487 : if (i == io->reader_max)
- 547 1666 : break;
+ 546 1091880 : if (i == io->reader_max)
+ 547 2001 : break;
548 :
549 : /* if it's in range */
- 550 1118821 : if (base <= i && i < base + count) {
+ 550 1089879 : if (base <= i && i < base + count) {
551 : struct snapraid_worker* worker;
552 :
553 : /* if it's the first cycle */
- 554 1118503 : if (waiting_cycle == 0) {
+ 554 1088355 : if (waiting_cycle == 0) {
555 : /* store the waiting indexes */
- 556 1116663 : waiting_map[(*waiting_mac)++] = i - base;
+ 556 1085928 : waiting_map[(*waiting_mac)++] = i - base;
557 : }
558 :
- 559 1118503 : worker = &io->reader_map[i];
+ 559 1088355 : worker = &io->reader_map[i];
560 :
561 : /* if the worker has finished this index */
- 562 1118503 : if (busy_index != worker->index) {
+ 562 1088355 : if (busy_index != worker->index) {
563 : struct snapraid_task* task;
564 :
- 565 1110414 : task = &worker->task_map[io->reader_index];
+ 565 1081698 : task = &worker->task_map[io->reader_index];
566 :
- 567 1110414 : thread_mutex_unlock(&io->io_mutex);
+ 567 1081698 : thread_mutex_unlock(&io->io_mutex);
568 :
569 : /* mark the worker as processed */
570 : /* setting the previous one to point at the next one */
- 571 1110414 : *let = io->reader_list[i + 1];
+ 571 1081698 : *let = io->reader_list[i + 1];
572 :
573 : /* return the position */
- 574 1110414 : *pos = i - base;
+ 574 1081698 : *pos = i - base;
575 :
576 : /* on the first cycle, no one is waiting */
- 577 1110414 : if (waiting_cycle == 0)
- 578 1108759 : *waiting_mac = 0;
+ 577 1081698 : if (waiting_cycle == 0)
+ 578 1079732 : *waiting_mac = 0;
579 :
- 580 2220828 : return task;
+ 580 2163396 : return task;
581 : }
582 : }
583 :
584 : /* next position to check */
- 585 8407 : let = &io->reader_list[i + 1];
- 586 8407 : }
+ 585 8181 : let = &io->reader_list[i + 1];
+ 586 8181 : }
587 :
588 : /* if no worker is ready, wait for an event */
- 589 1666 : thread_cond_wait(&io->read_done, &io->io_mutex);
+ 589 2001 : thread_cond_wait(&io->read_done, &io->io_mutex);
590 :
591 : /* count the cycles */
- 592 1666 : ++waiting_cycle;
- 593 1666 : }
+ 592 2001 : ++waiting_cycle;
+ 593 2001 : }
594 : }
595 :
- 596 899610 : static struct snapraid_task* io_data_read_thread(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
+ 596 870894 : static struct snapraid_task* io_data_read_thread(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
597 : {
- 598 899610 : return io_task_read_thread(io, io->data_base, io->data_count, pos, waiting_map, waiting_mac);
+ 598 870894 : return io_task_read_thread(io, io->data_base, io->data_count, pos, waiting_map, waiting_mac);
599 : }
600 :
601 210804 : static struct snapraid_task* io_parity_read_thread(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
@@ -665,18 +665,18 @@
603 210804 : return io_task_read_thread(io, io->parity_base, io->parity_count, pos, waiting_map, waiting_mac);
604 : }
605 :
- 606 558701 : static void io_parity_write_thread(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
+ 606 553420 : static void io_parity_write_thread(struct snapraid_io* io, unsigned* pos, unsigned* waiting_map, unsigned* waiting_mac)
607 : {
608 : unsigned waiting_cycle;
609 :
610 : /* count the waiting cycle */
- 611 558701 : waiting_cycle = 0;
+ 611 553420 : waiting_cycle = 0;
612 :
613 : /* clear the waiting indexes */
- 614 558701 : *waiting_mac = 0;
+ 614 553420 : *waiting_mac = 0;
615 :
616 : /* the synchronization is protected by the io mutex */
- 617 558701 : thread_mutex_lock(&io->io_mutex);
+ 617 553420 : thread_mutex_lock(&io->io_mutex);
618 :
619 : while (1) {
620 : unsigned char* let;
@@ -687,218 +687,218 @@
625 : /* to avoid a concurrent access */
626 : /* note that we are already sure that a write is not in progress */
627 : /* at the index the IO is using at now */
- 628 625597 : busy_index = (io->writer_index + 1) % io->io_max;
+ 628 619337 : busy_index = (io->writer_index + 1) % io->io_max;
629 :
630 : /* search for a worker that has already finished */
- 631 625597 : let = &io->writer_list[0];
+ 631 619337 : let = &io->writer_list[0];
632 : while (1) {
- 633 852608 : unsigned i = *let;
+ 633 866114 : unsigned i = *let;
634 : struct snapraid_worker* worker;
635 :
636 : /* if we are at the end */
- 637 852608 : if (i == io->writer_max)
- 638 66896 : break;
+ 637 866114 : if (i == io->writer_max)
+ 638 65917 : break;
639 :
640 : /* if it's the first cycle */
- 641 785712 : if (waiting_cycle == 0) {
+ 641 800197 : if (waiting_cycle == 0) {
642 : /* store the waiting indexes */
- 643 717809 : waiting_map[(*waiting_mac)++] = i;
+ 643 733517 : waiting_map[(*waiting_mac)++] = i;
644 : }
645 :
- 646 785712 : worker = &io->writer_map[i];
+ 646 800197 : worker = &io->writer_map[i];
647 :
648 : /* the two indexes cannot be equal */
- 649 785712 : assert(io->writer_index != worker->index);
+ 649 800197 : assert(io->writer_index != worker->index);
650 :
651 : /* if the worker has finished this index */
- 652 785712 : if (busy_index != worker->index) {
- 653 558701 : thread_mutex_unlock(&io->io_mutex);
+ 652 800197 : if (busy_index != worker->index) {
+ 653 553420 : thread_mutex_unlock(&io->io_mutex);
654 :
655 : /* mark the worker as processed */
656 : /* setting the previous one to point at the next one */
- 657 558701 : *let = io->writer_list[i + 1];
+ 657 553420 : *let = io->writer_list[i + 1];
658 :
659 : /* return the position */
- 660 558701 : *pos = i;
+ 660 553420 : *pos = i;
661 :
662 : /* on the first cycle, no one is waiting */
- 663 558701 : if (waiting_cycle == 0)
- 664 491805 : *waiting_mac = 0;
+ 663 553420 : if (waiting_cycle == 0)
+ 664 487503 : *waiting_mac = 0;
665 :
- 666 1117402 : return;
+ 666 1106840 : return;
667 : }
668 :
669 : /* next position to check */
- 670 227011 : let = &io->writer_list[i + 1];
- 671 227011 : }
+ 670 246777 : let = &io->writer_list[i + 1];
+ 671 246777 : }
672 :
673 : /* if no worker is ready, wait for an event */
- 674 66896 : thread_cond_wait(&io->write_done, &io->io_mutex);
+ 674 65917 : thread_cond_wait(&io->write_done, &io->io_mutex);
675 :
676 : /* count the cycles */
- 677 66896 : ++waiting_cycle;
- 678 66896 : }
+ 677 65917 : ++waiting_cycle;
+ 678 65917 : }
679 : }
680 :
- 681 1110427 : static void io_reader_worker(struct snapraid_worker* worker, struct snapraid_task* task)
+ 681 1081680 : static void io_reader_worker(struct snapraid_worker* worker, struct snapraid_task* task)
682 : {
683 : /* if we reached the end */
- 684 1110427 : if (task->position >= worker->io->block_max) {
+ 684 1081680 : if (task->position >= worker->io->block_max) {
685 : /* complete a dummy task */
686 120 : task->state = TASK_STATE_EMPTY;
687 : } else {
- 688 1110307 : worker->func(worker, task);
+ 688 1081560 : worker->func(worker, task);
689 : }
- 690 1109892 : }
+ 690 1081228 : }
691 :
- 692 654 : static void* io_reader_thread(void* arg)
+ 692 647 : static void* io_reader_thread(void* arg)
693 : {
- 694 654 : struct snapraid_worker* worker = arg;
+ 694 647 : struct snapraid_worker* worker = arg;
695 :
696 : /* force completion of the first task */
- 697 654 : io_reader_worker(worker, &worker->task_map[0]);
+ 697 647 : io_reader_worker(worker, &worker->task_map[0]);
698 :
699 : while (1) {
700 : struct snapraid_task* task;
701 :
702 : /* get the new task */
- 703 1192158 : task = io_reader_step(worker);
+ 703 1162533 : task = io_reader_step(worker);
704 :
705 : /* if no task, it means to exit */
- 706 1193232 : if (!task)
- 707 654 : break;
+ 706 1162963 : if (!task)
+ 707 648 : break;
708 :
709 : /* nothing more to do */
- 710 1192578 : if (task->state == TASK_STATE_EMPTY)
- 711 82770 : continue;
+ 710 1162315 : if (task->state == TASK_STATE_EMPTY)
+ 711 81255 : continue;
712 :
- 713 1109808 : assert(task->state == TASK_STATE_READY);
+ 713 1081060 : assert(task->state == TASK_STATE_READY);
714 :
715 : /* work on the assigned task */
- 716 1109808 : io_reader_worker(worker, task);
- 717 1191512 : }
+ 716 1081060 : io_reader_worker(worker, task);
+ 717 1161887 : }
718 :
- 719 654 : return 0;
+ 719 648 : return 0;
720 : }
721 :
- 722 463 : static void* io_writer_thread(void* arg)
+ 722 462 : static void* io_writer_thread(void* arg)
723 : {
- 724 463 : struct snapraid_worker* worker = arg;
- 725 463 : int latest_state = TASK_STATE_DONE;
+ 724 462 : struct snapraid_worker* worker = arg;
+ 725 462 : int latest_state = TASK_STATE_DONE;
726 :
727 : while (1) {
728 : struct snapraid_task* task;
729 :
730 : /* get the new task */
- 731 559153 : task = io_writer_step(worker, latest_state);
+ 731 553873 : task = io_writer_step(worker, latest_state);
732 :
733 : /* if no task, it means to exit */
- 734 559158 : if (!task)
- 735 463 : break;
+ 734 553876 : if (!task)
+ 735 462 : break;
736 :
737 : /* nothing more to do */
- 738 558695 : if (task->state == TASK_STATE_EMPTY) {
- 739 14011 : latest_state = TASK_STATE_DONE;
- 740 14011 : continue;
+ 738 553414 : if (task->state == TASK_STATE_EMPTY) {
+ 739 13808 : latest_state = TASK_STATE_DONE;
+ 740 13808 : continue;
741 : }
742 :
- 743 544684 : assert(task->state == TASK_STATE_READY);
+ 743 539606 : assert(task->state == TASK_STATE_READY);
744 :
745 : /* work on the assigned task */
- 746 544684 : worker->func(worker, task);
+ 746 539606 : worker->func(worker, task);
747 :
748 : /* save the resulting state */
- 749 544679 : latest_state = task->state;
- 750 558690 : }
+ 749 539603 : latest_state = task->state;
+ 750 553411 : }
751 :
- 752 463 : return 0;
+ 752 462 : return 0;
753 : }
754 :
- 755 96 : static void io_start_thread(struct snapraid_io* io,
+ 755 95 : static void io_start_thread(struct snapraid_io* io,
756 : block_off_t blockstart, block_off_t blockmax,
757 : int (*block_is_enabled)(void* arg, block_off_t), void* blockarg)
758 : {
759 : unsigned i;
760 :
- 761 96 : io->block_start = blockstart;
- 762 96 : io->block_max = blockmax;
- 763 96 : io->block_is_enabled = block_is_enabled;
- 764 96 : io->block_arg = blockarg;
- 765 96 : io->block_next = blockstart;
+ 761 95 : io->block_start = blockstart;
+ 762 95 : io->block_max = blockmax;
+ 763 95 : io->block_is_enabled = block_is_enabled;
+ 764 95 : io->block_arg = blockarg;
+ 765 95 : io->block_next = blockstart;
766 :
- 767 96 : io->done = 0;
- 768 96 : io->reader_index = io->io_max - 1;
- 769 96 : io->writer_index = 0;
+ 767 95 : io->done = 0;
+ 768 95 : io->reader_index = io->io_max - 1;
+ 769 95 : io->writer_index = 0;
770 :
771 : /* clear writer errors */
- 772 480 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i)
- 773 384 : io->writer_error[i] = 0;
+ 772 475 : for (i = 0; i < IO_WRITER_ERROR_MAX; ++i)
+ 773 380 : io->writer_error[i] = 0;
774 :
775 : /* setup the initial read pending tasks, except the latest one, */
776 : /* the latest will be initialized at the fist io_read_next() call */
- 777 12288 : for (i = 0; i < io->io_max - 1; ++i) {
- 778 12192 : block_off_t blockcur = io_position_next(io);
+ 777 12160 : for (i = 0; i < io->io_max - 1; ++i) {
+ 778 12065 : block_off_t blockcur = io_position_next(io);
779 :
- 780 12192 : io_reader_sched(io, i, blockcur);
+ 780 12065 : io_reader_sched(io, i, blockcur);
781 : }
782 :
783 : /* setup the lists of workers to process */
- 784 96 : io->reader_list[0] = io->reader_max;
- 785 655 : for (i = 0; i <= io->writer_max; ++i)
- 786 559 : io->writer_list[i] = i;
+ 784 95 : io->reader_list[0] = io->reader_max;
+ 785 652 : for (i = 0; i <= io->writer_max; ++i)
+ 786 557 : io->writer_list[i] = i;
787 :
788 : /* start the reader threads */
- 789 750 : for (i = 0; i < io->reader_max; ++i) {
- 790 654 : struct snapraid_worker* worker = &io->reader_map[i];
+ 789 743 : for (i = 0; i < io->reader_max; ++i) {
+ 790 648 : struct snapraid_worker* worker = &io->reader_map[i];
791 :
- 792 654 : worker->index = 0;
+ 792 648 : worker->index = 0;
793 :
- 794 654 : thread_create(&worker->thread, 0, io_reader_thread, worker);
+ 794 648 : thread_create(&worker->thread, 0, io_reader_thread, worker);
795 : }
796 :
797 : /* start the writer threads */
- 798 559 : for (i = 0; i < io->writer_max; ++i) {
- 799 463 : struct snapraid_worker* worker = &io->writer_map[i];
+ 798 557 : for (i = 0; i < io->writer_max; ++i) {
+ 799 462 : struct snapraid_worker* worker = &io->writer_map[i];
800 :
- 801 463 : worker->index = io->io_max - 1;
+ 801 462 : worker->index = io->io_max - 1;
802 :
- 803 463 : thread_create(&worker->thread, 0, io_writer_thread, worker);
+ 803 462 : thread_create(&worker->thread, 0, io_writer_thread, worker);
804 : }
- 805 96 : }
+ 805 95 : }
806 :
- 807 96 : static void io_stop_thread(struct snapraid_io* io)
+ 807 95 : static void io_stop_thread(struct snapraid_io* io)
808 : {
809 : unsigned i;
810 :
- 811 96 : thread_mutex_lock(&io->io_mutex);
+ 811 95 : thread_mutex_lock(&io->io_mutex);
812 :
813 : /* mark that we are stopping */
- 814 96 : io->done = 1;
+ 814 95 : io->done = 1;
815 :
816 : /* signal all the threads to recognize the new state */
- 817 96 : thread_cond_broadcast(&io->read_sched);
- 818 96 : thread_cond_broadcast(&io->write_sched);
+ 817 95 : thread_cond_broadcast(&io->read_sched);
+ 818 95 : thread_cond_broadcast(&io->write_sched);
819 :
- 820 96 : thread_mutex_unlock(&io->io_mutex);
+ 820 95 : thread_mutex_unlock(&io->io_mutex);
821 :
822 : /* wait for all readers to terminate */
- 823 750 : for (i = 0; i < io->reader_max; ++i) {
- 824 654 : struct snapraid_worker* worker = &io->reader_map[i];
+ 823 743 : for (i = 0; i < io->reader_max; ++i) {
+ 824 648 : struct snapraid_worker* worker = &io->reader_map[i];
825 : void* retval;
826 :
827 : /* wait for thread termination */
- 828 654 : thread_join(worker->thread, &retval);
+ 828 648 : thread_join(worker->thread, &retval);
829 : }
830 :
831 : /* wait for all writers to terminate */
- 832 559 : for (i = 0; i < io->writer_max; ++i) {
- 833 463 : struct snapraid_worker* worker = &io->writer_map[i];
+ 832 557 : for (i = 0; i < io->writer_max; ++i) {
+ 833 462 : struct snapraid_worker* worker = &io->writer_map[i];
834 : void* retval;
835 :
836 : /* wait for thread termination */
- 837 463 : thread_join(worker->thread, &retval);
+ 837 462 : thread_join(worker->thread, &retval);
838 : }
- 839 96 : }
+ 839 95 : }
840 :
841 : #endif
842 :
@@ -922,13 +922,13 @@
860 96 : if (io_cache == 0) {
861 : /* default is 8 MiB of cache */
862 : /* this seems to be a good tradeoff between speed and memory usage */
- 863 96 : io->io_max = 8 * 1024 * 1024 / state->block_size;
- 864 96 : if (io->io_max < IO_MIN)
+ 863 95 : io->io_max = 8 * 1024 * 1024 / state->block_size;
+ 864 95 : if (io->io_max < IO_MIN)
865 0 : io->io_max = IO_MIN;
- 866 96 : if (io->io_max > IO_MAX)
- 867 96 : io->io_max = IO_MAX;
+ 866 95 : if (io->io_max > IO_MAX)
+ 867 95 : io->io_max = IO_MAX;
868 : } else {
- 869 0 : io->io_max = io_cache;
+ 869 1 : io->io_max = io_cache;
870 : }
871 : #else
872 : (void)io_cache;
@@ -941,14 +941,14 @@
879 :
880 96 : io->buffer_max = buffer_max;
881 96 : allocated = 0;
- 882 12384 : for (i = 0; i < io->io_max; ++i) {
- 883 12288 : if (state->file_mode != ADVISE_DIRECT)
- 884 12288 : io->buffer_map[i] = malloc_nofail_vector_align(handle_max, buffer_max, state->block_size, &io->buffer_alloc_map[i]);
+ 882 12257 : for (i = 0; i < io->io_max; ++i) {
+ 883 12161 : if (state->file_mode != ADVISE_DIRECT)
+ 884 12161 : io->buffer_map[i] = malloc_nofail_vector_align(handle_max, buffer_max, state->block_size, &io->buffer_alloc_map[i]);
885 : else
886 0 : io->buffer_map[i] = malloc_nofail_vector_direct(handle_max, buffer_max, state->block_size, &io->buffer_alloc_map[i]);
- 887 12288 : if (!state->opt.skip_self)
+ 887 12161 : if (!state->opt.skip_self)
888 0 : mtest_vector(io->buffer_max, state->block_size, io->buffer_map[i]);
- 889 12288 : allocated += state->block_size * buffer_max;
+ 889 12161 : allocated += state->block_size * buffer_max;
890 : }
891 :
892 96 : msg_progress("Using %u MiB of memory for %u blocks of IO cache.\n", (unsigned)(allocated / MEBI), io->io_max);
@@ -1011,33 +1011,33 @@
949 :
950 : #if HAVE_PTHREAD
951 96 : if (io->io_max > 1) {
- 952 96 : io_read_next = io_read_next_thread;
- 953 96 : io_write_preset = io_write_preset_thread;
- 954 96 : io_write_next = io_write_next_thread;
- 955 96 : io_refresh = io_refresh_thread;
- 956 96 : io_data_read = io_data_read_thread;
- 957 96 : io_parity_read = io_parity_read_thread;
- 958 96 : io_parity_write = io_parity_write_thread;
- 959 96 : io_start = io_start_thread;
- 960 96 : io_stop = io_stop_thread;
+ 952 95 : io_read_next = io_read_next_thread;
+ 953 95 : io_write_preset = io_write_preset_thread;
+ 954 95 : io_write_next = io_write_next_thread;
+ 955 95 : io_refresh = io_refresh_thread;
+ 956 95 : io_data_read = io_data_read_thread;
+ 957 95 : io_parity_read = io_parity_read_thread;
+ 958 95 : io_parity_write = io_parity_write_thread;
+ 959 95 : io_start = io_start_thread;
+ 960 95 : io_stop = io_stop_thread;
961 :
- 962 96 : thread_mutex_init(&io->io_mutex, 0);
- 963 96 : thread_cond_init(&io->read_done, 0);
- 964 96 : thread_cond_init(&io->read_sched, 0);
- 965 96 : thread_cond_init(&io->write_done, 0);
- 966 96 : thread_cond_init(&io->write_sched, 0);
+ 962 95 : thread_mutex_init(&io->io_mutex, 0);
+ 963 95 : thread_cond_init(&io->read_done, 0);
+ 964 95 : thread_cond_init(&io->read_sched, 0);
+ 965 95 : thread_cond_init(&io->write_done, 0);
+ 966 95 : thread_cond_init(&io->write_sched, 0);
967 : } else
968 : #endif
969 : {
- 970 0 : io_read_next = io_read_next_mono;
- 971 0 : io_write_preset = io_write_preset_mono;
- 972 0 : io_write_next = io_write_next_mono;
- 973 0 : io_refresh = io_refresh_mono;
- 974 0 : io_data_read = io_data_read_mono;
- 975 0 : io_parity_read = io_parity_read_mono;
- 976 0 : io_parity_write = io_parity_write_mono;
- 977 0 : io_start = io_start_mono;
- 978 0 : io_stop = io_stop_mono;
+ 970 1 : io_read_next = io_read_next_mono;
+ 971 1 : io_write_preset = io_write_preset_mono;
+ 972 1 : io_write_next = io_write_next_mono;
+ 973 1 : io_refresh = io_refresh_mono;
+ 974 1 : io_data_read = io_data_read_mono;
+ 975 1 : io_parity_read = io_parity_read_mono;
+ 976 1 : io_parity_write = io_parity_write_mono;
+ 977 1 : io_start = io_start_mono;
+ 978 1 : io_stop = io_stop_mono;
979 : }
980 96 : }
981 :
@@ -1045,9 +1045,9 @@
983 : {
984 : unsigned i;
985 :
- 986 12384 : for (i = 0; i < io->io_max; ++i) {
- 987 12288 : free(io->buffer_map[i]);
- 988 12288 : free(io->buffer_alloc_map[i]);
+ 986 12257 : for (i = 0; i < io->io_max; ++i) {
+ 987 12161 : free(io->buffer_map[i]);
+ 988 12161 : free(io->buffer_alloc_map[i]);
989 : }
990 :
991 96 : free(io->reader_map);
@@ -1057,11 +1057,11 @@
995 :
996 : #if HAVE_PTHREAD
997 96 : if (io->io_max > 1) {
- 998 96 : thread_mutex_destroy(&io->io_mutex);
- 999 96 : thread_cond_destroy(&io->read_done);
- 1000 96 : thread_cond_destroy(&io->read_sched);
- 1001 96 : thread_cond_destroy(&io->write_done);
- 1002 96 : thread_cond_destroy(&io->write_sched);
+ 998 95 : thread_mutex_destroy(&io->io_mutex);
+ 999 95 : thread_cond_destroy(&io->read_done);
+ 1000 95 : thread_cond_destroy(&io->read_sched);
+ 1001 95 : thread_cond_destroy(&io->write_done);
+ 1002 95 : thread_cond_destroy(&io->write_sched);
1003 : }
1004 : #endif
1005 96 : }
diff --git a/cov/cmdline/mktest.c.func-sort-c.html b/cov/cmdline/mktest.c.func-sort-c.html
index 9de017f1..27d6466e 100644
--- a/cov/cmdline/mktest.c.func-sort-c.html
+++ b/cov/cmdline/mktest.c.func-sort-c.html
@@ -61,23 +61,23 @@
| rnd |
- 56078917 |
+ 56057797 |
| rndnz |
- 55667758 |
+ 55646605 |
| file_cmp |
- 146650 |
+ 146556 |
| rndnz_range |
- 32714 |
+ 32690 |
| rnd_name |
- 26829 |
+ 26841 |
| cmd_generate |
@@ -93,19 +93,19 @@
| cmd_write |
- 6236 |
+ 6226 |
| cmd_append |
- 3238 |
-
-
- | cmd_truncate |
- 3191 |
+ 3224 |
| cmd_delete |
- 3088 |
+ 3222 |
+
+
+ | cmd_truncate |
+ 3082 |
| cmd_damage |
@@ -121,7 +121,7 @@
| cmd_generate_symlink |
- 920 |
+ 932 |
| main |
diff --git a/cov/cmdline/mktest.c.func.html b/cov/cmdline/mktest.c.func.html
index 1f72d81a..18bde35a 100644
--- a/cov/cmdline/mktest.c.func.html
+++ b/cov/cmdline/mktest.c.func.html
@@ -61,7 +61,7 @@
| cmd_append |
- 3238 |
+ 3224 |
| cmd_change |
@@ -73,7 +73,7 @@
| cmd_delete |
- 3088 |
+ 3222 |
| cmd_generate |
@@ -85,15 +85,15 @@
| cmd_generate_symlink |
- 920 |
+ 932 |
| cmd_truncate |
- 3191 |
+ 3082 |
| cmd_write |
- 6236 |
+ 6226 |
| fallback |
@@ -101,7 +101,7 @@
| file_cmp |
- 146650 |
+ 146556 |
| help |
@@ -113,15 +113,15 @@
| rnd |
- 56078917 |
+ 56057797 |
| rnd_name |
- 26829 |
+ 26841 |
| rndnz |
- 55667758 |
+ 55646605 |
| rndnz_damage |
@@ -129,7 +129,7 @@
| rndnz_range |
- 32714 |
+ 32690 |
diff --git a/cov/cmdline/mktest.c.gcov.html b/cov/cmdline/mktest.c.gcov.html
index ab7d59ae..4c422f75 100644
--- a/cov/cmdline/mktest.c.gcov.html
+++ b/cov/cmdline/mktest.c.gcov.html
@@ -89,28 +89,28 @@
27 : */
28 : unsigned long long seed = 0;
29 :
- 30 56078917 : unsigned rnd(unsigned max)
+ 30 56057797 : unsigned rnd(unsigned max)
31 : {
- 32 56078917 : seed = seed * 6364136223846793005LL + 1442695040888963407LL;
+ 32 56057797 : seed = seed * 6364136223846793005LL + 1442695040888963407LL;
33 :
- 34 56078917 : return (seed >> 32) % max;
+ 34 56057797 : return (seed >> 32) % max;
35 : }
36 :
- 37 55667758 : unsigned rndnz(unsigned max)
+ 37 55646605 : unsigned rndnz(unsigned max)
38 : {
- 39 55667758 : if (max <= 1)
+ 39 55646605 : if (max <= 1)
40 2831 : return 1;
41 : else
- 42 55664927 : return rnd(max - 1) + 1;
+ 42 55643774 : return rnd(max - 1) + 1;
43 : }
44 :
- 45 32714 : void rndnz_range(unsigned char* data, int size)
+ 45 32690 : void rndnz_range(unsigned char* data, int size)
46 : {
47 : int i;
48 :
- 49 55693709 : for (i = 0; i < size; ++i)
- 50 55660995 : data[i] = rndnz(256);
- 51 32714 : }
+ 49 55672532 : for (i = 0; i < size; ++i)
+ 50 55639842 : data[i] = rndnz(256);
+ 51 32690 : }
52 :
53 1821 : void rndnz_damage(unsigned char* data, int size)
54 : {
@@ -131,23 +131,23 @@
69 : char CHARSET[] = "qwertyuiopasdfghjklzxcvbnm1234567890 .-+";
70 : #define CHARSET_LEN (sizeof(CHARSET) - 1)
71 :
- 72 26829 : void rnd_name(char* file)
+ 72 26841 : void rnd_name(char* file)
73 : {
- 74 26829 : int l = 1 + rnd(20);
+ 74 26841 : int l = 1 + rnd(20);
75 :
- 76 335309 : while (l) {
- 77 281651 : *file++ = CHARSET[rnd(CHARSET_LEN)];
- 78 281651 : --l;
+ 76 335354 : while (l) {
+ 77 281672 : *file++ = CHARSET[rnd(CHARSET_LEN)];
+ 78 281672 : --l;
79 : }
- 80 26829 : *file = 0;
- 81 26829 : }
+ 80 26841 : *file = 0;
+ 81 26841 : }
82 :
83 : /****************************************************************************/
84 : /* file */
85 :
- 86 146650 : int file_cmp(const void* a, const void* b)
+ 86 146556 : int file_cmp(const void* a, const void* b)
87 : {
- 88 146650 : return strcmp(a, b);
+ 88 146556 : return strcmp(a, b);
89 : }
90 :
91 1821 : int fallback(int f, struct stat* st)
@@ -259,11 +259,11 @@
197 : * Create a symlink.
198 : * - If the file already exists, it's removed.
199 : */
- 200 920 : void cmd_generate_symlink(const char* path, const char* linkto)
+ 200 932 : void cmd_generate_symlink(const char* path, const char* linkto)
201 : {
202 : /* remove the existing file/symlink if any */
- 203 920 : if (remove(path) != 0) {
- 204 899 : if (errno != ENOENT) {
+ 203 932 : if (remove(path) != 0) {
+ 204 911 : if (errno != ENOENT) {
205 : /* LCOV_EXCL_START */
206 : log_fatal("Error removing file %s\n", path);
207 : exit(EXIT_FAILURE);
@@ -271,13 +271,13 @@
209 : }
210 : }
211 :
- 212 920 : if (symlink(linkto, path) != 0) {
+ 212 932 : if (symlink(linkto, path) != 0) {
213 : /* LCOV_EXCL_START */
214 : log_fatal("Error writing symlink %s\n", path);
215 : exit(EXIT_FAILURE);
216 : /* LCOV_EXCL_STOP */
217 : }
- 218 920 : }
+ 218 932 : }
219 :
220 : /**
221 : * Create a file or a symlink with a random name.
@@ -350,68 +350,68 @@
288 : * - The written data may be equal or not at the already existing one.
289 : * - If it's a symlink nothing is done.
290 : */
- 291 6236 : void cmd_write(const char* path, int size)
+ 291 6226 : void cmd_write(const char* path, int size)
292 : {
293 : struct stat st;
294 :
- 295 6236 : if (lstat(path, &st) != 0) {
+ 295 6226 : if (lstat(path, &st) != 0) {
296 : /* LCOV_EXCL_START */
297 : log_fatal("Error accessing %s\n", path);
298 : exit(EXIT_FAILURE);
299 : /* LCOV_EXCL_STOP */
300 : }
301 :
- 302 6236 : if (S_ISREG(st.st_mode)) {
+ 302 6226 : if (S_ISREG(st.st_mode)) {
303 : unsigned char* data;
304 : off_t off;
305 : int f;
306 :
307 : /* not over the end */
- 308 6209 : if (size > st.st_size)
- 309 695 : size = st.st_size;
+ 308 6199 : if (size > st.st_size)
+ 309 687 : size = st.st_size;
310 :
311 : /* start at random position inside the file */
- 312 6209 : if (size < st.st_size)
- 313 5512 : off = rnd(st.st_size - size);
+ 312 6199 : if (size < st.st_size)
+ 313 5511 : off = rnd(st.st_size - size);
314 : else
- 315 697 : off = 0;
+ 315 688 : off = 0;
316 :
- 317 6209 : data = malloc(size);
+ 317 6199 : data = malloc(size);
318 :
- 319 6209 : rndnz_range(data, size);
+ 319 6199 : rndnz_range(data, size);
320 :
- 321 6209 : f = open(path, O_WRONLY | O_BINARY | O_NOFOLLOW);
- 322 6209 : if (f < 0) {
+ 321 6199 : f = open(path, O_WRONLY | O_BINARY | O_NOFOLLOW);
+ 322 6199 : if (f < 0) {
323 : /* LCOV_EXCL_START */
324 : log_fatal("Error creating file %s\n", path);
325 : exit(EXIT_FAILURE);
326 : /* LCOV_EXCL_STOP */
327 : }
328 :
- 329 6209 : if (lseek(f, off, SEEK_SET) != off) {
+ 329 6199 : if (lseek(f, off, SEEK_SET) != off) {
330 : /* LCOV_EXCL_START */
331 : log_fatal("Error seeking file %s\n", path);
332 : exit(EXIT_FAILURE);
333 : /* LCOV_EXCL_STOP */
334 : }
335 :
- 336 6209 : if (write(f, data, size) != size) {
+ 336 6199 : if (write(f, data, size) != size) {
337 : /* LCOV_EXCL_START */
338 : log_fatal("Error writing file %s\n", path);
339 : exit(EXIT_FAILURE);
340 : /* LCOV_EXCL_STOP */
341 : }
342 :
- 343 6209 : if (close(f) != 0) {
+ 343 6199 : if (close(f) != 0) {
344 : /* LCOV_EXCL_START */
345 : log_fatal("Error closing file %s\n", path);
346 : exit(EXIT_FAILURE);
347 : /* LCOV_EXCL_STOP */
348 : }
349 :
- 350 6209 : free(data);
+ 350 6199 : free(data);
351 : }
- 352 6236 : }
+ 352 6226 : }
353 :
354 : /**
355 : * Damage a file.
@@ -518,50 +518,50 @@
456 : * - The file must exist.
457 : * - If it's a symlink nothing is done.
458 : */
- 459 3238 : void cmd_append(const char* path, int size)
+ 459 3224 : void cmd_append(const char* path, int size)
460 : {
461 : struct stat st;
462 :
- 463 3238 : if (lstat(path, &st) != 0) {
+ 463 3224 : if (lstat(path, &st) != 0) {
464 : /* LCOV_EXCL_START */
465 : log_fatal("Error accessing %s\n", path);
466 : exit(EXIT_FAILURE);
467 : /* LCOV_EXCL_STOP */
468 : }
469 :
- 470 3238 : if (S_ISREG(st.st_mode)) {
+ 470 3224 : if (S_ISREG(st.st_mode)) {
471 : unsigned char* data;
472 : int f;
473 :
- 474 3238 : data = malloc(size);
+ 474 3224 : data = malloc(size);
475 :
- 476 3238 : rndnz_range(data, size);
+ 476 3224 : rndnz_range(data, size);
477 :
- 478 3238 : f = open(path, O_WRONLY | O_APPEND | O_BINARY | O_NOFOLLOW);
- 479 3238 : if (f < 0) {
+ 478 3224 : f = open(path, O_WRONLY | O_APPEND | O_BINARY | O_NOFOLLOW);
+ 479 3224 : if (f < 0) {
480 : /* LCOV_EXCL_START */
481 : log_fatal("Error opening file %s\n", path);
482 : exit(EXIT_FAILURE);
483 : /* LCOV_EXCL_STOP */
484 : }
485 :
- 486 3238 : if (write(f, data, size) != size) {
+ 486 3224 : if (write(f, data, size) != size) {
487 : /* LCOV_EXCL_START */
488 : log_fatal("Error writing file %s\n", path);
489 : exit(EXIT_FAILURE);
490 : /* LCOV_EXCL_STOP */
491 : }
492 :
- 493 3238 : if (close(f) != 0) {
+ 493 3224 : if (close(f) != 0) {
494 : /* LCOV_EXCL_START */
495 : log_fatal("Error closing file %s\n", path);
496 : exit(EXIT_FAILURE);
497 : /* LCOV_EXCL_STOP */
498 : }
499 :
- 500 3238 : free(data);
+ 500 3224 : free(data);
501 : }
- 502 3238 : }
+ 502 3224 : }
503 :
504 : /**
505 : * Truncate a file.
@@ -569,69 +569,69 @@
507 : * - The file is NEVER truncated to 0.
508 : * - If it's a symlink nothing is done.
509 : */
- 510 3191 : void cmd_truncate(const char* path, int size)
+ 510 3082 : void cmd_truncate(const char* path, int size)
511 : {
512 : struct stat st;
513 :
- 514 3191 : if (lstat(path, &st) != 0) {
+ 514 3082 : if (lstat(path, &st) != 0) {
515 : /* LCOV_EXCL_START */
516 : log_fatal("Error accessing %s\n", path);
517 : exit(EXIT_FAILURE);
518 : /* LCOV_EXCL_STOP */
519 : }
520 :
- 521 3191 : if (S_ISREG(st.st_mode)) {
+ 521 3082 : if (S_ISREG(st.st_mode)) {
522 : off_t off;
523 : int f;
524 :
525 : /* if file is empty, just rewrite it */
- 526 3191 : if (st.st_size == 0) {
- 527 4 : size = 0;
+ 526 3082 : if (st.st_size == 0) {
+ 527 7 : size = 0;
528 : } else {
529 : /* don't truncate files to 0 size to avoid ZERO file size protection */
- 530 3187 : if (size >= st.st_size)
- 531 163 : size = st.st_size - 1;
+ 530 3075 : if (size >= st.st_size)
+ 531 185 : size = st.st_size - 1;
532 : }
533 :
- 534 3191 : off = st.st_size - size;
+ 534 3082 : off = st.st_size - size;
535 :
- 536 3191 : f = open(path, O_WRONLY | O_BINARY | O_NOFOLLOW);
- 537 3191 : if (f < 0) {
+ 536 3082 : f = open(path, O_WRONLY | O_BINARY | O_NOFOLLOW);
+ 537 3082 : if (f < 0) {
538 : /* LCOV_EXCL_START */
539 : log_fatal("Error opening file %s\n", path);
540 : exit(EXIT_FAILURE);
541 : /* LCOV_EXCL_STOP */
542 : }
543 :
- 544 3191 : if (ftruncate(f, off) != 0) {
+ 544 3082 : if (ftruncate(f, off) != 0) {
545 : /* LCOV_EXCL_START */
546 : log_fatal("Error truncating file %s\n", path);
547 : exit(EXIT_FAILURE);
548 : /* LCOV_EXCL_STOP */
549 : }
550 :
- 551 3191 : if (close(f) != 0) {
+ 551 3082 : if (close(f) != 0) {
552 : /* LCOV_EXCL_START */
553 : log_fatal("Error closing file %s\n", path);
554 : exit(EXIT_FAILURE);
555 : /* LCOV_EXCL_STOP */
556 : }
557 : }
- 558 3191 : }
+ 558 3082 : }
559 :
560 : /**
561 : * Delete a file.
562 : * - The file must exist.
563 : */
- 564 3088 : void cmd_delete(const char* path)
+ 564 3222 : void cmd_delete(const char* path)
565 : {
- 566 3088 : if (remove(path) != 0) {
+ 566 3222 : if (remove(path) != 0) {
567 : /* LCOV_EXCL_START */
568 : log_fatal("Error removing %s\n", path);
569 : exit(EXIT_FAILURE);
570 : /* LCOV_EXCL_STOP */
571 : }
- 572 3088 : }
+ 572 3222 : }
573 :
574 : /**
575 : * Change a file. Or deleted/truncated/append/created.
@@ -642,20 +642,20 @@
580 : struct stat st;
581 :
582 13128 : if (!size)
- 583 13158 : return;
+ 583 13157 : return;
584 :
- 585 13098 : if (lstat(path, &st) != 0) {
+ 585 13099 : if (lstat(path, &st) != 0) {
586 : /* LCOV_EXCL_START */
587 : log_fatal("Error accessing %s\n", path);
588 : exit(EXIT_FAILURE);
589 : /* LCOV_EXCL_STOP */
590 : }
591 :
- 592 13098 : if (S_ISLNK(st.st_mode)) {
+ 592 13099 : if (S_ISLNK(st.st_mode)) {
593 : /* symlink */
594 394 : if (rnd(2) == 0) {
595 : /* delete */
- 596 207 : if (remove(path) != 0) {
+ 596 195 : if (remove(path) != 0) {
597 : /* LCOV_EXCL_START */
598 : log_fatal("Error removing %s\n", path);
599 : exit(EXIT_FAILURE);
@@ -665,30 +665,30 @@
603 : /* recreate */
604 : char linkto[PATH_MAX];
605 :
- 606 187 : if (remove(path) != 0) {
+ 606 199 : if (remove(path) != 0) {
607 : /* LCOV_EXCL_START */
608 : log_fatal("Error removing %s\n", path);
609 : exit(EXIT_FAILURE);
610 : /* LCOV_EXCL_STOP */
611 : }
612 :
- 613 187 : rnd_name(linkto);
+ 613 199 : rnd_name(linkto);
614 :
- 615 187 : cmd_generate_symlink(path, linkto);
+ 615 199 : cmd_generate_symlink(path, linkto);
616 : }
- 617 12704 : } else if (S_ISREG(st.st_mode)) {
+ 617 12705 : } else if (S_ISREG(st.st_mode)) {
618 : int r;
619 :
- 620 12704 : r = rnd(4);
+ 620 12705 : r = rnd(4);
621 :
- 622 12704 : if (r == 0) {
- 623 3187 : cmd_write(path, size);
- 624 9517 : } else if (r == 1) {
- 625 3238 : cmd_append(path, size);
- 626 6279 : } else if (r == 2) {
- 627 3191 : cmd_truncate(path, size);
+ 622 12705 : if (r == 0) {
+ 623 3177 : cmd_write(path, size);
+ 624 9528 : } else if (r == 1) {
+ 625 3224 : cmd_append(path, size);
+ 626 6304 : } else if (r == 2) {
+ 627 3082 : cmd_truncate(path, size);
628 : } else {
- 629 3088 : cmd_delete(path);
+ 629 3222 : cmd_delete(path);
630 : }
631 : }
632 : }
diff --git a/cov/cmdline/murmur3.c.func-sort-c.html b/cov/cmdline/murmur3.c.func-sort-c.html
index 0e4cf8ec..db8791cf 100644
--- a/cov/cmdline/murmur3.c.func-sort-c.html
+++ b/cov/cmdline/murmur3.c.func-sort-c.html
@@ -61,11 +61,11 @@
| fmix32 |
- 8307132 |
+ 8307308 |
| MurmurHash3_x86_128 |
- 2076783 |
+ 2076827 |
diff --git a/cov/cmdline/murmur3.c.func.html b/cov/cmdline/murmur3.c.func.html
index e2a6403b..502e4614 100644
--- a/cov/cmdline/murmur3.c.func.html
+++ b/cov/cmdline/murmur3.c.func.html
@@ -61,11 +61,11 @@
| MurmurHash3_x86_128 |
- 2076783 |
+ 2076827 |
| fmix32 |
- 8307132 |
+ 8307308 |
diff --git a/cov/cmdline/murmur3.c.gcov.html b/cov/cmdline/murmur3.c.gcov.html
index 7093a9b2..28177746 100644
--- a/cov/cmdline/murmur3.c.gcov.html
+++ b/cov/cmdline/murmur3.c.gcov.html
@@ -91,14 +91,14 @@
29 : // domain. The author hereby disclaims copyright to this source code.
30 :
31 : /* Finalization mix - force all bits of a hash block to avalanche */
- 32 8307132 : static inline uint32_t fmix32(uint32_t h)
+ 32 8307308 : static inline uint32_t fmix32(uint32_t h)
33 : {
- 34 8307132 : h ^= h >> 16;
- 35 8307132 : h *= 0x85ebca6b;
- 36 8307132 : h ^= h >> 13;
- 37 8307132 : h *= 0xc2b2ae35;
- 38 8307132 : h ^= h >> 16;
- 39 8307132 : return h;
+ 34 8307308 : h ^= h >> 16;
+ 35 8307308 : h *= 0x85ebca6b;
+ 36 8307308 : h ^= h >> 13;
+ 37 8307308 : h *= 0xc2b2ae35;
+ 38 8307308 : h ^= h >> 16;
+ 39 8307308 : return h;
40 : }
41 :
42 : /*
@@ -137,17 +137,17 @@
75 : uint32_t c3 = 0x38b34ae5;
76 : uint32_t c4 = 0xa1e38b93;
77 :
- 78 2076783 : void MurmurHash3_x86_128(const void* data, size_t size, const uint8_t* seed, void* digest)
+ 78 2076827 : void MurmurHash3_x86_128(const void* data, size_t size, const uint8_t* seed, void* digest)
79 : {
80 : size_t nblocks;
81 : const uint32_t* blocks;
82 : const uint32_t* end;
83 : size_t size_remainder;
84 :
- 85 2076783 : uint32_t h1 = ((const uint32_t*)seed)[0];
- 86 2076783 : uint32_t h2 = ((const uint32_t*)seed)[1];
- 87 2076783 : uint32_t h3 = ((const uint32_t*)seed)[2];
- 88 2076783 : uint32_t h4 = ((const uint32_t*)seed)[3];
+ 85 2076827 : uint32_t h1 = ((const uint32_t*)seed)[0];
+ 86 2076827 : uint32_t h2 = ((const uint32_t*)seed)[1];
+ 87 2076827 : uint32_t h3 = ((const uint32_t*)seed)[2];
+ 88 2076827 : uint32_t h4 = ((const uint32_t*)seed)[3];
89 :
90 : #if WORDS_BIGENDIAN
91 : h1 = util_swap32(h1);
@@ -156,16 +156,16 @@
94 : h4 = util_swap32(h4);
95 : #endif
96 :
- 97 2076783 : nblocks = size / 16;
- 98 2076783 : blocks = data;
- 99 2076783 : end = blocks + nblocks * 4;
+ 97 2076827 : nblocks = size / 16;
+ 98 2076827 : blocks = data;
+ 99 2076827 : end = blocks + nblocks * 4;
100 :
101 : /* body */
- 102 109635270 : while (blocks < end) {
- 103 105481704 : uint32_t k1 = blocks[0];
- 104 105481704 : uint32_t k2 = blocks[1];
- 105 105481704 : uint32_t k3 = blocks[2];
- 106 105481704 : uint32_t k4 = blocks[3];
+ 102 110683413 : while (blocks < end) {
+ 103 106529759 : uint32_t k1 = blocks[0];
+ 104 106529759 : uint32_t k2 = blocks[1];
+ 105 106529759 : uint32_t k3 = blocks[2];
+ 106 106529759 : uint32_t k4 = blocks[3];
107 :
108 : #if WORDS_BIGENDIAN
109 : k1 = util_swap32(k1);
@@ -174,71 +174,71 @@
112 : k4 = util_swap32(k4);
113 : #endif
114 :
- 115 105481704 : k1 *= c1; k1 = util_rotl32(k1, 15); k1 *= c2; h1 ^= k1;
+ 115 106529759 : k1 *= c1; k1 = util_rotl32(k1, 15); k1 *= c2; h1 ^= k1;
116 :
- 117 105481704 : h1 = util_rotl32(h1, 19); h1 += h2; h1 = h1 * 5 + 0x561ccd1b;
+ 117 106529759 : h1 = util_rotl32(h1, 19); h1 += h2; h1 = h1 * 5 + 0x561ccd1b;
118 :
- 119 105481704 : k2 *= c2; k2 = util_rotl32(k2, 16); k2 *= c3; h2 ^= k2;
+ 119 106529759 : k2 *= c2; k2 = util_rotl32(k2, 16); k2 *= c3; h2 ^= k2;
120 :
- 121 105481704 : h2 = util_rotl32(h2, 17); h2 += h3; h2 = h2 * 5 + 0x0bcaa747;
+ 121 106529759 : h2 = util_rotl32(h2, 17); h2 += h3; h2 = h2 * 5 + 0x0bcaa747;
122 :
- 123 105481704 : k3 *= c3; k3 = util_rotl32(k3, 17); k3 *= c4; h3 ^= k3;
+ 123 106529759 : k3 *= c3; k3 = util_rotl32(k3, 17); k3 *= c4; h3 ^= k3;
124 :
- 125 105481704 : h3 = util_rotl32(h3, 15); h3 += h4; h3 = h3 * 5 + 0x96cd1c35;
+ 125 106529759 : h3 = util_rotl32(h3, 15); h3 += h4; h3 = h3 * 5 + 0x96cd1c35;
126 :
- 127 105481704 : k4 *= c4; k4 = util_rotl32(k4, 18); k4 *= c1; h4 ^= k4;
+ 127 106529759 : k4 *= c4; k4 = util_rotl32(k4, 18); k4 *= c1; h4 ^= k4;
128 :
- 129 105481704 : h4 = util_rotl32(h4, 13); h4 += h1; h4 = h4 * 5 + 0x32ac3b17;
+ 129 106529759 : h4 = util_rotl32(h4, 13); h4 += h1; h4 = h4 * 5 + 0x32ac3b17;
130 :
- 131 105481704 : blocks += 4;
+ 131 106529759 : blocks += 4;
132 : }
133 :
134 : /* tail */
- 135 2076783 : size_remainder = size & 15;
- 136 2076783 : if (size_remainder != 0) {
- 137 779191 : const uint8_t* tail = (const uint8_t*)blocks;
+ 135 2076827 : size_remainder = size & 15;
+ 136 2076827 : if (size_remainder != 0) {
+ 137 779267 : const uint8_t* tail = (const uint8_t*)blocks;
138 :
- 139 779191 : uint32_t k1 = 0;
- 140 779191 : uint32_t k2 = 0;
- 141 779191 : uint32_t k3 = 0;
- 142 779191 : uint32_t k4 = 0;
+ 139 779267 : uint32_t k1 = 0;
+ 140 779267 : uint32_t k2 = 0;
+ 141 779267 : uint32_t k3 = 0;
+ 142 779267 : uint32_t k4 = 0;
143 :
- 144 779191 : switch (size_remainder) {
- 145 51264 : case 15 : k4 ^= (uint32_t)tail[14] << 16;
- 146 104016 : case 14 : k4 ^= (uint32_t)tail[13] << 8;
- 147 156196 : case 13 : k4 ^= (uint32_t)tail[12] << 0;
- 148 156196 : k4 *= c4; k4 = util_rotl32(k4, 18); k4 *= c1; h4 ^= k4;
- 149 208942 : case 12 : k3 ^= (uint32_t)tail[11] << 24;
- 150 261429 : case 11 : k3 ^= (uint32_t)tail[10] << 16;
- 151 313618 : case 10 : k3 ^= (uint32_t)tail[ 9] << 8;
- 152 366933 : case 9 : k3 ^= (uint32_t)tail[ 8] << 0;
- 153 366933 : k3 *= c3; k3 = util_rotl32(k3, 17); k3 *= c4; h3 ^= k3;
- 154 420871 : case 8 : k2 ^= (uint32_t)tail[ 7] << 24;
- 155 470359 : case 7 : k2 ^= (uint32_t)tail[ 6] << 16;
- 156 523028 : case 6 : k2 ^= (uint32_t)tail[ 5] << 8;
- 157 573517 : case 5 : k2 ^= (uint32_t)tail[ 4] << 0;
- 158 573517 : k2 *= c2; k2 = util_rotl32(k2, 16); k2 *= c3; h2 ^= k2;
- 159 625497 : case 4 : k1 ^= (uint32_t)tail[ 3] << 24;
- 160 675829 : case 3 : k1 ^= (uint32_t)tail[ 2] << 16;
- 161 726893 : case 2 : k1 ^= (uint32_t)tail[ 1] << 8;
- 162 779191 : case 1 : k1 ^= (uint32_t)tail[ 0] << 0;
- 163 779191 : k1 *= c1; k1 = util_rotl32(k1, 15); k1 *= c2; h1 ^= k1;
+ 144 779267 : switch (size_remainder) {
+ 145 51305 : case 15 : k4 ^= (uint32_t)tail[14] << 16;
+ 146 104040 : case 14 : k4 ^= (uint32_t)tail[13] << 8;
+ 147 156243 : case 13 : k4 ^= (uint32_t)tail[12] << 0;
+ 148 156243 : k4 *= c4; k4 = util_rotl32(k4, 18); k4 *= c1; h4 ^= k4;
+ 149 209005 : case 12 : k3 ^= (uint32_t)tail[11] << 24;
+ 150 261544 : case 11 : k3 ^= (uint32_t)tail[10] << 16;
+ 151 313728 : case 10 : k3 ^= (uint32_t)tail[ 9] << 8;
+ 152 367016 : case 9 : k3 ^= (uint32_t)tail[ 8] << 0;
+ 153 367016 : k3 *= c3; k3 = util_rotl32(k3, 17); k3 *= c4; h3 ^= k3;
+ 154 420940 : case 8 : k2 ^= (uint32_t)tail[ 7] << 24;
+ 155 470460 : case 7 : k2 ^= (uint32_t)tail[ 6] << 16;
+ 156 523118 : case 6 : k2 ^= (uint32_t)tail[ 5] << 8;
+ 157 573626 : case 5 : k2 ^= (uint32_t)tail[ 4] << 0;
+ 158 573626 : k2 *= c2; k2 = util_rotl32(k2, 16); k2 *= c3; h2 ^= k2;
+ 159 625593 : case 4 : k1 ^= (uint32_t)tail[ 3] << 24;
+ 160 675926 : case 3 : k1 ^= (uint32_t)tail[ 2] << 16;
+ 161 726993 : case 2 : k1 ^= (uint32_t)tail[ 1] << 8;
+ 162 779267 : case 1 : k1 ^= (uint32_t)tail[ 0] << 0;
+ 163 779267 : k1 *= c1; k1 = util_rotl32(k1, 15); k1 *= c2; h1 ^= k1;
164 : }
165 : }
166 :
167 : /* finalization */
- 168 2076783 : h1 ^= size; h2 ^= size; h3 ^= size; h4 ^= size;
+ 168 2076827 : h1 ^= size; h2 ^= size; h3 ^= size; h4 ^= size;
169 :
- 170 2076783 : h1 += h2; h1 += h3; h1 += h4;
- 171 2076783 : h2 += h1; h3 += h1; h4 += h1;
+ 170 2076827 : h1 += h2; h1 += h3; h1 += h4;
+ 171 2076827 : h2 += h1; h3 += h1; h4 += h1;
172 :
- 173 2076783 : h1 = fmix32(h1);
- 174 2076783 : h2 = fmix32(h2);
- 175 2076783 : h3 = fmix32(h3);
- 176 2076783 : h4 = fmix32(h4);
+ 173 2076827 : h1 = fmix32(h1);
+ 174 2076827 : h2 = fmix32(h2);
+ 175 2076827 : h3 = fmix32(h3);
+ 176 2076827 : h4 = fmix32(h4);
177 :
- 178 2076783 : h1 += h2; h1 += h3; h1 += h4;
- 179 2076783 : h2 += h1; h3 += h1; h4 += h1;
+ 178 2076827 : h1 += h2; h1 += h3; h1 += h4;
+ 179 2076827 : h2 += h1; h3 += h1; h4 += h1;
180 :
181 : #if WORDS_BIGENDIAN
182 : h1 = util_swap32(h1);
@@ -247,11 +247,11 @@
185 : h4 = util_swap32(h4);
186 : #endif
187 :
- 188 2076783 : ((uint32_t*)digest)[0] = h1;
- 189 2076783 : ((uint32_t*)digest)[1] = h2;
- 190 2076783 : ((uint32_t*)digest)[2] = h3;
- 191 2076783 : ((uint32_t*)digest)[3] = h4;
- 192 2076783 : }
+ 188 2076827 : ((uint32_t*)digest)[0] = h1;
+ 189 2076827 : ((uint32_t*)digest)[1] = h2;
+ 190 2076827 : ((uint32_t*)digest)[2] = h3;
+ 191 2076827 : ((uint32_t*)digest)[3] = h4;
+ 192 2076827 : }
193 :
diff --git a/cov/cmdline/parity.c.func-sort-c.html b/cov/cmdline/parity.c.func-sort-c.html
index 3f52c037..1dc217aa 100644
--- a/cov/cmdline/parity.c.func-sort-c.html
+++ b/cov/cmdline/parity.c.func-sort-c.html
@@ -61,15 +61,15 @@
| parity_split_find |
- 4113970 |
+ 4113567 |
| parity_read |
- 3501576 |
+ 3501825 |
| parity_write |
- 612148 |
+ 611751 |
| parity_handle_chsize |
diff --git a/cov/cmdline/parity.c.func.html b/cov/cmdline/parity.c.func.html
index 6858eafe..f1d24eff 100644
--- a/cov/cmdline/parity.c.func.html
+++ b/cov/cmdline/parity.c.func.html
@@ -109,7 +109,7 @@
| parity_read |
- 3501576 |
+ 3501825 |
| parity_size |
@@ -117,7 +117,7 @@
| parity_split_find |
- 4113970 |
+ 4113567 |
| parity_split_is_fixed |
@@ -133,7 +133,7 @@
| parity_write |
- 612148 |
+ 611751 |
diff --git a/cov/cmdline/parity.c.gcov.html b/cov/cmdline/parity.c.gcov.html
index 523d7584..4ca2088e 100644
--- a/cov/cmdline/parity.c.gcov.html
+++ b/cov/cmdline/parity.c.gcov.html
@@ -818,44 +818,44 @@
756 1022 : return f_ret;
757 : }
758 :
- 759 4113970 : struct snapraid_split_handle* parity_split_find(struct snapraid_parity_handle* handle, data_off_t* offset)
+ 759 4113567 : struct snapraid_split_handle* parity_split_find(struct snapraid_parity_handle* handle, data_off_t* offset)
760 : {
761 : unsigned s;
762 :
- 763 4113970 : if (*offset < 0)
+ 763 4113567 : if (*offset < 0)
764 0 : return 0;
765 :
- 766 6502554 : for (s = 0;s < handle->split_mac;++s) {
- 767 6491194 : struct snapraid_split_handle* split = &handle->split_map[s];
+ 766 6501737 : for (s = 0;s < handle->split_mac;++s) {
+ 767 6490377 : struct snapraid_split_handle* split = &handle->split_map[s];
768 :
- 769 6491194 : if (*offset < split->size)
- 770 4102610 : return split;
+ 769 6490377 : if (*offset < split->size)
+ 770 4102207 : return split;
771 :
- 772 2388584 : *offset -= split->size;
+ 772 2388170 : *offset -= split->size;
773 : }
774 :
775 11360 : return 0;
776 : }
777 :
- 778 612148 : int parity_write(struct snapraid_parity_handle* handle, block_off_t pos, unsigned char* block_buffer, unsigned block_size)
+ 778 611751 : int parity_write(struct snapraid_parity_handle* handle, block_off_t pos, unsigned char* block_buffer, unsigned block_size)
779 : {
780 : ssize_t write_ret;
781 : data_off_t offset;
782 : struct snapraid_split_handle* split;
783 : int ret;
784 :
- 785 612148 : offset = pos * (data_off_t)block_size;
+ 785 611751 : offset = pos * (data_off_t)block_size;
786 :
- 787 612148 : split = parity_split_find(handle, &offset);
- 788 612147 : if (!split) {
+ 787 611751 : split = parity_split_find(handle, &offset);
+ 788 611746 : if (!split) {
789 : /* LCOV_EXCL_START */
790 : log_fatal("Writing parity data outside range at extra offset %" PRIu64 ".\n", offset);
791 : return -1;
792 : /* LCOV_EXCL_STOP */
793 : }
794 :
- 795 612147 : write_ret = pwrite(split->f, block_buffer, block_size, offset);
- 796 612149 : if (write_ret != (ssize_t)block_size) { /* conversion is safe because block_size is always small */
+ 795 611746 : write_ret = pwrite(split->f, block_buffer, block_size, offset);
+ 796 611756 : if (write_ret != (ssize_t)block_size) { /* conversion is safe because block_size is always small */
797 : /* LCOV_EXCL_START */
798 : if (errno == ENOSPC) {
799 : log_fatal("Failed to grow parity file '%s' using write due lack of space.\n", split->path);
@@ -866,18 +866,18 @@
804 : /* LCOV_EXCL_STOP */
805 : }
806 :
- 807 612149 : ret = advise_write(&split->advise, split->f, offset, block_size);
- 808 612145 : if (ret != 0) {
+ 807 611756 : ret = advise_write(&split->advise, split->f, offset, block_size);
+ 808 611756 : if (ret != 0) {
809 : /* LCOV_EXCL_START */
810 : log_fatal("Error advising parity file '%s'. %s.\n", split->path, strerror(errno));
811 : return -1;
812 : /* LCOV_EXCL_STOP */
813 : }
814 :
- 815 612145 : return 0;
+ 815 611756 : return 0;
816 : }
817 :
- 818 3501576 : int parity_read(struct snapraid_parity_handle* handle, block_off_t pos, unsigned char* block_buffer, unsigned block_size, fptr* out)
+ 818 3501825 : int parity_read(struct snapraid_parity_handle* handle, block_off_t pos, unsigned char* block_buffer, unsigned block_size, fptr* out)
819 : {
820 : ssize_t read_ret;
821 : data_off_t offset;
@@ -885,44 +885,44 @@
823 : struct snapraid_split_handle* split;
824 : int ret;
825 :
- 826 3501576 : offset = pos * (data_off_t)block_size;
+ 826 3501825 : offset = pos * (data_off_t)block_size;
827 :
- 828 3501576 : split = parity_split_find(handle, &offset);
- 829 3501820 : if (!split) {
+ 828 3501825 : split = parity_split_find(handle, &offset);
+ 829 3501816 : if (!split) {
830 : /* LCOV_EXCL_START */
831 : out("Reading parity data outside range at extra offset %" PRIu64 ".\n", offset);
832 : return -1;
833 : /* LCOV_EXCL_STOP */
834 : }
835 :
- 836 3490460 : count = 0;
+ 836 3490456 : count = 0;
837 : do {
- 838 3490424 : read_ret = pread(split->f, block_buffer + count, block_size - count, offset + count);
- 839 3490383 : if (read_ret < 0) {
+ 838 3490442 : read_ret = pread(split->f, block_buffer + count, block_size - count, offset + count);
+ 839 3490403 : if (read_ret < 0) {
840 : /* LCOV_EXCL_START */
841 : out("Error reading file '%s' at offset %" PRIu64 " for size %u. %s.\n", split->path, offset + count, block_size - count, strerror(errno));
842 : return -1;
843 : /* LCOV_EXCL_STOP */
844 : }
- 845 3490383 : if (read_ret == 0) {
+ 845 3490403 : if (read_ret == 0) {
846 : /* LCOV_EXCL_START */
847 : out("Unexpected end of file '%s' at offset %" PRIu64 ". %s.\n", split->path, offset, strerror(errno));
848 : return -1;
849 : /* LCOV_EXCL_STOP */
850 : }
851 :
- 852 3490383 : count += read_ret;
- 853 3490383 : } while (count < block_size);
+ 852 3490403 : count += read_ret;
+ 853 3490403 : } while (count < block_size);
854 :
- 855 3490419 : ret = advise_read(&split->advise, split->f, offset, block_size);
- 856 3490414 : if (ret != 0) {
+ 855 3490417 : ret = advise_read(&split->advise, split->f, offset, block_size);
+ 856 3490399 : if (ret != 0) {
857 : /* LCOV_EXCL_START */
858 : out("Error advising parity file '%s'. %s.\n", split->path, strerror(errno));
859 : return -1;
860 : /* LCOV_EXCL_STOP */
861 : }
862 :
- 863 3490414 : return block_size;
+ 863 3490399 : return block_size;
864 : }
865 :
diff --git a/cov/cmdline/scan.c.func-sort-c.html b/cov/cmdline/scan.c.func-sort-c.html
index fa3f4164..13da2ec3 100644
--- a/cov/cmdline/scan.c.func-sort-c.html
+++ b/cov/cmdline/scan.c.func-sort-c.html
@@ -73,11 +73,11 @@
| scan_file_keep |
- 1025531 |
+ 1025576 |
| file_is_full_invalid_parity_and_stable |
- 1025531 |
+ 1025576 |
| dd_ino_compare |
@@ -85,27 +85,27 @@
| scan_file_delayed_allocate |
- 101881 |
+ 101836 |
| scan_file_insert |
- 101881 |
+ 101836 |
| scan_file_allocate |
- 101881 |
+ 101836 |
| scan_file_refresh |
- 79201 |
+ 79156 |
| scan_file_remove |
- 57015 |
+ 56970 |
| scan_file_deallocate |
- 57015 |
+ 56970 |
| scan_link |
diff --git a/cov/cmdline/scan.c.func.html b/cov/cmdline/scan.c.func.html
index d7aa84cd..b1d3ee83 100644
--- a/cov/cmdline/scan.c.func.html
+++ b/cov/cmdline/scan.c.func.html
@@ -77,7 +77,7 @@
| file_is_full_invalid_parity_and_stable |
- 1025531 |
+ 1025576 |
| scan_dir |
@@ -101,31 +101,31 @@
| scan_file_allocate |
- 101881 |
+ 101836 |
| scan_file_deallocate |
- 57015 |
+ 56970 |
| scan_file_delayed_allocate |
- 101881 |
+ 101836 |
| scan_file_insert |
- 101881 |
+ 101836 |
| scan_file_keep |
- 1025531 |
+ 1025576 |
| scan_file_refresh |
- 79201 |
+ 79156 |
| scan_file_remove |
- 57015 |
+ 56970 |
| scan_link |
diff --git a/cov/cmdline/scan.c.gcov.html b/cov/cmdline/scan.c.gcov.html
index d337b6f9..d00d9cd4 100644
--- a/cov/cmdline/scan.c.gcov.html
+++ b/cov/cmdline/scan.c.gcov.html
@@ -220,42 +220,42 @@
158 : /**
159 : * Insert the specified file in the parity.
160 : */
- 161 101881 : static void scan_file_allocate(struct snapraid_scan* scan, struct snapraid_file* file)
+ 161 101836 : static void scan_file_allocate(struct snapraid_scan* scan, struct snapraid_file* file)
162 : {
- 163 101881 : struct snapraid_state* state = scan->state;
- 164 101881 : struct snapraid_disk* disk = scan->disk;
+ 163 101836 : struct snapraid_state* state = scan->state;
+ 164 101836 : struct snapraid_disk* disk = scan->disk;
165 : block_off_t i;
166 : block_off_t parity_pos;
167 :
168 : /* state changed */
- 169 101881 : state->need_write = 1;
+ 169 101836 : state->need_write = 1;
170 :
171 : /* allocate the blocks of the file */
- 172 101881 : parity_pos = disk->first_free_block;
- 173 353097 : for (i = 0; i < file->blockmax; ++i) {
+ 172 101836 : parity_pos = disk->first_free_block;
+ 173 352922 : for (i = 0; i < file->blockmax; ++i) {
174 : struct snapraid_block* block;
175 : struct snapraid_block* over_block;
176 : snapraid_info info;
177 :
178 : /* increment the position until the first really free block */
- 179 1022665 : while (block_has_file(fs_par2block_find(disk, parity_pos)))
- 180 520233 : ++parity_pos;
+ 179 1022464 : while (block_has_file(fs_par2block_find(disk, parity_pos)))
+ 180 520292 : ++parity_pos;
181 :
182 : /* get block we are going to overwrite, if any */
- 183 251216 : over_block = fs_par2block_find(disk, parity_pos);
+ 183 251086 : over_block = fs_par2block_find(disk, parity_pos);
184 :
185 : /* deallocate it */
- 186 251216 : if (over_block != BLOCK_NULL)
- 187 95303 : fs_deallocate(disk, parity_pos);
+ 186 251086 : if (over_block != BLOCK_NULL)
+ 187 95173 : fs_deallocate(disk, parity_pos);
188 :
189 : /* get block specific info */
- 190 251216 : info = info_get(&state->infoarr, parity_pos);
+ 190 251086 : info = info_get(&state->infoarr, parity_pos);
191 :
192 : /* get the new block we are going to write */
- 193 251216 : block = fs_file2block_get(file, i);
+ 193 251086 : block = fs_file2block_get(file, i);
194 :
195 : /* if the file block already has an updated hash without rehash */
- 196 251216 : if (block_has_updated_hash(block) && !info_get_rehash(info)) {
+ 196 251086 : if (block_has_updated_hash(block) && !info_get_rehash(info)) {
197 : /* the only possible case is for REP blocks */
198 86199 : assert(block_state_get(block) == BLOCK_STATE_REP);
199 :
@@ -267,25 +267,25 @@
205 : unsigned over_state;
206 :
207 : /* convert to a CHG block */
- 208 165017 : block_state_set(block, BLOCK_STATE_CHG);
+ 208 164887 : block_state_set(block, BLOCK_STATE_CHG);
209 :
210 : /* state of the block we are going to overwrite */
- 211 165017 : over_state = block_state_get(over_block);
+ 211 164887 : over_state = block_state_get(over_block);
212 :
213 : /* if the block is an empty one */
- 214 165017 : if (over_state == BLOCK_STATE_EMPTY) {
+ 214 164887 : if (over_state == BLOCK_STATE_EMPTY) {
215 : /* the block was empty and filled with zeros */
216 : /* set the hash to the special ZERO value */
217 115543 : hash_zero_set(block->hash);
218 : } else {
219 : /* otherwise it's a DELETED one */
- 220 49474 : assert(over_state == BLOCK_STATE_DELETED);
+ 220 49344 : assert(over_state == BLOCK_STATE_DELETED);
221 :
222 : /* copy the past hash of the block */
- 223 49474 : memcpy(block->hash, over_block->hash, BLOCK_HASH_SIZE);
+ 223 49344 : memcpy(block->hash, over_block->hash, BLOCK_HASH_SIZE);
224 :
225 : /* if we have not already cleared the past hash */
- 226 49474 : if (!state->clear_past_hash) {
+ 226 49344 : if (!state->clear_past_hash) {
227 : /* in this case we don't know if the old state is still the one */
228 : /* stored inside the parity, because after an aborted sync, the parity */
229 : /* may be or may be not have been updated with the new data */
@@ -302,15 +302,15 @@
240 : }
241 :
242 : /* store in the disk map, after invalidating all the other blocks */
- 243 251216 : fs_allocate(disk, parity_pos, file, i);
+ 243 251086 : fs_allocate(disk, parity_pos, file, i);
244 :
245 : /* set the new free position */
- 246 251216 : disk->first_free_block = parity_pos + 1;
+ 246 251086 : disk->first_free_block = parity_pos + 1;
247 : }
248 :
249 : /* insert in the list of contained files */
- 250 101881 : tommy_list_insert_tail(&disk->filelist, &file->nodelist, file);
- 251 101881 : }
+ 250 101836 : tommy_list_insert_tail(&disk->filelist, &file->nodelist, file);
+ 251 101836 : }
252 :
253 : /**
254 : * Delete the specified file from the parity.
@@ -319,23 +319,23 @@
257 : * The file is then inserted in the deleted set, and it should not be deallocated,
258 : * as the parity still references it.
259 : */
- 260 57015 : static void scan_file_deallocate(struct snapraid_scan* scan, struct snapraid_file* file)
+ 260 56970 : static void scan_file_deallocate(struct snapraid_scan* scan, struct snapraid_file* file)
261 : {
- 262 57015 : struct snapraid_state* state = scan->state;
- 263 57015 : struct snapraid_disk* disk = scan->disk;
+ 262 56970 : struct snapraid_state* state = scan->state;
+ 263 56970 : struct snapraid_disk* disk = scan->disk;
264 : block_off_t i;
265 :
266 : /* remove from the list of contained files */
- 267 57015 : tommy_list_remove_existing(&disk->filelist, &file->nodelist);
+ 267 56970 : tommy_list_remove_existing(&disk->filelist, &file->nodelist);
268 :
269 : /* state changed */
- 270 57015 : state->need_write = 1;
+ 270 56970 : state->need_write = 1;
271 :
272 : /* here we are supposed to adjust the ::first_free_block position */
273 : /* with the parity position we are deleting */
274 : /* but we also know that we do only delayed insert, after all the deletion, */
275 : /* so at this point ::first_free_block is always at 0, and we don't need to update it */
- 276 57015 : if (disk->first_free_block != 0) {
+ 276 56970 : if (disk->first_free_block != 0) {
277 : /* LCOV_EXCL_START */
278 : log_fatal("Internal inconsistency for first free position at '%u' deallocating file '%s'\n", disk->first_free_block, file->sub);
279 : os_abort();
@@ -343,17 +343,17 @@
281 : }
282 :
283 : /* free all the blocks of the file */
- 284 197616 : for (i = 0; i < file->blockmax; ++i) {
- 285 140601 : struct snapraid_block* block = fs_file2block_get(file, i);
+ 284 197441 : for (i = 0; i < file->blockmax; ++i) {
+ 285 140471 : struct snapraid_block* block = fs_file2block_get(file, i);
286 : unsigned block_state;
287 :
288 : /* in case we scan after an aborted sync, */
289 : /* we could get also intermediate states */
- 290 140601 : block_state = block_state_get(block);
- 291 140601 : switch (block_state) {
+ 290 140471 : block_state = block_state_get(block);
+ 291 140471 : switch (block_state) {
292 : case BLOCK_STATE_BLK :
293 : /* we keep the hash making it an "old" hash, because the parity is still containing data for it */
- 294 35660 : break;
+ 294 35530 : break;
295 : case BLOCK_STATE_CHG :
296 : /* if we have not already cleared the past hash */
297 28000 : if (!state->clear_past_hash) {
@@ -383,23 +383,23 @@
321 : }
322 :
323 : /* set the block as deleted */
- 324 140601 : block_state_set(block, BLOCK_STATE_DELETED);
+ 324 140471 : block_state_set(block, BLOCK_STATE_DELETED);
325 : }
326 :
327 : /* mark the file as deleted */
- 328 57015 : file_flag_set(file, FILE_IS_DELETED);
+ 328 56970 : file_flag_set(file, FILE_IS_DELETED);
329 :
330 : /* insert it in the list of deleted blocks */
- 331 57015 : tommy_list_insert_tail(&disk->deletedlist, &file->nodelist, file);
- 332 57015 : }
+ 331 56970 : tommy_list_insert_tail(&disk->deletedlist, &file->nodelist, file);
+ 332 56970 : }
333 :
- 334 101881 : static void scan_file_delayed_allocate(struct snapraid_scan* scan, struct snapraid_file* file)
+ 334 101836 : static void scan_file_delayed_allocate(struct snapraid_scan* scan, struct snapraid_file* file)
335 : {
- 336 101881 : struct snapraid_state* state = scan->state;
- 337 101881 : struct snapraid_disk* disk = scan->disk;
+ 336 101836 : struct snapraid_state* state = scan->state;
+ 337 101836 : struct snapraid_disk* disk = scan->disk;
338 :
339 : /* if we sort for physical offsets we have to read them for new files */
- 340 101881 : if (state->opt.force_order == SORT_PHYSICAL
+ 340 101836 : if (state->opt.force_order == SORT_PHYSICAL
341 11432 : && file->physical == FILEPHY_UNREAD_OFFSET
342 : ) {
343 : char path_next[PATH_MAX];
@@ -415,30 +415,30 @@
353 : }
354 :
355 : /* insert in the delayed list */
- 356 101881 : tommy_list_insert_tail(&scan->file_insert_list, &file->nodelist, file);
- 357 101881 : }
+ 356 101836 : tommy_list_insert_tail(&scan->file_insert_list, &file->nodelist, file);
+ 357 101836 : }
358 :
359 : /**
360 : * Check if a file is completely formed of blocks with invalid parity,
361 : * and no rehash is tagged, and if it has at least one block.
362 : */
- 363 1025531 : static int file_is_full_invalid_parity_and_stable(struct snapraid_state* state, struct snapraid_disk* disk, struct snapraid_file* file)
+ 363 1025576 : static int file_is_full_invalid_parity_and_stable(struct snapraid_state* state, struct snapraid_disk* disk, struct snapraid_file* file)
364 : {
365 : block_off_t i;
366 :
367 : /* with no block, it never has an invalid parity */
- 368 1025531 : if (file->blockmax == 0)
- 369 1438 : return 0;
+ 368 1025576 : if (file->blockmax == 0)
+ 369 1436 : return 0;
370 :
371 : /* check all blocks */
- 372 1080005 : for (i = 0; i < file->blockmax; ++i) {
+ 372 1080052 : for (i = 0; i < file->blockmax; ++i) {
373 : snapraid_info info;
- 374 1057325 : struct snapraid_block* block = fs_file2block_get(file, i);
+ 374 1057372 : struct snapraid_block* block = fs_file2block_get(file, i);
375 : block_off_t parity_pos;
376 :
377 : /* exclude blocks with parity */
- 378 1057325 : if (!block_has_invalid_parity(block))
- 379 1001413 : return 0;
+ 378 1057372 : if (!block_has_invalid_parity(block))
+ 379 1001460 : return 0;
380 :
381 : /*
382 : * Get the parity position.
@@ -525,7 +525,7 @@
463 : *
464 : * If this happens, we read also the physical offset, to avoid to read it later.
465 : */
- 466 79201 : static void scan_file_refresh(struct snapraid_scan* scan, const char* sub, struct stat* st, uint64_t* physical)
+ 466 79156 : static void scan_file_refresh(struct snapraid_scan* scan, const char* sub, struct stat* st, uint64_t* physical)
467 : {
468 : #if HAVE_LSTAT_SYNC
469 : struct snapraid_state* state = scan->state;
@@ -597,43 +597,43 @@
535 : (void)st;
536 : (void)physical;
537 : #endif
- 538 79201 : }
+ 538 79156 : }
539 :
540 : /**
541 : * Insert the file in the data set.
542 : */
- 543 101881 : static void scan_file_insert(struct snapraid_scan* scan, struct snapraid_file* file)
+ 543 101836 : static void scan_file_insert(struct snapraid_scan* scan, struct snapraid_file* file)
544 : {
- 545 101881 : struct snapraid_disk* disk = scan->disk;
+ 545 101836 : struct snapraid_disk* disk = scan->disk;
546 :
547 : /* insert the file in the containers */
- 548 101881 : if (!file_flag_has(file, FILE_IS_WITHOUT_INODE))
- 549 101881 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
- 550 101881 : tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
- 551 101881 : tommy_hashdyn_insert(&disk->stampset, &file->stampset, file, file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec));
+ 548 101836 : if (!file_flag_has(file, FILE_IS_WITHOUT_INODE))
+ 549 101836 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
+ 550 101836 : tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
+ 551 101836 : tommy_hashdyn_insert(&disk->stampset, &file->stampset, file, file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec));
552 :
553 : /* delayed allocation of the parity */
- 554 101881 : scan_file_delayed_allocate(scan, file);
- 555 101881 : }
+ 554 101836 : scan_file_delayed_allocate(scan, file);
+ 555 101836 : }
556 :
557 : /**
558 : * Remove the file from the data set.
559 : *
560 : * File is then deleted.
561 : */
- 562 57015 : static void scan_file_remove(struct snapraid_scan* scan, struct snapraid_file* file)
+ 562 56970 : static void scan_file_remove(struct snapraid_scan* scan, struct snapraid_file* file)
563 : {
- 564 57015 : struct snapraid_disk* disk = scan->disk;
+ 564 56970 : struct snapraid_disk* disk = scan->disk;
565 :
566 : /* remove the file from the containers */
- 567 57015 : if (!file_flag_has(file, FILE_IS_WITHOUT_INODE))
- 568 56963 : tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
- 569 57015 : tommy_hashdyn_remove_existing(&disk->pathset, &file->pathset);
- 570 57015 : tommy_hashdyn_remove_existing(&disk->stampset, &file->stampset);
+ 567 56970 : if (!file_flag_has(file, FILE_IS_WITHOUT_INODE))
+ 568 56918 : tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
+ 569 56970 : tommy_hashdyn_remove_existing(&disk->pathset, &file->pathset);
+ 570 56970 : tommy_hashdyn_remove_existing(&disk->stampset, &file->stampset);
571 :
572 : /* deallocate the file from the parity */
- 573 57015 : scan_file_deallocate(scan, file);
- 574 57015 : }
+ 573 56970 : scan_file_deallocate(scan, file);
+ 574 56970 : }
575 :
576 : /**
577 : * Keep the file as it's (or with only a name/inode modification).
@@ -646,12 +646,12 @@
584 : * This could happen after a failed sync, when some other files are deleted,
585 : * and then new ones can be moved backward to fill the hole created.
586 : */
- 587 1025531 : static void scan_file_keep(struct snapraid_scan* scan, struct snapraid_file* file)
+ 587 1025576 : static void scan_file_keep(struct snapraid_scan* scan, struct snapraid_file* file)
588 : {
- 589 1025531 : struct snapraid_disk* disk = scan->disk;
+ 589 1025576 : struct snapraid_disk* disk = scan->disk;
590 :
591 : /* if the file is full invalid, schedule a reinsert at later stage */
- 592 1025531 : if (file_is_full_invalid_parity_and_stable(scan->state, disk, file)) {
+ 592 1025576 : if (file_is_full_invalid_parity_and_stable(scan->state, disk, file)) {
593 22680 : struct snapraid_file* copy = file_dup(file);
594 :
595 : /* remove the file */
@@ -660,7 +660,7 @@
598 : /* reinsert the copy in the delayed list */
599 22680 : scan_file_insert(scan, copy);
600 : }
- 601 1025531 : }
+ 601 1025576 : }
602 :
603 : /**
604 : * Process a file.
@@ -717,17 +717,17 @@
655 : /* identify moved files with past inodes and hardlinks with the new inodes */
656 1104927 : if (file) {
657 : /* check if the file is not changed */
- 658 949702 : if (file->size == st->st_size
- 659 935958 : && file->mtime_sec == st->st_mtime
- 660 932913 : && (file->mtime_nsec == STAT_NSEC(st)
+ 658 949639 : if (file->size == st->st_size
+ 659 935884 : && file->mtime_sec == st->st_mtime
+ 660 932864 : && (file->mtime_nsec == STAT_NSEC(st)
661 : /* always accept the stored value if it's STAT_NSEC_INVALID */
662 : /* it happens when upgrading from an old version of SnapRAID */
663 : /* not yet supporting the nanosecond field */
- 664 1 : || file->mtime_nsec == STAT_NSEC_INVALID
+ 664 2 : || file->mtime_nsec == STAT_NSEC_INVALID
665 : )
666 : ) {
667 : /* check if multiple files have the same inode */
- 668 932912 : if (file_flag_has(file, FILE_IS_PRESENT)) {
+ 668 932862 : if (file_flag_has(file, FILE_IS_PRESENT)) {
669 : #if HAVE_STRUCT_STAT_ST_NLINK
670 195 : if (st->st_nlink <= 1) {
671 : /* LCOV_EXCL_START */
@@ -742,11 +742,11 @@
680 : }
681 :
682 : /* mark as present */
- 683 932717 : file_flag_set(file, FILE_IS_PRESENT);
+ 683 932667 : file_flag_set(file, FILE_IS_PRESENT);
684 :
685 : /* update the nanoseconds mtime only if different */
686 : /* to avoid unneeded updates */
- 687 932717 : if (file->mtime_nsec == STAT_NSEC_INVALID
+ 687 932667 : if (file->mtime_nsec == STAT_NSEC_INVALID
688 0 : && STAT_NSEC(st) != file->mtime_nsec
689 : ) {
690 0 : file->mtime_nsec = STAT_NSEC(st);
@@ -755,7 +755,7 @@
693 0 : state->need_write = 1;
694 : }
695 :
- 696 932717 : if (strcmp(file->sub, sub) != 0) {
+ 696 932667 : if (strcmp(file->sub, sub) != 0) {
697 : /* if the path is different, it means a moved file with the same inode */
698 155 : ++scan->count_move;
699 :
@@ -777,18 +777,18 @@
715 155 : state->need_write = 1;
716 : } else {
717 : /* otherwise it's equal */
- 718 932562 : ++scan->count_equal;
+ 718 932512 : ++scan->count_equal;
719 :
- 720 932562 : if (state->opt.gui) {
+ 720 932512 : if (state->opt.gui) {
721 22599 : log_tag("scan:equal:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
722 : }
723 : }
724 :
725 : /* mark the file as kept */
- 726 932717 : scan_file_keep(scan, file);
+ 726 932667 : scan_file_keep(scan, file);
727 :
728 : /* nothing more to do */
- 729 932717 : return;
+ 729 932667 : return;
730 : }
731 :
732 : /* here the file matches the inode, but not the other info */
@@ -797,7 +797,7 @@
735 : /* or a file-system with not persistent inodes */
736 :
737 : /* for sure it cannot be already present */
- 738 16790 : if (file_flag_has(file, FILE_IS_PRESENT)) {
+ 738 16777 : if (file_flag_has(file, FILE_IS_PRESENT)) {
739 : /* LCOV_EXCL_START */
740 : log_fatal("Internal inode '%" PRIu64 "' inconsistency for files '%s%s' and '%s%s' matching and already present but different\n", file->inode, disk->dir, sub, disk->dir, file->sub);
741 : os_abort();
@@ -810,44 +810,44 @@
748 : /* otherwise, it will get removed */
749 :
750 : /* remove from the inode set */
- 751 16790 : tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
+ 751 16777 : tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
752 :
753 : /* clear the inode */
754 : /* this is not really needed for correct functionality */
755 : /* because we are going to set FILE_IS_WITHOUT_INODE */
756 : /* but it's easier for debugging to have invalid inodes set to 0 */
- 757 16790 : file->inode = 0;
+ 757 16777 : file->inode = 0;
758 :
759 : /* mark as missing inode */
- 760 16790 : file_flag_set(file, FILE_IS_WITHOUT_INODE);
+ 760 16777 : file_flag_set(file, FILE_IS_WITHOUT_INODE);
761 :
762 : /* go further to find it by name */
763 : }
764 :
765 : /* initialize for later overwrite */
- 766 172015 : is_file_reported = 0;
- 767 172015 : is_original_file_size_different_than_zero = 0;
+ 766 172065 : is_file_reported = 0;
+ 767 172065 : is_original_file_size_different_than_zero = 0;
768 :
769 : /* then try finding it by name */
- 770 172015 : file = tommy_hashdyn_search(&disk->pathset, file_path_compare_to_arg, sub, file_path_hash(sub));
+ 770 172065 : file = tommy_hashdyn_search(&disk->pathset, file_path_compare_to_arg, sub, file_path_hash(sub));
771 :
772 : /* keep track if the file already exists */
- 773 172015 : is_file_already_present = file != 0;
+ 773 172065 : is_file_already_present = file != 0;
774 :
- 775 172015 : if (is_file_already_present) {
+ 775 172065 : if (is_file_already_present) {
776 : /* if the file is without an inode */
- 777 97502 : if (file_flag_has(file, FILE_IS_WITHOUT_INODE)) {
+ 777 97552 : if (file_flag_has(file, FILE_IS_WITHOUT_INODE)) {
778 : /* set it now */
- 779 16752 : file->inode = st->st_ino;
+ 779 16739 : file->inode = st->st_ino;
780 :
781 : /* insert in the set */
- 782 16752 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
+ 782 16739 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
783 :
784 : /* unmark as missing inode */
- 785 16752 : file_flag_clear(file, FILE_IS_WITHOUT_INODE);
+ 785 16739 : file_flag_clear(file, FILE_IS_WITHOUT_INODE);
786 : } else {
787 : /* here the inode has to be different, otherwise we would have found it before */
- 788 80750 : if (file->inode == st->st_ino) {
+ 788 80813 : if (file->inode == st->st_ino) {
789 : /* LCOV_EXCL_START */
790 : log_fatal("Internal inconsistency in inode '%" PRIu64 "' for files '%s%s' as unexpected matching\n", file->inode, disk->dir, sub);
791 : os_abort();
@@ -856,7 +856,7 @@
794 : }
795 :
796 : /* for sure it cannot be already present */
- 797 97502 : if (file_flag_has(file, FILE_IS_PRESENT)) {
+ 797 97552 : if (file_flag_has(file, FILE_IS_PRESENT)) {
798 : /* LCOV_EXCL_START */
799 : log_fatal("Internal inconsistency in path for file '%s%s' matching and already present\n", disk->dir, sub);
800 : os_abort();
@@ -864,9 +864,9 @@
802 : }
803 :
804 : /* check if the file is not changed */
- 805 97502 : if (file->size == st->st_size
- 806 96906 : && file->mtime_sec == st->st_mtime
- 807 92814 : && (file->mtime_nsec == STAT_NSEC(st)
+ 805 97552 : if (file->size == st->st_size
+ 806 96956 : && file->mtime_sec == st->st_mtime
+ 807 92909 : && (file->mtime_nsec == STAT_NSEC(st)
808 : /* always accept the stored value if it's STAT_NSEC_INVALID */
809 : /* it happens when upgrading from an old version of SnapRAID */
810 : /* not yet supporting the nanosecond field */
@@ -874,11 +874,11 @@
812 : )
813 : ) {
814 : /* mark as present */
- 815 92814 : file_flag_set(file, FILE_IS_PRESENT);
+ 815 92909 : file_flag_set(file, FILE_IS_PRESENT);
816 :
817 : /* update the nano seconds mtime only if different */
818 : /* to avoid unneeded updates */
- 819 92814 : if (file->mtime_nsec == STAT_NSEC_INVALID
+ 819 92909 : if (file->mtime_nsec == STAT_NSEC_INVALID
820 0 : && STAT_NSEC(st) != STAT_NSEC_INVALID
821 : ) {
822 0 : file->mtime_nsec = STAT_NSEC(st);
@@ -888,30 +888,30 @@
826 : }
827 :
828 : /* if when processing the disk we used the past inodes values */
- 829 92814 : if (has_past_inodes) {
+ 829 92909 : if (has_past_inodes) {
830 : /* if persistent inodes are supported, we are sure that the inode number */
831 : /* is now different, because otherwise the file would have been found */
832 : /* when searching by inode. */
833 : /* if the inode is different, it means a rewritten file with the same path */
834 : /* like when restoring a backup that restores also the timestamp */
- 835 92800 : ++scan->count_restore;
+ 835 92895 : ++scan->count_restore;
836 :
- 837 92800 : log_tag("scan:restore:%s:%s\n", disk->name, esc_tag(sub, esc_buffer));
- 838 92800 : if (is_diff) {
+ 837 92895 : log_tag("scan:restore:%s:%s\n", disk->name, esc_tag(sub, esc_buffer));
+ 838 92895 : if (is_diff) {
839 0 : printf("restore %s\n", fmt_term(disk, sub, esc_buffer));
840 : }
841 :
842 : /* remove from the inode set */
- 843 92800 : tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
+ 843 92895 : tommy_hashdyn_remove_existing(&disk->inodeset, &file->nodeset);
844 :
845 : /* save the new inode */
- 846 92800 : file->inode = st->st_ino;
+ 846 92895 : file->inode = st->st_ino;
847 :
848 : /* reinsert in the inode set */
- 849 92800 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
+ 849 92895 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
850 :
851 : /* we have to save the new inode */
- 852 92800 : state->need_write = 1;
+ 852 92895 : state->need_write = 1;
853 : } else {
854 : /* otherwise it's the case of not persistent inode, where doesn't */
855 : /* matter if the inode is different or equal, because they have no */
@@ -924,24 +924,24 @@
862 : }
863 :
864 : /* mark the file as kept */
- 865 92814 : scan_file_keep(scan, file);
+ 865 92909 : scan_file_keep(scan, file);
866 :
867 : /* nothing more to do */
- 868 92814 : return;
+ 868 92909 : return;
869 : }
870 :
871 : /* here if the file is changed but with the correct name */
872 :
873 : /* save the info for later printout */
- 874 4688 : file_already_present_size = file->size;
- 875 4688 : file_already_present_mtime_sec = file->mtime_sec;
- 876 4688 : file_already_present_mtime_nsec = file->mtime_nsec;
+ 874 4643 : file_already_present_size = file->size;
+ 875 4643 : file_already_present_mtime_sec = file->mtime_sec;
+ 876 4643 : file_already_present_mtime_nsec = file->mtime_nsec;
877 :
878 : /* keep track if the original file was not of zero size */
- 879 4688 : is_original_file_size_different_than_zero = file->size != 0;
+ 879 4643 : is_original_file_size_different_than_zero = file->size != 0;
880 :
881 : /* remove it, and continue to insert it again */
- 882 4688 : scan_file_remove(scan, file);
+ 882 4643 : scan_file_remove(scan, file);
883 :
884 : /* and continue to insert it again */
885 : } else {
@@ -953,13 +953,13 @@
891 : /* refresh the info, to ensure that they are synced, */
892 : /* note that we refresh only the info of the new or modified files */
893 : /* because this is slow operation */
- 894 79201 : scan_file_refresh(scan, sub, st, &physical);
+ 894 79156 : scan_file_refresh(scan, sub, st, &physical);
895 :
896 : #ifndef _WIN32
897 : /* do a safety check to ensure that the common ext4 case of zeroing */
898 : /* the size of a file after a crash doesn't propagate to the backup */
899 : /* this check is specific for Linux, so we disable it on Windows */
- 900 79201 : if (is_original_file_size_different_than_zero && st->st_size == 0) {
+ 900 79156 : if (is_original_file_size_different_than_zero && st->st_size == 0) {
901 0 : if (!state->opt.force_zero) {
902 : /* LCOV_EXCL_START */
903 : log_fatal("The file '%s%s' has unexpected zero size!\n", disk->dir, sub);
@@ -978,33 +978,33 @@
916 : #endif
917 :
918 : /* insert it */
- 919 79201 : file = file_alloc(state->block_size, sub, st->st_size, st->st_mtime, STAT_NSEC(st), st->st_ino, physical);
+ 919 79156 : file = file_alloc(state->block_size, sub, st->st_size, st->st_mtime, STAT_NSEC(st), st->st_ino, physical);
920 :
921 : /* mark it as present */
- 922 79201 : file_flag_set(file, FILE_IS_PRESENT);
+ 922 79156 : file_flag_set(file, FILE_IS_PRESENT);
923 :
924 : /* if copy detection is enabled */
925 : /* note that the copy detection is tried also for updated files */
926 : /* this makes sense because it may happen to have two different copies */
927 : /* of the same file, and we move the right one over the wrong one */
928 : /* in such case we have a "copy" over an "update" */
- 929 79201 : if (!state->opt.force_nocopy) {
- 930 79201 : tommy_uint32_t hash = file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec);
+ 929 79156 : if (!state->opt.force_nocopy) {
+ 930 79156 : tommy_uint32_t hash = file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec);
931 :
932 : /* search for a file with the same name and stamp in all the disks */
- 933 423459 : for (i = state->disklist; i != 0; i = i->next) {
- 934 367894 : struct snapraid_disk* other_disk = i->data;
+ 933 423144 : for (i = state->disklist; i != 0; i = i->next) {
+ 934 367624 : struct snapraid_disk* other_disk = i->data;
935 : struct snapraid_file* other_file;
936 :
937 : /* if the nanosecond part of the time stamp is valid, search */
938 : /* for name and stamp, otherwise for path and stamp */
- 939 367894 : if (file->mtime_nsec != 0 && file->mtime_nsec != STAT_NSEC_INVALID)
- 940 367786 : other_file = tommy_hashdyn_search(&other_disk->stampset, file_namestamp_compare, file, hash);
+ 939 367624 : if (file->mtime_nsec != 0 && file->mtime_nsec != STAT_NSEC_INVALID)
+ 940 367516 : other_file = tommy_hashdyn_search(&other_disk->stampset, file_namestamp_compare, file, hash);
941 : else
942 108 : other_file = tommy_hashdyn_search(&other_disk->stampset, file_pathstamp_compare, file, hash);
943 :
944 : /* if found, and it's a fully hashed file */
- 945 367894 : if (other_file && file_is_full_hashed_and_stable(scan->state, other_disk, other_file)) {
+ 945 367624 : if (other_file && file_is_full_hashed_and_stable(scan->state, other_disk, other_file)) {
946 : /* assume that the file is a copy, and reuse the hash */
947 23636 : file_copy(other_file, file);
948 :
@@ -1027,16 +1027,16 @@
965 :
966 : /* if not yet reported, do it now */
967 : /* we postpone this to avoid to print two times the copied files */
- 968 79201 : if (!is_file_reported) {
- 969 55565 : if (is_file_already_present) {
- 970 4688 : ++scan->count_change;
+ 968 79156 : if (!is_file_reported) {
+ 969 55520 : if (is_file_already_present) {
+ 970 4643 : ++scan->count_change;
971 :
- 972 14064 : log_tag("scan:update:%s:%s: %" PRIu64 " %" PRIu64 ".%d -> %" PRIu64 " %" PRIu64 ".%d\n", disk->name, esc_tag(sub, esc_buffer),
+ 972 13929 : log_tag("scan:update:%s:%s: %" PRIu64 " %" PRIu64 ".%d -> %" PRIu64 " %" PRIu64 ".%d\n", disk->name, esc_tag(sub, esc_buffer),
973 : (uint64_t)file_already_present_size, (uint64_t)file_already_present_mtime_sec, file_already_present_mtime_nsec,
- 974 9376 : (uint64_t)file->size, (uint64_t)file->mtime_sec, file->mtime_nsec
+ 974 9286 : (uint64_t)file->size, (uint64_t)file->mtime_sec, file->mtime_nsec
975 : );
976 :
- 977 4688 : if (is_diff) {
+ 977 4643 : if (is_diff) {
978 118 : printf("update %s\n", fmt_term(disk, sub, esc_buffer));
979 : }
980 : } else {
@@ -1050,7 +1050,7 @@
988 : }
989 :
990 : /* insert the file in the delayed list */
- 991 79201 : scan_file_insert(scan, file);
+ 991 79156 : scan_file_insert(scan, file);
992 : }
993 :
994 : /**
@@ -1584,14 +1584,14 @@
1522 :
1523 : /* check for removed files */
1524 569 : node = disk->filelist;
- 1525 1033636 : while (node) {
- 1526 1032498 : struct snapraid_file* file = node->data;
+ 1525 1033681 : while (node) {
+ 1526 1032543 : struct snapraid_file* file = node->data;
1527 :
1528 : /* next node */
- 1529 1032498 : node = node->next;
+ 1529 1032543 : node = node->next;
1530 :
1531 : /* remove if not present */
- 1532 1032498 : if (!file_flag_has(file, FILE_IS_PRESENT)) {
+ 1532 1032543 : if (!file_flag_has(file, FILE_IS_PRESENT)) {
1533 29647 : ++scan->count_remove;
1534 :
1535 29647 : log_tag("scan:remove:%s:%s\n", disk->name, esc_tag(file->sub, esc_buffer));
@@ -1664,11 +1664,11 @@
1602 569 : phy_dup = 0;
1603 569 : phy_last = FILEPHY_UNREAD_OFFSET;
1604 569 : phy_file_last = 0;
- 1605 103019 : while (node) {
- 1606 101881 : struct snapraid_file* file = node->data;
+ 1605 102974 : while (node) {
+ 1606 101836 : struct snapraid_file* file = node->data;
1607 :
1608 : /* if the file is not empty, count duplicate physical offsets */
- 1609 101881 : if (state->opt.force_order == SORT_PHYSICAL && file->size != 0) {
+ 1609 101836 : if (state->opt.force_order == SORT_PHYSICAL && file->size != 0) {
1610 11418 : if (phy_file_last != 0 && file->physical == phy_last
1611 : /* files without offset are expected to have duplicates */
1612 0 : && phy_last != FILEPHY_WITHOUT_OFFSET
@@ -1686,10 +1686,10 @@
1624 : }
1625 :
1626 : /* next node */
- 1627 101881 : node = node->next;
+ 1627 101836 : node = node->next;
1628 :
1629 : /* insert in the parity */
- 1630 101881 : scan_file_allocate(scan, file);
+ 1630 101836 : scan_file_allocate(scan, file);
1631 : }
1632 :
1633 : /* mark the disk without reliable physical offset if it has duplicates */
diff --git a/cov/cmdline/scrub.c.func-sort-c.html b/cov/cmdline/scrub.c.func-sort-c.html
index bc07fa4f..30aeecf9 100644
--- a/cov/cmdline/scrub.c.func-sort-c.html
+++ b/cov/cmdline/scrub.c.func-sort-c.html
@@ -61,11 +61,11 @@
| scrub_parity_reader |
- 168184 |
+ 168183 |
| scrub_data_reader |
- 168178 |
+ 168180 |
| block_is_enabled |
diff --git a/cov/cmdline/scrub.c.func.html b/cov/cmdline/scrub.c.func.html
index 289810a1..3d33634a 100644
--- a/cov/cmdline/scrub.c.func.html
+++ b/cov/cmdline/scrub.c.func.html
@@ -69,11 +69,11 @@
| scrub_data_reader |
- 168178 |
+ 168180 |
| scrub_parity_reader |
- 168184 |
+ 168183 |
| state_scrub |
diff --git a/cov/cmdline/scrub.c.gcov.html b/cov/cmdline/scrub.c.gcov.html
index 756f8357..e2b44b96 100644
--- a/cov/cmdline/scrub.c.gcov.html
+++ b/cov/cmdline/scrub.c.gcov.html
@@ -146,16 +146,16 @@
84 56244 : blocktime = info_get_time(info);
85 56244 : if (blocktime > plan->timelimit) {
86 : /* skip it */
- 87 9574 : return 0;
+ 87 9582 : return 0;
88 : }
89 :
90 : /* if the time is less than the limit, always include */
91 : /* otherwise, check if we reached the last limit count */
- 92 46670 : if (blocktime == plan->timelimit) {
+ 92 46662 : if (blocktime == plan->timelimit) {
93 : /* if we reached the count limit */
- 94 30132 : if (plan->countlast >= plan->lastlimit) {
+ 94 30124 : if (plan->countlast >= plan->lastlimit) {
95 : /* skip it */
- 96 24940 : return 0;
+ 96 24932 : return 0;
97 : }
98 :
99 5192 : ++plan->countlast;
@@ -164,19 +164,19 @@
102 21730 : return 1;
103 : }
104 :
- 105 168178 : static void scrub_data_reader(struct snapraid_worker* worker, struct snapraid_task* task)
+ 105 168180 : static void scrub_data_reader(struct snapraid_worker* worker, struct snapraid_task* task)
106 : {
- 107 168178 : struct snapraid_io* io = worker->io;
- 108 168178 : struct snapraid_state* state = io->state;
- 109 168178 : struct snapraid_handle* handle = worker->handle;
- 110 168178 : struct snapraid_disk* disk = handle->disk;
- 111 168178 : block_off_t blockcur = task->position;
- 112 168178 : unsigned char* buffer = task->buffer;
+ 107 168180 : struct snapraid_io* io = worker->io;
+ 108 168180 : struct snapraid_state* state = io->state;
+ 109 168180 : struct snapraid_handle* handle = worker->handle;
+ 110 168180 : struct snapraid_disk* disk = handle->disk;
+ 111 168180 : block_off_t blockcur = task->position;
+ 112 168180 : unsigned char* buffer = task->buffer;
113 : int ret;
114 : char esc_buffer[ESC_MAX];
115 :
116 : /* if the disk position is not used */
- 117 168178 : if (!disk) {
+ 117 168180 : if (!disk) {
118 : /* use an empty block */
119 0 : memset(buffer, 0, state->block_size);
120 0 : task->state = TASK_STATE_DONE;
@@ -184,10 +184,10 @@
122 : }
123 :
124 : /* get the block */
- 125 168178 : task->block = fs_par2block_find(disk, blockcur);
+ 125 168180 : task->block = fs_par2block_find(disk, blockcur);
126 :
127 : /* if the block is not used */
- 128 168143 : if (!block_has_file(task->block)) {
+ 128 168136 : if (!block_has_file(task->block)) {
129 : /* use an empty block */
130 1585 : memset(buffer, 0, state->block_size);
131 1585 : task->state = TASK_STATE_DONE;
@@ -195,14 +195,14 @@
133 : }
134 :
135 : /* get the file of this block */
- 136 166543 : task->file = fs_par2file_get(disk, blockcur, &task->file_pos);
+ 136 166540 : task->file = fs_par2file_get(disk, blockcur, &task->file_pos);
137 :
138 : /* if the file is different than the current one, close it */
- 139 166579 : if (handle->file != 0 && handle->file != task->file) {
+ 139 166578 : if (handle->file != 0 && handle->file != task->file) {
140 : /* keep a pointer at the file we are going to close for error reporting */
- 141 78065 : struct snapraid_file* report = handle->file;
- 142 78065 : ret = handle_close(handle);
- 143 78039 : if (ret == -1) {
+ 141 78089 : struct snapraid_file* report = handle->file;
+ 142 78089 : ret = handle_close(handle);
+ 143 78065 : if (ret == -1) {
144 : /* LCOV_EXCL_START */
145 : /* This one is really an unexpected error, because we are only reading */
146 : /* and closing a descriptor should never fail */
@@ -225,8 +225,8 @@
163 : }
164 : }
165 :
- 166 166553 : ret = handle_open(handle, task->file, state->file_mode, log_error, 0);
- 167 166585 : if (ret == -1) {
+ 166 166554 : ret = handle_open(handle, task->file, state->file_mode, log_error, 0);
+ 167 166583 : if (ret == -1) {
168 0 : if (errno == EIO) {
169 : /* LCOV_EXCL_START */
170 : log_tag("error:%u:%s:%s: Open EIO error. %s\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer), strerror(errno));
@@ -244,8 +244,8 @@
182 : }
183 :
184 : /* check if the file is changed */
- 185 166585 : if (handle->st.st_size != task->file->size
- 186 166583 : || handle->st.st_mtime != task->file->mtime_sec
+ 185 166583 : if (handle->st.st_size != task->file->size
+ 186 166586 : || handle->st.st_mtime != task->file->mtime_sec
187 160991 : || STAT_NSEC(&handle->st) != task->file->mtime_nsec
188 : /* don't check the inode to support filesystem without persistent inodes */
189 : ) {
@@ -258,7 +258,7 @@
196 : /* from the last sync, as we are expected to return errors if running */
197 : /* in an unsynced array. This is just like the check command. */
198 :
- 199 166585 : task->read_size = handle_read(handle, task->file_pos, buffer, state->block_size, log_error, 0);
+ 199 166583 : task->read_size = handle_read(handle, task->file_pos, buffer, state->block_size, log_error, 0);
200 166516 : if (task->read_size == -1) {
201 0 : if (errno == EIO) {
202 0 : log_tag("error:%u:%s:%s: Read EIO error at position %u. %s\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer), task->file_pos, strerror(errno));
@@ -275,22 +275,22 @@
213 : /* store the path of the opened file */
214 166516 : pathcpy(task->path, sizeof(task->path), handle->path);
215 :
- 216 166568 : task->state = TASK_STATE_DONE;
+ 216 166573 : task->state = TASK_STATE_DONE;
217 : }
218 :
- 219 168184 : static void scrub_parity_reader(struct snapraid_worker* worker, struct snapraid_task* task)
+ 219 168183 : static void scrub_parity_reader(struct snapraid_worker* worker, struct snapraid_task* task)
220 : {
- 221 168184 : struct snapraid_io* io = worker->io;
- 222 168184 : struct snapraid_state* state = io->state;
- 223 168184 : struct snapraid_parity_handle* parity_handle = worker->parity_handle;
- 224 168184 : unsigned level = parity_handle->level;
- 225 168184 : block_off_t blockcur = task->position;
- 226 168184 : unsigned char* buffer = task->buffer;
+ 221 168183 : struct snapraid_io* io = worker->io;
+ 222 168183 : struct snapraid_state* state = io->state;
+ 223 168183 : struct snapraid_parity_handle* parity_handle = worker->parity_handle;
+ 224 168183 : unsigned level = parity_handle->level;
+ 225 168183 : block_off_t blockcur = task->position;
+ 226 168183 : unsigned char* buffer = task->buffer;
227 : int ret;
228 :
229 : /* read the parity */
- 230 168184 : ret = parity_read(parity_handle, blockcur, buffer, state->block_size, log_error);
- 231 168168 : if (ret == -1) {
+ 230 168183 : ret = parity_read(parity_handle, blockcur, buffer, state->block_size, log_error);
+ 231 167659 : if (ret == -1) {
232 0 : if (errno == EIO) {
233 0 : log_tag("parity_error:%u:%s: Read EIO error. %s\n", blockcur, lev_config_name(level), strerror(errno));
234 0 : log_error("Input/Output error in parity '%s' at position '%u'\n", lev_config_name(level), blockcur);
@@ -303,7 +303,7 @@
241 0 : return;
242 : }
243 :
- 244 168168 : task->state = TASK_STATE_DONE;
+ 244 167659 : task->state = TASK_STATE_DONE;
245 : }
246 :
247 11 : static int state_scrub_process(struct snapraid_state* state, struct snapraid_parity_handle* parity_handle, block_off_t blockstart, block_off_t blockmax, struct snapraid_plan* plan, time_t now)
@@ -872,12 +872,12 @@
810 : /* output the info map */
811 11 : i = 0;
812 11 : log_tag("info_count:%u\n", count);
- 813 40 : while (i < count) {
- 814 18 : unsigned j = i + 1;
- 815 56103 : while (j < count && timemap[i] == timemap[j])
- 816 56067 : ++j;
- 817 18 : log_tag("info_time:%" PRIu64 ":%u\n", (uint64_t)timemap[i], j - i);
- 818 18 : i = j;
+ 813 43 : while (i < count) {
+ 814 21 : unsigned j = i + 1;
+ 815 56106 : while (j < count && timemap[i] == timemap[j])
+ 816 56064 : ++j;
+ 817 21 : log_tag("info_time:%" PRIu64 ":%u\n", (uint64_t)timemap[i], j - i);
+ 818 21 : i = j;
819 : }
820 :
821 : /* compute the limits from count/recentlimit */
diff --git a/cov/cmdline/search.c.func-sort-c.html b/cov/cmdline/search.c.func-sort-c.html
index 8a58e3c5..02721bee 100644
--- a/cov/cmdline/search.c.func-sort-c.html
+++ b/cov/cmdline/search.c.func-sort-c.html
@@ -61,19 +61,19 @@
| search_file |
- 1844175 |
+ 1843728 |
| search_file_free |
- 1844175 |
+ 1843728 |
| state_search_fetch |
- 638351 |
+ 639176 |
| search_file_compare |
- 20091 |
+ 20130 |
| search_dir |
diff --git a/cov/cmdline/search.c.func.html b/cov/cmdline/search.c.func.html
index c7900b65..fe7f744e 100644
--- a/cov/cmdline/search.c.func.html
+++ b/cov/cmdline/search.c.func.html
@@ -65,15 +65,15 @@
| search_file |
- 1844175 |
+ 1843728 |
| search_file_compare |
- 20091 |
+ 20130 |
| search_file_free |
- 1844175 |
+ 1843728 |
| state_search |
@@ -85,7 +85,7 @@
| state_search_fetch |
- 638351 |
+ 639176 |
diff --git a/cov/cmdline/search.c.gcov.html b/cov/cmdline/search.c.gcov.html
index 39828f1a..fcd3b596 100644
--- a/cov/cmdline/search.c.gcov.html
+++ b/cov/cmdline/search.c.gcov.html
@@ -85,27 +85,27 @@
23 : /****************************************************************************/
24 : /* search */
25 :
- 26 1844175 : static void search_file(struct snapraid_state* state, const char* path, data_off_t size, int64_t mtime_sec, int mtime_nsec)
+ 26 1843728 : static void search_file(struct snapraid_state* state, const char* path, data_off_t size, int64_t mtime_sec, int mtime_nsec)
27 : {
28 : struct snapraid_search_file* file;
29 : tommy_uint32_t file_hash;
30 :
- 31 1844175 : file = malloc_nofail(sizeof(struct snapraid_search_file));
- 32 1844175 : file->path = strdup_nofail(path);
- 33 1844175 : file->size = size;
- 34 1844175 : file->mtime_sec = mtime_sec;
- 35 1844175 : file->mtime_nsec = mtime_nsec;
+ 31 1843728 : file = malloc_nofail(sizeof(struct snapraid_search_file));
+ 32 1843728 : file->path = strdup_nofail(path);
+ 33 1843728 : file->size = size;
+ 34 1843728 : file->mtime_sec = mtime_sec;
+ 35 1843728 : file->mtime_nsec = mtime_nsec;
36 :
- 37 1844175 : file_hash = file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec);
+ 37 1843728 : file_hash = file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec);
38 :
- 39 1844175 : tommy_hashdyn_insert(&state->searchset, &file->node, file, file_hash);
- 40 1844175 : }
+ 39 1843728 : tommy_hashdyn_insert(&state->searchset, &file->node, file, file_hash);
+ 40 1843728 : }
41 :
- 42 1844175 : void search_file_free(struct snapraid_search_file* file)
+ 42 1843728 : void search_file_free(struct snapraid_search_file* file)
43 : {
- 44 1844175 : free(file->path);
- 45 1844175 : free(file);
- 46 1844175 : }
+ 44 1843728 : free(file->path);
+ 45 1843728 : free(file);
+ 46 1843728 : }
47 :
48 : struct search_file_compare_arg {
49 : const struct snapraid_state* state;
@@ -117,29 +117,29 @@
55 : int prevhash;
56 : };
57 :
- 58 20091 : int search_file_compare(const void* void_arg, const void* void_data)
+ 58 20130 : int search_file_compare(const void* void_arg, const void* void_data)
59 : {
- 60 20091 : const struct search_file_compare_arg* arg = void_arg;
- 61 20091 : const struct snapraid_search_file* file = void_data;
- 62 20091 : const struct snapraid_state* state = arg->state;
+ 60 20130 : const struct search_file_compare_arg* arg = void_arg;
+ 61 20130 : const struct snapraid_search_file* file = void_data;
+ 62 20130 : const struct snapraid_state* state = arg->state;
63 : unsigned char buffer_hash[HASH_MAX];
- 64 20091 : const char* path = file->path;
+ 64 20130 : const char* path = file->path;
65 : int f;
66 : ssize_t ret;
67 :
68 : /* compare file info */
- 69 20091 : if (arg->file->size != file->size)
+ 69 20130 : if (arg->file->size != file->size)
70 0 : return -1;
71 :
- 72 20091 : if (arg->file->mtime_sec != file->mtime_sec)
+ 72 20130 : if (arg->file->mtime_sec != file->mtime_sec)
73 0 : return -1;
74 :
- 75 20091 : if (arg->file->mtime_nsec != file->mtime_nsec)
+ 75 20130 : if (arg->file->mtime_nsec != file->mtime_nsec)
76 0 : return -1;
77 :
78 : /* read the block and compare the hash */
- 79 20091 : f = open(path, O_RDONLY | O_BINARY);
- 80 20091 : if (f == -1) {
+ 79 20130 : f = open(path, O_RDONLY | O_BINARY);
+ 80 20130 : if (f == -1) {
81 : /* LCOV_EXCL_START */
82 : if (errno == ENOENT) {
83 : log_fatal("DANGER! file '%s' disappeared.\n", path);
@@ -151,16 +151,16 @@
89 : /* LCOV_EXCL_STOP */
90 : }
91 :
- 92 20091 : ret = pread(f, arg->buffer, arg->read_size, arg->offset);
- 93 20091 : if (ret < 0 || (unsigned)ret != arg->read_size) {
+ 92 20130 : ret = pread(f, arg->buffer, arg->read_size, arg->offset);
+ 93 20130 : if (ret < 0 || (unsigned)ret != arg->read_size) {
94 : /* LCOV_EXCL_START */
95 : log_fatal("Error reading file '%s'. %s.\n", path, strerror(errno));
96 : exit(EXIT_FAILURE);
97 : /* LCOV_EXCL_STOP */
98 : }
99 :
- 100 20091 : ret = close(f);
- 101 20091 : if (ret != 0) {
+ 100 20130 : ret = close(f);
+ 101 20130 : if (ret != 0) {
102 : /* LCOV_EXCL_START */
103 : log_fatal("Error closing file '%s'. %s.\n", path, strerror(errno));
104 : exit(EXIT_FAILURE);
@@ -168,14 +168,14 @@
106 : }
107 :
108 : /* compute the hash */
- 109 20091 : if (arg->prevhash)
+ 109 20130 : if (arg->prevhash)
110 0 : memhash(state->prevhash, state->prevhashseed, buffer_hash, arg->buffer, arg->read_size);
111 : else
- 112 20091 : memhash(state->hash, state->hashseed, buffer_hash, arg->buffer, arg->read_size);
+ 112 20130 : memhash(state->hash, state->hashseed, buffer_hash, arg->buffer, arg->read_size);
113 :
114 : /* check if the hash is matching */
- 115 20091 : if (memcmp(buffer_hash, arg->block->hash, BLOCK_HASH_SIZE) != 0)
- 116 2181 : return -1;
+ 115 20130 : if (memcmp(buffer_hash, arg->block->hash, BLOCK_HASH_SIZE) != 0)
+ 116 2220 : return -1;
117 :
118 17910 : if (arg->read_size != state->block_size) {
119 : /* fill the remaining with 0 */
@@ -185,26 +185,26 @@
123 17910 : return 0;
124 : }
125 :
- 126 638351 : int state_search_fetch(struct snapraid_state* state, int prevhash, struct snapraid_file* missing_file, block_off_t missing_file_pos, struct snapraid_block* missing_block, unsigned char* buffer)
+ 126 639176 : int state_search_fetch(struct snapraid_state* state, int prevhash, struct snapraid_file* missing_file, block_off_t missing_file_pos, struct snapraid_block* missing_block, unsigned char* buffer)
127 : {
128 : struct snapraid_search_file* file;
129 : tommy_uint32_t file_hash;
130 : struct search_file_compare_arg arg;
131 :
- 132 638351 : arg.state = state;
- 133 638351 : arg.block = missing_block;
- 134 638351 : arg.file = missing_file;
- 135 638351 : arg.buffer = buffer;
- 136 638351 : arg.offset = state->block_size * (data_off_t)missing_file_pos;
- 137 638351 : arg.read_size = file_block_size(missing_file, missing_file_pos, state->block_size);
- 138 638351 : arg.prevhash = prevhash;
+ 132 639176 : arg.state = state;
+ 133 639176 : arg.block = missing_block;
+ 134 639176 : arg.file = missing_file;
+ 135 639176 : arg.buffer = buffer;
+ 136 639176 : arg.offset = state->block_size * (data_off_t)missing_file_pos;
+ 137 639176 : arg.read_size = file_block_size(missing_file, missing_file_pos, state->block_size);
+ 138 639176 : arg.prevhash = prevhash;
139 :
- 140 638351 : file_hash = file_stamp_hash(arg.file->size, arg.file->mtime_sec, arg.file->mtime_nsec);
+ 140 639176 : file_hash = file_stamp_hash(arg.file->size, arg.file->mtime_sec, arg.file->mtime_nsec);
141 :
142 : /* search in the hashtable, and also check if the data matches the hash */
- 143 638351 : file = tommy_hashdyn_search(&state->searchset, search_file_compare, &arg, file_hash);
- 144 638351 : if (!file)
- 145 620441 : return -1;
+ 143 639176 : file = tommy_hashdyn_search(&state->searchset, search_file_compare, &arg, file_hash);
+ 144 639176 : if (!file)
+ 145 621266 : return -1;
146 :
147 : /* if found, buffer is already set with data */
148 17910 : return 0;
@@ -226,40 +226,40 @@
164 : char path_next[PATH_MAX];
165 : char sub_next[PATH_MAX];
166 : char out[PATH_MAX];
- 167 2040434 : struct snapraid_filter* reason = 0;
+ 167 2040132 : struct snapraid_filter* reason = 0;
168 : struct stat st;
169 : const char* name;
170 : struct dirent* dd;
171 :
172 : /* clear errno to detect erroneous conditions */
- 173 2040434 : errno = 0;
- 174 2040434 : dd = readdir(d);
- 175 2040434 : if (dd == 0 && errno != 0) {
+ 173 2040132 : errno = 0;
+ 174 2040132 : dd = readdir(d);
+ 175 2040132 : if (dd == 0 && errno != 0) {
176 : /* LCOV_EXCL_START */
177 : log_fatal("Error reading directory '%s'. %s.\n", dir, strerror(errno));
178 : exit(EXIT_FAILURE);
179 : /* LCOV_EXCL_STOP */
180 : }
- 181 2040434 : if (dd == 0) {
+ 181 2040132 : if (dd == 0) {
182 2462 : break; /* finished */
183 : }
184 :
185 : /* skip "." and ".." files */
- 186 2037972 : name = dd->d_name;
- 187 2037972 : if (name[0] == '.' && (name[1] == 0 || (name[1] == '.' && name[2] == 0)))
+ 186 2037670 : name = dd->d_name;
+ 187 2037670 : if (name[0] == '.' && (name[1] == 0 || (name[1] == '.' && name[2] == 0)))
188 9848 : continue;
189 :
- 190 2033048 : pathprint(path_next, sizeof(path_next), "%s%s", dir, name);
- 191 2033048 : pathprint(sub_next, sizeof(sub_next), "%s%s", sub, name);
+ 190 2032746 : pathprint(path_next, sizeof(path_next), "%s%s", dir, name);
+ 191 2032746 : pathprint(sub_next, sizeof(sub_next), "%s%s", sub, name);
192 :
193 : /* exclude hidden files even before calling lstat() */
- 194 2033048 : if (disk != 0 && filter_hidden(state->filter_hidden, dd) != 0) {
+ 194 2032746 : if (disk != 0 && filter_hidden(state->filter_hidden, dd) != 0) {
195 0 : msg_verbose("Excluding hidden '%s'\n", path_next);
196 0 : continue;
197 : }
198 :
199 : /* exclude content files even before calling lstat() */
- 200 2033048 : if (disk != 0 && filter_content(&state->contentlist, path_next) != 0) {
+ 200 2032746 : if (disk != 0 && filter_content(&state->contentlist, path_next) != 0) {
201 0 : msg_verbose("Excluding content '%s'\n", path_next);
202 0 : continue;
203 : }
@@ -283,7 +283,7 @@
221 : }
222 : #else
223 : /* get lstat info about the file */
- 224 2033048 : if (lstat(path_next, &st) != 0) {
+ 224 2032746 : if (lstat(path_next, &st) != 0) {
225 : /* LCOV_EXCL_START */
226 : log_fatal("Error in stat file/directory '%s'. %s.\n", path_next, strerror(errno));
227 : exit(EXIT_FAILURE);
@@ -291,13 +291,13 @@
229 : }
230 : #endif
231 :
- 232 2033048 : if (S_ISREG(st.st_mode)) {
- 233 1968786 : if (disk == 0 || filter_path(&state->filterlist, &reason, disk->name, sub_next) == 0) {
- 234 1844175 : search_file(state, path_next, st.st_size, st.st_mtime, STAT_NSEC(&st));
+ 232 2032746 : if (S_ISREG(st.st_mode)) {
+ 233 1968447 : if (disk == 0 || filter_path(&state->filterlist, &reason, disk->name, sub_next) == 0) {
+ 234 1843728 : search_file(state, path_next, st.st_size, st.st_mtime, STAT_NSEC(&st));
235 : } else {
- 236 124611 : msg_verbose("Excluding link '%s' for rule '%s'\n", path_next, filter_type(reason, out, sizeof(out)));
+ 236 124719 : msg_verbose("Excluding link '%s' for rule '%s'\n", path_next, filter_type(reason, out, sizeof(out)));
237 : }
- 238 64262 : } else if (S_ISDIR(st.st_mode)) {
+ 238 64299 : } else if (S_ISDIR(st.st_mode)) {
239 1781 : if (disk == 0 || filter_subdir(&state->filterlist, &reason, disk->name, sub_next) == 0) {
240 1781 : pathslash(path_next, sizeof(path_next));
241 1781 : pathslash(sub_next, sizeof(sub_next));
@@ -306,7 +306,7 @@
244 0 : msg_verbose("Excluding directory '%s' for rule '%s'\n", path_next, filter_type(reason, out, sizeof(out)));
245 : }
246 : }
- 247 2037972 : }
+ 247 2037670 : }
248 :
249 2462 : if (closedir(d) != 0) {
250 : /* LCOV_EXCL_START */
diff --git a/cov/cmdline/selftest.c.func-sort-c.html b/cov/cmdline/selftest.c.func-sort-c.html
index eabfc590..6e8c3643 100644
--- a/cov/cmdline/selftest.c.func-sort-c.html
+++ b/cov/cmdline/selftest.c.func-sort-c.html
@@ -31,8 +31,8 @@
|
-
-
+
+
@@ -88,7 +88,7 @@
| 1 |
- | selftest |
+ selftest |
1 |
diff --git a/cov/cmdline/selftest.c.func.html b/cov/cmdline/selftest.c.func.html
index fcc21251..513633b8 100644
--- a/cov/cmdline/selftest.c.func.html
+++ b/cov/cmdline/selftest.c.func.html
@@ -31,8 +31,8 @@
|
-
-
+
+
@@ -60,7 +60,7 @@
Hit count  |
- | selftest |
+ selftest |
1 |
diff --git a/cov/cmdline/selftest.c.gcov.html b/cov/cmdline/selftest.c.gcov.html
index 4e978460..8a3bd625 100644
--- a/cov/cmdline/selftest.c.gcov.html
+++ b/cov/cmdline/selftest.c.gcov.html
@@ -31,8 +31,8 @@
|
-
-
+
+
@@ -468,227 +468,235 @@
406 : /* LCOV_EXCL_STOP */
407 : }
408 :
- 409 1 : tommy_hashdyn_init(&hashdyn);
+ 409 1 : tommy_list_insert_tail(&list, &node[0], &node[0]);
410 :
- 411 257 : for (i = 0; i < TOMMY_SIZE; ++i)
- 412 256 : tommy_hashdyn_insert(&hashdyn, &node[i], &node[i], i % 64);
- 413 :
- 414 1 : if (tommy_hashdyn_count(&hashdyn) != TOMMY_SIZE) {
- 415 : /* LCOV_EXCL_START */
- 416 : goto bail;
- 417 : /* LCOV_EXCL_STOP */
- 418 : }
- 419 :
- 420 1 : if (tommy_hashdyn_memory_usage(&hashdyn) < TOMMY_SIZE * sizeof(tommy_node)) {
- 421 : /* LCOV_EXCL_START */
- 422 : goto bail;
- 423 : /* LCOV_EXCL_STOP */
- 424 : }
- 425 :
- 426 1 : tommy_test_foreach_count = 0;
- 427 1 : tommy_hashdyn_foreach(&hashdyn, tommy_test_foreach);
- 428 1 : if (tommy_test_foreach_count != TOMMY_SIZE) {
+ 411 1 : if (tommy_list_tail(&list) != tommy_list_head(&list)) {
+ 412 : /* LCOV_EXCL_START */
+ 413 : goto bail;
+ 414 : /* LCOV_EXCL_STOP */
+ 415 : }
+ 416 :
+ 417 1 : tommy_hashdyn_init(&hashdyn);
+ 418 :
+ 419 257 : for (i = 0; i < TOMMY_SIZE; ++i)
+ 420 256 : tommy_hashdyn_insert(&hashdyn, &node[i], &node[i], i % 64);
+ 421 :
+ 422 1 : if (tommy_hashdyn_count(&hashdyn) != TOMMY_SIZE) {
+ 423 : /* LCOV_EXCL_START */
+ 424 : goto bail;
+ 425 : /* LCOV_EXCL_STOP */
+ 426 : }
+ 427 :
+ 428 1 : if (tommy_hashdyn_memory_usage(&hashdyn) < TOMMY_SIZE * sizeof(tommy_node)) {
429 : /* LCOV_EXCL_START */
430 : goto bail;
431 : /* LCOV_EXCL_STOP */
432 : }
433 :
434 1 : tommy_test_foreach_count = 0;
- 435 1 : tommy_hashdyn_foreach_arg(&hashdyn, tommy_test_foreach_arg, &tommy_test_foreach_count);
+ 435 1 : tommy_hashdyn_foreach(&hashdyn, tommy_test_foreach);
436 1 : if (tommy_test_foreach_count != TOMMY_SIZE) {
437 : /* LCOV_EXCL_START */
438 : goto bail;
439 : /* LCOV_EXCL_STOP */
440 : }
441 :
- 442 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i)
- 443 128 : tommy_hashdyn_remove_existing(&hashdyn, &node[i]);
- 444 :
- 445 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i) {
- 446 128 : if (tommy_hashdyn_remove(&hashdyn, tommy_test_search, &node[i], i % 64) != 0) {
- 447 : /* LCOV_EXCL_START */
- 448 : goto bail;
- 449 : /* LCOV_EXCL_STOP */
- 450 : }
- 451 : }
- 452 129 : for (i = TOMMY_SIZE / 2; i < TOMMY_SIZE; ++i) {
- 453 128 : if (tommy_hashdyn_remove(&hashdyn, tommy_test_search, &node[i], i % 64) == 0) {
- 454 : /* LCOV_EXCL_START */
- 455 : goto bail;
- 456 : /* LCOV_EXCL_STOP */
- 457 : }
- 458 : }
- 459 :
- 460 1 : if (tommy_hashdyn_count(&hashdyn) != 0) {
- 461 : /* LCOV_EXCL_START */
- 462 : goto bail;
- 463 : /* LCOV_EXCL_STOP */
- 464 : }
- 465 :
- 466 1 : tommy_hashdyn_done(&hashdyn);
+ 442 1 : tommy_test_foreach_count = 0;
+ 443 1 : tommy_hashdyn_foreach_arg(&hashdyn, tommy_test_foreach_arg, &tommy_test_foreach_count);
+ 444 1 : if (tommy_test_foreach_count != TOMMY_SIZE) {
+ 445 : /* LCOV_EXCL_START */
+ 446 : goto bail;
+ 447 : /* LCOV_EXCL_STOP */
+ 448 : }
+ 449 :
+ 450 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i)
+ 451 128 : tommy_hashdyn_remove_existing(&hashdyn, &node[i]);
+ 452 :
+ 453 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i) {
+ 454 128 : if (tommy_hashdyn_remove(&hashdyn, tommy_test_search, &node[i], i % 64) != 0) {
+ 455 : /* LCOV_EXCL_START */
+ 456 : goto bail;
+ 457 : /* LCOV_EXCL_STOP */
+ 458 : }
+ 459 : }
+ 460 129 : for (i = TOMMY_SIZE / 2; i < TOMMY_SIZE; ++i) {
+ 461 128 : if (tommy_hashdyn_remove(&hashdyn, tommy_test_search, &node[i], i % 64) == 0) {
+ 462 : /* LCOV_EXCL_START */
+ 463 : goto bail;
+ 464 : /* LCOV_EXCL_STOP */
+ 465 : }
+ 466 : }
467 :
- 468 1 : tommy_tree_init(&tree, tommy_test_compare);
- 469 :
- 470 257 : for (i = 0; i < TOMMY_SIZE; ++i)
- 471 256 : tommy_tree_insert(&tree, &node[i], (void*)(uintptr_t)(i + 1));
- 472 :
- 473 : /* try to insert a duplicate, count should not change */
- 474 1 : tommy_tree_insert(&tree, &node[TOMMY_SIZE], (void*)(uintptr_t)1);
+ 468 1 : if (tommy_hashdyn_count(&hashdyn) != 0) {
+ 469 : /* LCOV_EXCL_START */
+ 470 : goto bail;
+ 471 : /* LCOV_EXCL_STOP */
+ 472 : }
+ 473 :
+ 474 1 : tommy_hashdyn_done(&hashdyn);
475 :
- 476 1 : if (tommy_tree_count(&tree) != TOMMY_SIZE) {
- 477 : /* LCOV_EXCL_START */
- 478 : goto bail;
- 479 : /* LCOV_EXCL_STOP */
- 480 : }
- 481 1 : if (tommy_tree_memory_usage(&tree) < TOMMY_SIZE * sizeof(tommy_node)) {
- 482 : /* LCOV_EXCL_START */
- 483 : goto bail;
- 484 : /* LCOV_EXCL_STOP */
- 485 : }
- 486 1 : if (tommy_tree_search(&tree, (void*)1) != (void*)1) {
- 487 : /* LCOV_EXCL_START */
- 488 : goto bail;
- 489 : /* LCOV_EXCL_STOP */
- 490 : }
- 491 1 : if (tommy_tree_search(&tree, (void*)-1) != 0) {
- 492 : /* LCOV_EXCL_START */
- 493 : goto bail;
- 494 : /* LCOV_EXCL_STOP */
- 495 : }
- 496 1 : if (tommy_tree_search_compare(&tree, tommy_test_compare, (void*)1) != (void*)1) {
- 497 : /* LCOV_EXCL_START */
- 498 : goto bail;
- 499 : /* LCOV_EXCL_STOP */
- 500 : }
- 501 1 : if (tommy_tree_search_compare(&tree, tommy_test_compare, (void*)-1) != 0) {
- 502 : /* LCOV_EXCL_START */
- 503 : goto bail;
- 504 : /* LCOV_EXCL_STOP */
- 505 : }
- 506 :
- 507 1 : tommy_test_foreach_count = 0;
- 508 1 : tommy_tree_foreach(&tree, tommy_test_foreach);
- 509 1 : if (tommy_test_foreach_count != TOMMY_SIZE) {
+ 476 1 : tommy_tree_init(&tree, tommy_test_compare);
+ 477 :
+ 478 257 : for (i = 0; i < TOMMY_SIZE; ++i)
+ 479 256 : tommy_tree_insert(&tree, &node[i], (void*)(uintptr_t)(i + 1));
+ 480 :
+ 481 : /* try to insert a duplicate, count should not change */
+ 482 1 : tommy_tree_insert(&tree, &node[TOMMY_SIZE], (void*)(uintptr_t)1);
+ 483 :
+ 484 1 : if (tommy_tree_count(&tree) != TOMMY_SIZE) {
+ 485 : /* LCOV_EXCL_START */
+ 486 : goto bail;
+ 487 : /* LCOV_EXCL_STOP */
+ 488 : }
+ 489 1 : if (tommy_tree_memory_usage(&tree) < TOMMY_SIZE * sizeof(tommy_node)) {
+ 490 : /* LCOV_EXCL_START */
+ 491 : goto bail;
+ 492 : /* LCOV_EXCL_STOP */
+ 493 : }
+ 494 1 : if (tommy_tree_search(&tree, (void*)1) != (void*)1) {
+ 495 : /* LCOV_EXCL_START */
+ 496 : goto bail;
+ 497 : /* LCOV_EXCL_STOP */
+ 498 : }
+ 499 1 : if (tommy_tree_search(&tree, (void*)-1) != 0) {
+ 500 : /* LCOV_EXCL_START */
+ 501 : goto bail;
+ 502 : /* LCOV_EXCL_STOP */
+ 503 : }
+ 504 1 : if (tommy_tree_search_compare(&tree, tommy_test_compare, (void*)1) != (void*)1) {
+ 505 : /* LCOV_EXCL_START */
+ 506 : goto bail;
+ 507 : /* LCOV_EXCL_STOP */
+ 508 : }
+ 509 1 : if (tommy_tree_search_compare(&tree, tommy_test_compare, (void*)-1) != 0) {
510 : /* LCOV_EXCL_START */
511 : goto bail;
512 : /* LCOV_EXCL_STOP */
513 : }
514 :
515 1 : tommy_test_foreach_count = 0;
- 516 1 : tommy_tree_foreach_arg(&tree, tommy_test_foreach_arg, &tommy_test_foreach_count);
+ 516 1 : tommy_tree_foreach(&tree, tommy_test_foreach);
517 1 : if (tommy_test_foreach_count != TOMMY_SIZE) {
518 : /* LCOV_EXCL_START */
519 : goto bail;
520 : /* LCOV_EXCL_STOP */
521 : }
522 :
- 523 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i)
- 524 128 : tommy_tree_remove_existing(&tree, &node[i]);
- 525 :
- 526 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i) {
- 527 128 : if (tommy_tree_remove(&tree, (void*)(uintptr_t)(i + 1)) != 0) {
- 528 : /* LCOV_EXCL_START */
- 529 : goto bail;
- 530 : /* LCOV_EXCL_STOP */
- 531 : }
- 532 : }
+ 523 1 : tommy_test_foreach_count = 0;
+ 524 1 : tommy_tree_foreach_arg(&tree, tommy_test_foreach_arg, &tommy_test_foreach_count);
+ 525 1 : if (tommy_test_foreach_count != TOMMY_SIZE) {
+ 526 : /* LCOV_EXCL_START */
+ 527 : goto bail;
+ 528 : /* LCOV_EXCL_STOP */
+ 529 : }
+ 530 :
+ 531 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i)
+ 532 128 : tommy_tree_remove_existing(&tree, &node[i]);
533 :
- 534 129 : for (i = TOMMY_SIZE / 2; i < TOMMY_SIZE; ++i) {
- 535 128 : if (tommy_tree_remove(&tree, (void*)(uintptr_t)(i + 1)) == 0) {
+ 534 129 : for (i = 0; i < TOMMY_SIZE / 2; ++i) {
+ 535 128 : if (tommy_tree_remove(&tree, (void*)(uintptr_t)(i + 1)) != 0) {
536 : /* LCOV_EXCL_START */
537 : goto bail;
538 : /* LCOV_EXCL_STOP */
539 : }
540 : }
541 :
- 542 1 : if (tommy_tree_count(&tree) != 0) {
- 543 : /* LCOV_EXCL_START */
- 544 : goto bail;
- 545 : /* LCOV_EXCL_STOP */
- 546 : }
- 547 :
- 548 2 : return;
- 549 : bail:
- 550 : /* LCOV_EXCL_START */
- 551 : log_fatal("Failed tommy test\n");
- 552 : exit(EXIT_FAILURE);
- 553 : /* LCOV_EXCL_STOP */
- 554 : }
+ 542 129 : for (i = TOMMY_SIZE / 2; i < TOMMY_SIZE; ++i) {
+ 543 128 : if (tommy_tree_remove(&tree, (void*)(uintptr_t)(i + 1)) == 0) {
+ 544 : /* LCOV_EXCL_START */
+ 545 : goto bail;
+ 546 : /* LCOV_EXCL_STOP */
+ 547 : }
+ 548 : }
+ 549 :
+ 550 1 : if (tommy_tree_count(&tree) != 0) {
+ 551 : /* LCOV_EXCL_START */
+ 552 : goto bail;
+ 553 : /* LCOV_EXCL_STOP */
+ 554 : }
555 :
- 556 1 : void selftest(void)
- 557 : {
- 558 1 : log_tag("selftest:\n");
- 559 1 : log_flush();
- 560 :
- 561 1 : msg_progress("Self test...\n");
- 562 :
- 563 : /* large file check */
- 564 : if (sizeof(off_t) < sizeof(uint64_t)) {
- 565 : /* LCOV_EXCL_START */
- 566 : log_fatal("Missing support for large files\n");
- 567 : exit(EXIT_FAILURE);
- 568 : /* LCOV_EXCL_STOP */
- 569 : }
+ 556 2 : return;
+ 557 : bail:
+ 558 : /* LCOV_EXCL_START */
+ 559 : log_fatal("Failed tommy test\n");
+ 560 : exit(EXIT_FAILURE);
+ 561 : /* LCOV_EXCL_STOP */
+ 562 : }
+ 563 :
+ 564 1 : void selftest(void)
+ 565 : {
+ 566 1 : log_tag("selftest:\n");
+ 567 1 : log_flush();
+ 568 :
+ 569 1 : msg_progress("Self test...\n");
570 :
- 571 1 : test_hash();
- 572 1 : test_crc32c();
- 573 1 : test_tommy();
- 574 1 : if (raid_selftest() != 0) {
- 575 : /* LCOV_EXCL_START */
- 576 : log_fatal("Failed SELF test\n");
- 577 : exit(EXIT_FAILURE);
- 578 : /* LCOV_EXCL_STOP */
- 579 : }
- 580 1 : if (raid_test_sort() != 0) {
- 581 : /* LCOV_EXCL_START */
- 582 : log_fatal("Failed SORT test\n");
- 583 : exit(EXIT_FAILURE);
- 584 : /* LCOV_EXCL_STOP */
- 585 : }
- 586 1 : if (raid_test_insert() != 0) {
- 587 : /* LCOV_EXCL_START */
- 588 : log_fatal("Failed INSERT test\n");
- 589 : exit(EXIT_FAILURE);
- 590 : /* LCOV_EXCL_STOP */
- 591 : }
- 592 1 : if (raid_test_combo() != 0) {
- 593 : /* LCOV_EXCL_START */
- 594 : log_fatal("Failed COMBO test\n");
- 595 : exit(EXIT_FAILURE);
- 596 : /* LCOV_EXCL_STOP */
- 597 : }
- 598 1 : if (raid_test_par(RAID_MODE_VANDERMONDE, 32, 256) != 0) {
- 599 : /* LCOV_EXCL_START */
- 600 : log_fatal("Failed GEN Vandermonde test\n");
- 601 : exit(EXIT_FAILURE);
- 602 : /* LCOV_EXCL_STOP */
- 603 : }
- 604 1 : if (raid_test_rec(RAID_MODE_VANDERMONDE, 12, 256) != 0) {
- 605 : /* LCOV_EXCL_START */
- 606 : log_fatal("Failed REC Vandermonde test\n");
- 607 : exit(EXIT_FAILURE);
- 608 : /* LCOV_EXCL_STOP */
- 609 : }
- 610 1 : if (raid_test_par(RAID_MODE_CAUCHY, 32, 256) != 0) {
- 611 : /* LCOV_EXCL_START */
- 612 : log_fatal("Failed GEN Cauchy test\n");
- 613 : exit(EXIT_FAILURE);
- 614 : /* LCOV_EXCL_STOP */
- 615 : }
- 616 1 : if (raid_test_rec(RAID_MODE_CAUCHY, 12, 256) != 0) {
- 617 : /* LCOV_EXCL_START */
- 618 : log_fatal("Failed REC Cauchy test\n");
- 619 : exit(EXIT_FAILURE);
- 620 : /* LCOV_EXCL_STOP */
- 621 : }
- 622 1 : if (raid_test_par(RAID_MODE_CAUCHY, 1, 256) != 0) {
- 623 : /* LCOV_EXCL_START */
- 624 : log_fatal("Failed GEN Cauchy test sigle data disk\n");
- 625 : exit(EXIT_FAILURE);
- 626 : /* LCOV_EXCL_STOP */
- 627 : }
- 628 1 : }
- 629 :
+ 571 : /* large file check */
+ 572 : if (sizeof(off_t) < sizeof(uint64_t)) {
+ 573 : /* LCOV_EXCL_START */
+ 574 : log_fatal("Missing support for large files\n");
+ 575 : exit(EXIT_FAILURE);
+ 576 : /* LCOV_EXCL_STOP */
+ 577 : }
+ 578 :
+ 579 1 : test_hash();
+ 580 1 : test_crc32c();
+ 581 1 : test_tommy();
+ 582 1 : if (raid_selftest() != 0) {
+ 583 : /* LCOV_EXCL_START */
+ 584 : log_fatal("Failed SELF test\n");
+ 585 : exit(EXIT_FAILURE);
+ 586 : /* LCOV_EXCL_STOP */
+ 587 : }
+ 588 1 : if (raid_test_sort() != 0) {
+ 589 : /* LCOV_EXCL_START */
+ 590 : log_fatal("Failed SORT test\n");
+ 591 : exit(EXIT_FAILURE);
+ 592 : /* LCOV_EXCL_STOP */
+ 593 : }
+ 594 1 : if (raid_test_insert() != 0) {
+ 595 : /* LCOV_EXCL_START */
+ 596 : log_fatal("Failed INSERT test\n");
+ 597 : exit(EXIT_FAILURE);
+ 598 : /* LCOV_EXCL_STOP */
+ 599 : }
+ 600 1 : if (raid_test_combo() != 0) {
+ 601 : /* LCOV_EXCL_START */
+ 602 : log_fatal("Failed COMBO test\n");
+ 603 : exit(EXIT_FAILURE);
+ 604 : /* LCOV_EXCL_STOP */
+ 605 : }
+ 606 1 : if (raid_test_par(RAID_MODE_VANDERMONDE, 32, 256) != 0) {
+ 607 : /* LCOV_EXCL_START */
+ 608 : log_fatal("Failed GEN Vandermonde test\n");
+ 609 : exit(EXIT_FAILURE);
+ 610 : /* LCOV_EXCL_STOP */
+ 611 : }
+ 612 1 : if (raid_test_rec(RAID_MODE_VANDERMONDE, 12, 256) != 0) {
+ 613 : /* LCOV_EXCL_START */
+ 614 : log_fatal("Failed REC Vandermonde test\n");
+ 615 : exit(EXIT_FAILURE);
+ 616 : /* LCOV_EXCL_STOP */
+ 617 : }
+ 618 1 : if (raid_test_par(RAID_MODE_CAUCHY, 32, 256) != 0) {
+ 619 : /* LCOV_EXCL_START */
+ 620 : log_fatal("Failed GEN Cauchy test\n");
+ 621 : exit(EXIT_FAILURE);
+ 622 : /* LCOV_EXCL_STOP */
+ 623 : }
+ 624 1 : if (raid_test_rec(RAID_MODE_CAUCHY, 12, 256) != 0) {
+ 625 : /* LCOV_EXCL_START */
+ 626 : log_fatal("Failed REC Cauchy test\n");
+ 627 : exit(EXIT_FAILURE);
+ 628 : /* LCOV_EXCL_STOP */
+ 629 : }
+ 630 1 : if (raid_test_par(RAID_MODE_CAUCHY, 1, 256) != 0) {
+ 631 : /* LCOV_EXCL_START */
+ 632 : log_fatal("Failed GEN Cauchy test sigle data disk\n");
+ 633 : exit(EXIT_FAILURE);
+ 634 : /* LCOV_EXCL_STOP */
+ 635 : }
+ 636 1 : }
+ 637 :
diff --git a/cov/cmdline/snapraid.c.func-sort-c.html b/cov/cmdline/snapraid.c.func-sort-c.html
index 5501b13a..287d95e5 100644
--- a/cov/cmdline/snapraid.c.func-sort-c.html
+++ b/cov/cmdline/snapraid.c.func-sort-c.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -61,15 +61,15 @@
| test |
- 272 |
+ 275 |
| main |
- 272 |
+ 275 |
| config |
- 271 |
+ 274 |
| log_open |
diff --git a/cov/cmdline/snapraid.c.func.html b/cov/cmdline/snapraid.c.func.html
index ad0a2de4..66557d82 100644
--- a/cov/cmdline/snapraid.c.func.html
+++ b/cov/cmdline/snapraid.c.func.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -61,7 +61,7 @@
| config |
- 271 |
+ 274 |
| log_close |
@@ -73,7 +73,7 @@
| main |
- 272 |
+ 275 |
| memory |
@@ -85,7 +85,7 @@
| test |
- 272 |
+ 275 |
| usage |
diff --git a/cov/cmdline/snapraid.c.gcov.html b/cov/cmdline/snapraid.c.gcov.html
index 85889e6e..ea9d1eae 100644
--- a/cov/cmdline/snapraid.c.gcov.html
+++ b/cov/cmdline/snapraid.c.gcov.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -152,14 +152,14 @@
90 237 : msg_progress("Using %u MiB of memory for the FileSystem.\n", (unsigned)(malloc_counter_get() / MEBI));
91 237 : }
92 :
- 93 272 : void test(int argc, char* argv[])
+ 93 275 : void test(int argc, char* argv[])
94 : {
95 : int i;
96 : char buffer[ESC_MAX];
97 :
98 : /* special testing code for quoting */
- 99 272 : if (argc < 2 || strcmp(argv[1], "test") != 0)
- 100 542 : return;
+ 99 275 : if (argc < 2 || strcmp(argv[1], "test") != 0)
+ 100 548 : return;
101 :
102 1 : for (i = 2; i < argc; ++i) {
103 0 : printf("argv[%d]\n", i);
@@ -286,7 +286,7 @@
224 : /****************************************************************************/
225 : /* config */
226 :
- 227 271 : void config(char* conf, size_t conf_size, const char* argv0)
+ 227 274 : void config(char* conf, size_t conf_size, const char* argv0)
228 : {
229 : #ifdef _WIN32
230 : char* slash;
@@ -303,9 +303,9 @@
241 : #else
242 : (void)argv0;
243 :
- 244 271 : pathcpy(conf, conf_size, "/etc/" PACKAGE ".conf");
+ 244 274 : pathcpy(conf, conf_size, "/etc/" PACKAGE ".conf");
245 : #endif
- 246 271 : }
+ 246 274 : }
247 :
248 : /****************************************************************************/
249 : /* main */
@@ -580,7 +580,7 @@
518 : #define OPERATION_DEVICES 16
519 : #define OPERATION_SMART 17
520 :
- 521 272 : int main(int argc, char* argv[])
+ 521 275 : int main(int argc, char* argv[])
522 : {
523 : int c;
524 : struct snapraid_option opt;
@@ -610,40 +610,40 @@
548 : struct tm* tm;
549 : int i;
550 :
- 551 272 : test(argc, argv);
+ 551 275 : test(argc, argv);
552 :
- 553 271 : lock_init();
+ 553 274 : lock_init();
554 :
555 : /* defaults */
- 556 271 : config(conf, sizeof(conf), argv[0]);
- 557 271 : memset(&opt, 0, sizeof(opt));
- 558 271 : opt.io_error_limit = 100;
- 559 271 : blockstart = 0;
- 560 271 : blockcount = 0;
- 561 271 : tommy_list_init(&filterlist_file);
- 562 271 : tommy_list_init(&filterlist_disk);
- 563 271 : period = 1000;
- 564 271 : filter_missing = 0;
- 565 271 : filter_error = 0;
- 566 271 : plan = SCRUB_AUTO;
- 567 271 : olderthan = SCRUB_AUTO;
- 568 271 : import_timestamp = 0;
- 569 271 : import_content = 0;
- 570 271 : log_file = 0;
- 571 271 : lock = 0;
- 572 271 : gen_conf = 0;
- 573 271 : speedtest = 0;
- 574 271 : run = 0;
+ 556 274 : config(conf, sizeof(conf), argv[0]);
+ 557 274 : memset(&opt, 0, sizeof(opt));
+ 558 274 : opt.io_error_limit = 100;
+ 559 274 : blockstart = 0;
+ 560 274 : blockcount = 0;
+ 561 274 : tommy_list_init(&filterlist_file);
+ 562 274 : tommy_list_init(&filterlist_disk);
+ 563 274 : period = 1000;
+ 564 274 : filter_missing = 0;
+ 565 274 : filter_error = 0;
+ 566 274 : plan = SCRUB_AUTO;
+ 567 274 : olderthan = SCRUB_AUTO;
+ 568 274 : import_timestamp = 0;
+ 569 274 : import_content = 0;
+ 570 274 : log_file = 0;
+ 571 274 : lock = 0;
+ 572 274 : gen_conf = 0;
+ 573 274 : speedtest = 0;
+ 574 274 : run = 0;
575 :
- 576 271 : opterr = 0;
- 577 3437 : while ((c =
+ 576 274 : opterr = 0;
+ 577 3450 : while ((c =
578 : #if HAVE_GETOPT_LONG
579 : getopt_long(argc, argv, OPTIONS, long_options, 0))
580 : #else
581 : getopt(argc, argv, OPTIONS))
582 : #endif
583 : != EOF) {
- 584 2900 : switch (c) {
+ 584 2907 : switch (c) {
585 : case 'c' :
586 267 : pathimport(conf, sizeof(conf), optarg);
587 267 : break;
@@ -802,8 +802,8 @@
740 1 : version();
741 1 : exit(EXIT_SUCCESS);
742 : case 'T' :
- 743 1 : speedtest = 1;
- 744 1 : break;
+ 743 4 : speedtest = 1;
+ 744 4 : break;
745 : case 'C' :
746 1 : gen_conf = optarg;
747 1 : break;
@@ -826,9 +826,9 @@
764 1 : opt.skip_fallocate = 1;
765 1 : break;
766 : case OPT_TEST_SKIP_DEVICE :
- 767 271 : opt.skip_device = 1;
- 768 271 : period = 50; /* reduce period of the speed test */
- 769 271 : break;
+ 767 274 : opt.skip_device = 1;
+ 768 274 : period = 50; /* reduce period of the speed test */
+ 769 274 : break;
770 : case OPT_TEST_SKIP_CONTENT_CHECK :
771 0 : opt.skip_content_check = 1;
772 0 : break;
@@ -906,14 +906,14 @@
844 0 : opt.force_parity_update = 1;
845 0 : break;
846 : case OPT_TEST_IO_CACHE :
- 847 0 : opt.io_cache = atoi(optarg);
- 848 0 : if (opt.io_cache != 1 && (opt.io_cache < IO_MIN || opt.io_cache > IO_MAX)) {
+ 847 1 : opt.io_cache = atoi(optarg);
+ 848 1 : if (opt.io_cache != 1 && (opt.io_cache < IO_MIN || opt.io_cache > IO_MAX)) {
849 : /* LCOV_EXCL_START */
850 : log_fatal("The IO cache should be between %u and %u.\n", IO_MIN, IO_MAX);
851 : exit(EXIT_FAILURE);
852 : /* LCOV_EXCL_STOP */
853 : }
- 854 0 : break;
+ 854 1 : break;
855 : case OPT_TEST_IO_STATS :
856 0 : opt.force_stats = 1;
857 0 : break;
@@ -974,14 +974,14 @@
912 : }
913 : }
914 :
- 915 266 : os_init(opt.force_scan_winfind);
- 916 266 : raid_init();
- 917 266 : crc32c_init();
+ 915 269 : os_init(opt.force_scan_winfind);
+ 916 269 : raid_init();
+ 917 269 : crc32c_init();
918 :
- 919 266 : if (speedtest != 0) {
- 920 1 : speed(period);
- 921 1 : os_done();
- 922 1 : exit(EXIT_SUCCESS);
+ 919 269 : if (speedtest != 0) {
+ 920 4 : speed(period);
+ 921 4 : os_done();
+ 922 4 : exit(EXIT_SUCCESS);
923 : }
924 :
925 265 : if (gen_conf != 0) {
@@ -1286,8 +1286,8 @@
1224 264 : log_tag("time:%s\n", datetime);
1225 : }
1226 264 : log_tag("command:%s\n", command);
- 1227 4035 : for (i = 0; i < argc; ++i)
- 1228 3771 : log_tag("argv:%u:%s\n", i, argv[i]);
+ 1227 4037 : for (i = 0; i < argc; ++i)
+ 1228 3773 : log_tag("argv:%u:%s\n", i, argv[i]);
1229 264 : log_flush();
1230 :
1231 264 : if (!opt.skip_self)
diff --git a/cov/cmdline/speed.c.func-sort-c.html b/cov/cmdline/speed.c.func-sort-c.html
index f6fd4d25..cf9aeb8c 100644
--- a/cov/cmdline/speed.c.func-sort-c.html
+++ b/cov/cmdline/speed.c.func-sort-c.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -61,11 +61,11 @@
| diffgettimeofday |
- 1115 |
+ 1840 |
| speed |
- 1 |
+ 4 |
diff --git a/cov/cmdline/speed.c.func.html b/cov/cmdline/speed.c.func.html
index 31929631..5fd0a53c 100644
--- a/cov/cmdline/speed.c.func.html
+++ b/cov/cmdline/speed.c.func.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -61,11 +61,11 @@
| diffgettimeofday |
- 1115 |
+ 1840 |
| speed |
- 1 |
+ 4 |
diff --git a/cov/cmdline/speed.c.gcov.html b/cov/cmdline/speed.c.gcov.html
index 58443b15..53e5330e 100644
--- a/cov/cmdline/speed.c.gcov.html
+++ b/cov/cmdline/speed.c.gcov.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -100,14 +100,14 @@
38 : /**
39 : * Differential us of two timeval.
40 : */
- 41 1115 : static int64_t diffgettimeofday(struct timeval *start, struct timeval *stop)
+ 41 1840 : static int64_t diffgettimeofday(struct timeval *start, struct timeval *stop)
42 : {
43 : int64_t d;
44 :
- 45 1115 : d = 1000000LL * (stop->tv_sec - start->tv_sec);
- 46 1115 : d += stop->tv_usec - start->tv_usec;
+ 45 1840 : d = 1000000LL * (stop->tv_sec - start->tv_sec);
+ 46 1840 : d += stop->tv_usec - start->tv_usec;
47 :
- 48 1115 : return d;
+ 48 1840 : return d;
49 : }
50 :
51 : /**
@@ -137,7 +137,7 @@
75 : */
76 : static unsigned side_effect;
77 :
- 78 1 : void speed(int period)
+ 78 4 : void speed(int period)
79 : {
80 : struct timeval start;
81 : struct timeval stop;
@@ -149,39 +149,39 @@
87 : int id[RAID_PARITY_MAX];
88 : int ip[RAID_PARITY_MAX];
89 : int count;
- 90 1 : int delta = period >= 1000 ? 10 : 1;
- 91 1 : int size = TEST_SIZE;
- 92 1 : int nd = TEST_COUNT;
+ 90 4 : int delta = period >= 1000 ? 10 : 1;
+ 91 4 : int size = TEST_SIZE;
+ 92 4 : int nd = TEST_COUNT;
93 : int nv;
94 : void *v_alloc;
95 : void **v;
96 :
- 97 1 : nv = nd + RAID_PARITY_MAX + 1;
+ 97 4 : nv = nd + RAID_PARITY_MAX + 1;
98 :
- 99 1 : v = malloc_nofail_vector_align(nd, nv, size, &v_alloc);
+ 99 4 : v = malloc_nofail_vector_align(nd, nv, size, &v_alloc);
100 :
101 : /* initialize disks with fixed data */
- 102 9 : for (i = 0; i < nd; ++i)
- 103 8 : memset(v[i], i, size);
+ 102 36 : for (i = 0; i < nd; ++i)
+ 103 32 : memset(v[i], i, size);
104 :
105 : /* zero buffer */
- 106 1 : memset(v[nd + RAID_PARITY_MAX], 0, size);
- 107 1 : raid_zero(v[nd + RAID_PARITY_MAX]);
+ 106 4 : memset(v[nd + RAID_PARITY_MAX], 0, size);
+ 107 4 : raid_zero(v[nd + RAID_PARITY_MAX]);
108 :
109 : /* hash seed */
- 110 17 : for (i = 0; i < HASH_MAX; ++i)
- 111 16 : seed[i] = i;
+ 110 68 : for (i = 0; i < HASH_MAX; ++i)
+ 111 64 : seed[i] = i;
112 :
113 : /* basic disks and parity mapping */
- 114 7 : for (i = 0; i < RAID_PARITY_MAX; ++i) {
- 115 6 : id[i] = i;
- 116 6 : ip[i] = i;
+ 114 28 : for (i = 0; i < RAID_PARITY_MAX; ++i) {
+ 115 24 : id[i] = i;
+ 116 24 : ip[i] = i;
117 : }
118 :
- 119 1 : printf(PACKAGE " v" VERSION " by Andrea Mazzoleni, " PACKAGE_URL "\n");
+ 119 4 : printf(PACKAGE " v" VERSION " by Andrea Mazzoleni, " PACKAGE_URL "\n");
120 :
121 : #ifdef __GNUC__
- 122 1 : printf("Compiler gcc " __VERSION__ "\n");
+ 122 4 : printf("Compiler gcc " __VERSION__ "\n");
123 : #endif
124 :
125 : #ifdef CONFIG_X86
@@ -190,15 +190,15 @@
128 : unsigned family;
129 : unsigned model;
130 :
- 131 1 : raid_cpu_info(vendor, &family, &model);
+ 131 4 : raid_cpu_info(vendor, &family, &model);
132 :
- 133 6 : printf("CPU %s, family %u, model %u, flags%s%s%s%s%s%s\n", vendor, family, model,
- 134 1 : raid_cpu_has_sse2() ? " sse2" : "",
- 135 1 : raid_cpu_has_ssse3() ? " ssse3" : "",
- 136 1 : raid_cpu_has_crc32() ? " crc32" : "",
- 137 1 : raid_cpu_has_avx2() ? " avx2" : "",
- 138 1 : raid_cpu_has_slowmult() ? " slowmult" : "",
- 139 1 : raid_cpu_has_slowextendedreg() ? " slowext" : ""
+ 133 24 : printf("CPU %s, family %u, model %u, flags%s%s%s%s%s%s\n", vendor, family, model,
+ 134 4 : raid_cpu_has_sse2() ? " sse2" : "",
+ 135 4 : raid_cpu_has_ssse3() ? " ssse3" : "",
+ 136 4 : raid_cpu_has_crc32() ? " crc32" : "",
+ 137 4 : raid_cpu_has_avx2() ? " avx2" : "",
+ 138 4 : raid_cpu_has_slowmult() ? " slowmult" : "",
+ 139 4 : raid_cpu_has_slowextendedreg() ? " slowext" : ""
140 : );
141 : }
142 : #else
@@ -207,11 +207,11 @@
145 : #if WORDS_BIGENDIAN
146 : printf("Memory is big-endian %d-bit\n", (int)sizeof(void *) * 8);
147 : #else
- 148 1 : printf("Memory is little-endian %d-bit\n", (int)sizeof(void *) * 8);
+ 148 4 : printf("Memory is little-endian %d-bit\n", (int)sizeof(void *) * 8);
149 : #endif
150 :
151 : #if HAVE_FUTIMENS
- 152 1 : printf("Support nanosecond timestamps with futimens()\n");
+ 152 4 : printf("Support nanosecond timestamps with futimens()\n");
153 : #elif HAVE_FUTIMES
154 : printf("Support nanosecond timestamps with futimes()\n");
155 : #elif HAVE_FUTIMESAT
@@ -220,70 +220,70 @@
158 : printf("Does not support nanosecond timestamps\n");
159 : #endif
160 :
- 161 1 : printf("\n");
+ 161 4 : printf("\n");
162 :
- 163 1 : printf("Speed test using %u data buffers of %u bytes, for a total of %u KiB.\n", nd, size, nd * size / KIBI);
- 164 1 : printf("Memory blocks have a displacement of %u bytes to improve cache performance.\n", RAID_MALLOC_DISPLACEMENT);
- 165 1 : printf("The reported values are the aggregate bandwidth of all data blocks in MB/s,\n");
- 166 1 : printf("not counting parity blocks.\n");
- 167 1 : printf("\n");
+ 163 4 : printf("Speed test using %u data buffers of %u bytes, for a total of %u KiB.\n", nd, size, nd * size / KIBI);
+ 164 4 : printf("Memory blocks have a displacement of %u bytes to improve cache performance.\n", RAID_MALLOC_DISPLACEMENT);
+ 165 4 : printf("The reported values are the aggregate bandwidth of all data blocks in MB/s,\n");
+ 166 4 : printf("not counting parity blocks.\n");
+ 167 4 : printf("\n");
168 :
- 169 1 : printf("Memory write speed using the C memset() function:\n");
- 170 1 : printf("%8s", "memset");
- 171 1 : fflush(stdout);
+ 169 4 : printf("Memory write speed using the C memset() function:\n");
+ 170 4 : printf("%8s", "memset");
+ 171 4 : fflush(stdout);
172 :
- 173 588 : SPEED_START {
- 174 5283 : for (j = 0; j < nd; ++j)
- 175 4696 : memset(v[j], j, size);
- 176 587 : } SPEED_STOP
+ 173 380 : SPEED_START {
+ 174 3384 : for (j = 0; j < nd; ++j)
+ 175 3008 : memset(v[j], j, size);
+ 176 376 : } SPEED_STOP
177 :
- 178 1 : printf("%8" PRIu64, ds / dt);
- 179 1 : printf("\n");
- 180 1 : printf("\n");
+ 178 4 : printf("%8" PRIu64, ds / dt);
+ 179 4 : printf("\n");
+ 180 4 : printf("\n");
181 :
182 : /* crc table */
- 183 1 : printf("CRC used to check the content file integrity:\n");
+ 183 4 : printf("CRC used to check the content file integrity:\n");
184 :
- 185 1 : printf("%8s", "table");
- 186 1 : fflush(stdout);
+ 185 4 : printf("%8s", "table");
+ 186 4 : fflush(stdout);
187 :
- 188 12 : SPEED_START {
- 189 99 : for (j = 0; j < nd; ++j)
- 190 88 : side_effect += crc32c_gen(0, v[j], size);
- 191 11 : } SPEED_STOP
+ 188 47 : SPEED_START {
+ 189 387 : for (j = 0; j < nd; ++j)
+ 190 344 : side_effect += crc32c_gen(0, v[j], size);
+ 191 43 : } SPEED_STOP
192 :
- 193 1 : printf("%8" PRIu64, ds / dt);
- 194 1 : printf("\n");
+ 193 4 : printf("%8" PRIu64, ds / dt);
+ 194 4 : printf("\n");
195 :
- 196 1 : printf("%8s", "intel");
- 197 1 : fflush(stdout);
+ 196 4 : printf("%8s", "intel");
+ 197 4 : fflush(stdout);
198 :
199 : #if HAVE_SSE42
- 200 1 : if (raid_cpu_has_crc32()) {
- 201 32 : SPEED_START {
- 202 279 : for (j = 0; j < nd; ++j)
- 203 248 : side_effect += crc32c_x86(0, v[j], size);
- 204 31 : } SPEED_STOP
+ 200 4 : if (raid_cpu_has_crc32()) {
+ 201 60 : SPEED_START {
+ 202 522 : for (j = 0; j < nd; ++j)
+ 203 464 : side_effect += crc32c_x86(0, v[j], size);
+ 204 58 : } SPEED_STOP
205 :
- 206 1 : printf("%8" PRIu64, ds / dt);
+ 206 2 : printf("%8" PRIu64, ds / dt);
207 : }
208 : #endif
- 209 1 : printf("\n");
- 210 1 : printf("\n");
+ 209 4 : printf("\n");
+ 210 4 : printf("\n");
211 :
212 : /* hash table */
- 213 1 : printf("Hash used to check the data blocks integrity:\n");
+ 213 4 : printf("Hash used to check the data blocks integrity:\n");
214 :
- 215 1 : printf("%8s", "");
- 216 1 : printf("%8s", "best");
- 217 1 : printf("%8s", "murmur3");
- 218 1 : printf("%8s", "spooky2");
- 219 1 : printf("\n");
+ 215 4 : printf("%8s", "");
+ 216 4 : printf("%8s", "best");
+ 217 4 : printf("%8s", "murmur3");
+ 218 4 : printf("%8s", "spooky2");
+ 219 4 : printf("\n");
220 :
- 221 1 : printf("%8s", "hash");
+ 221 4 : printf("%8s", "hash");
222 : #ifdef CONFIG_X86
- 223 1 : if (sizeof(void *) == 4 && !raid_cpu_has_slowmult())
- 224 1 : printf("%8s", "murmur3");
+ 223 4 : if (sizeof(void *) == 4 && !raid_cpu_has_slowmult())
+ 224 4 : printf("%8s", "murmur3");
225 : else
226 0 : printf("%8s", "spooky2");
227 : #else
@@ -292,131 +292,131 @@
230 : else
231 : printf("%8s", "spooky2");
232 : #endif
- 233 1 : fflush(stdout);
+ 233 4 : fflush(stdout);
234 :
- 235 9 : SPEED_START {
- 236 72 : for (j = 0; j < nd; ++j)
- 237 64 : memhash(HASH_MURMUR3, seed, digest, v[j], size);
- 238 8 : } SPEED_STOP
+ 235 20 : SPEED_START {
+ 236 144 : for (j = 0; j < nd; ++j)
+ 237 128 : memhash(HASH_MURMUR3, seed, digest, v[j], size);
+ 238 16 : } SPEED_STOP
239 :
- 240 1 : printf("%8" PRIu64, ds / dt);
- 241 1 : fflush(stdout);
+ 240 4 : printf("%8" PRIu64, ds / dt);
+ 241 4 : fflush(stdout);
242 :
- 243 15 : SPEED_START {
- 244 126 : for (j = 0; j < nd; ++j)
- 245 112 : memhash(HASH_SPOOKY2, seed, digest, v[j], size);
- 246 14 : } SPEED_STOP
+ 243 36 : SPEED_START {
+ 244 288 : for (j = 0; j < nd; ++j)
+ 245 256 : memhash(HASH_SPOOKY2, seed, digest, v[j], size);
+ 246 32 : } SPEED_STOP
247 :
- 248 1 : printf("%8" PRIu64, ds / dt);
- 249 1 : printf("\n");
- 250 1 : printf("\n");
+ 248 4 : printf("%8" PRIu64, ds / dt);
+ 249 4 : printf("\n");
+ 250 4 : printf("\n");
251 :
252 : /* RAID table */
- 253 1 : printf("RAID functions used for computing the parity with 'sync':\n");
- 254 1 : printf("%8s", "");
- 255 1 : printf("%8s", "best");
- 256 1 : printf("%8s", "int8");
- 257 1 : printf("%8s", "int32");
- 258 1 : printf("%8s", "int64");
+ 253 4 : printf("RAID functions used for computing the parity with 'sync':\n");
+ 254 4 : printf("%8s", "");
+ 255 4 : printf("%8s", "best");
+ 256 4 : printf("%8s", "int8");
+ 257 4 : printf("%8s", "int32");
+ 258 4 : printf("%8s", "int64");
259 : #ifdef CONFIG_X86
- 260 1 : printf("%8s", "sse2");
+ 260 4 : printf("%8s", "sse2");
261 : #ifdef CONFIG_X86_64
262 : printf("%8s", "sse2e");
263 : #endif
- 264 1 : printf("%8s", "ssse3");
+ 264 4 : printf("%8s", "ssse3");
265 : #ifdef CONFIG_X86_64
266 : printf("%8s", "ssse3e");
267 : #endif
- 268 1 : printf("%8s", "avx2");
+ 268 4 : printf("%8s", "avx2");
269 : #ifdef CONFIG_X86_64
270 : printf("%8s", "avx2e");
271 : #endif
272 : #endif
- 273 1 : printf("\n");
+ 273 4 : printf("\n");
274 :
275 : /* GEN1 */
- 276 1 : printf("%8s", "gen1");
- 277 1 : printf("%8s", raid_gen1_tag());
- 278 1 : fflush(stdout);
+ 276 4 : printf("%8s", "gen1");
+ 277 4 : printf("%8s", raid_gen1_tag());
+ 278 4 : fflush(stdout);
279 :
- 280 1 : printf("%8s", "");
+ 280 4 : printf("%8s", "");
281 :
- 282 32 : SPEED_START {
- 283 31 : raid_gen1_int32(nd, size, v);
- 284 31 : } SPEED_STOP
+ 282 113 : SPEED_START {
+ 283 109 : raid_gen1_int32(nd, size, v);
+ 284 109 : } SPEED_STOP
285 :
- 286 1 : printf("%8" PRIu64, ds / dt);
- 287 1 : fflush(stdout);
+ 286 4 : printf("%8" PRIu64, ds / dt);
+ 287 4 : fflush(stdout);
288 :
- 289 52 : SPEED_START {
- 290 51 : raid_gen1_int64(nd, size, v);
- 291 51 : } SPEED_STOP
+ 289 185 : SPEED_START {
+ 290 181 : raid_gen1_int64(nd, size, v);
+ 291 181 : } SPEED_STOP
292 :
- 293 1 : printf("%8" PRIu64, ds / dt);
- 294 1 : fflush(stdout);
+ 293 4 : printf("%8" PRIu64, ds / dt);
+ 294 4 : fflush(stdout);
295 :
296 : #ifdef CONFIG_X86
297 : #ifdef CONFIG_SSE2
- 298 1 : if (raid_cpu_has_sse2()) {
- 299 131 : SPEED_START {
- 300 130 : raid_gen1_sse2(nd, size, v);
- 301 130 : } SPEED_STOP
+ 298 4 : if (raid_cpu_has_sse2()) {
+ 299 303 : SPEED_START {
+ 300 299 : raid_gen1_sse2(nd, size, v);
+ 301 299 : } SPEED_STOP
302 :
- 303 1 : printf("%8" PRIu64, ds / dt);
- 304 1 : fflush(stdout);
+ 303 4 : printf("%8" PRIu64, ds / dt);
+ 304 4 : fflush(stdout);
305 : }
306 : #endif
307 :
308 : #ifdef CONFIG_X86_64
309 : printf("%8s", "");
310 : #endif
- 311 1 : printf("%8s", "");
+ 311 4 : printf("%8s", "");
312 : #ifdef CONFIG_X86_64
313 : printf("%8s", "");
314 : #endif
315 : #ifdef CONFIG_AVX2
- 316 1 : if (raid_cpu_has_avx2()) {
- 317 0 : SPEED_START {
- 318 0 : raid_gen1_avx2(nd, size, v);
- 319 0 : } SPEED_STOP
+ 316 4 : if (raid_cpu_has_avx2()) {
+ 317 14 : SPEED_START {
+ 318 13 : raid_gen1_avx2(nd, size, v);
+ 319 13 : } SPEED_STOP
320 :
- 321 0 : printf("%8" PRIu64, ds / dt);
- 322 0 : fflush(stdout);
+ 321 1 : printf("%8" PRIu64, ds / dt);
+ 322 1 : fflush(stdout);
323 : }
324 : #endif
325 : #endif
- 326 1 : printf("\n");
+ 326 4 : printf("\n");
327 :
328 : /* GEN2 */
- 329 1 : printf("%8s", "gen2");
- 330 1 : printf("%8s", raid_gen2_tag());
- 331 1 : fflush(stdout);
+ 329 4 : printf("%8s", "gen2");
+ 330 4 : printf("%8s", raid_gen2_tag());
+ 331 4 : fflush(stdout);
332 :
- 333 1 : printf("%8s", "");
+ 333 4 : printf("%8s", "");
334 :
- 335 13 : SPEED_START {
- 336 12 : raid_gen2_int32(nd, size, v);
- 337 12 : } SPEED_STOP
+ 335 48 : SPEED_START {
+ 336 44 : raid_gen2_int32(nd, size, v);
+ 337 44 : } SPEED_STOP
338 :
- 339 1 : printf("%8" PRIu64, ds / dt);
- 340 1 : fflush(stdout);
+ 339 4 : printf("%8" PRIu64, ds / dt);
+ 340 4 : fflush(stdout);
341 :
- 342 15 : SPEED_START {
- 343 14 : raid_gen2_int64(nd, size, v);
- 344 14 : } SPEED_STOP
+ 342 48 : SPEED_START {
+ 343 44 : raid_gen2_int64(nd, size, v);
+ 344 44 : } SPEED_STOP
345 :
- 346 1 : printf("%8" PRIu64, ds / dt);
- 347 1 : fflush(stdout);
+ 346 4 : printf("%8" PRIu64, ds / dt);
+ 347 4 : fflush(stdout);
348 :
349 : #ifdef CONFIG_X86
350 : #ifdef CONFIG_SSE2
- 351 1 : if (raid_cpu_has_sse2()) {
- 352 51 : SPEED_START {
- 353 50 : raid_gen2_sse2(nd, size, v);
- 354 50 : } SPEED_STOP
+ 351 4 : if (raid_cpu_has_sse2()) {
+ 352 144 : SPEED_START {
+ 353 140 : raid_gen2_sse2(nd, size, v);
+ 354 140 : } SPEED_STOP
355 :
- 356 1 : printf("%8" PRIu64, ds / dt);
- 357 1 : fflush(stdout);
+ 356 4 : printf("%8" PRIu64, ds / dt);
+ 357 4 : fflush(stdout);
358 :
359 : #ifdef CONFIG_X86_64
360 : SPEED_START {
@@ -429,53 +429,53 @@
367 : }
368 : #endif
369 :
- 370 1 : printf("%8s", "");
+ 370 4 : printf("%8s", "");
371 : #ifdef CONFIG_X86_64
372 : printf("%8s", "");
373 : #endif
374 : #ifdef CONFIG_AVX2
- 375 1 : if (raid_cpu_has_avx2()) {
- 376 0 : SPEED_START {
- 377 0 : raid_gen2_avx2(nd, size, v);
- 378 0 : } SPEED_STOP
+ 375 4 : if (raid_cpu_has_avx2()) {
+ 376 4 : SPEED_START {
+ 377 3 : raid_gen2_avx2(nd, size, v);
+ 378 3 : } SPEED_STOP
379 :
- 380 0 : printf("%8" PRIu64, ds / dt);
- 381 0 : fflush(stdout);
+ 380 1 : printf("%8" PRIu64, ds / dt);
+ 381 1 : fflush(stdout);
382 : }
383 : #endif
384 : #endif
- 385 1 : printf("\n");
+ 385 4 : printf("\n");
386 :
387 : /* GENz */
- 388 1 : printf("%8s", "genz");
- 389 1 : printf("%8s", raid_genz_tag());
- 390 1 : fflush(stdout);
+ 388 4 : printf("%8s", "genz");
+ 389 4 : printf("%8s", raid_genz_tag());
+ 390 4 : fflush(stdout);
391 :
- 392 1 : printf("%8s", "");
+ 392 4 : printf("%8s", "");
393 :
- 394 9 : SPEED_START {
- 395 8 : raid_genz_int32(nd, size, v);
- 396 8 : } SPEED_STOP
+ 394 32 : SPEED_START {
+ 395 28 : raid_genz_int32(nd, size, v);
+ 396 28 : } SPEED_STOP
397 :
- 398 1 : printf("%8" PRIu64, ds / dt);
- 399 1 : fflush(stdout);
+ 398 4 : printf("%8" PRIu64, ds / dt);
+ 399 4 : fflush(stdout);
400 :
- 401 10 : SPEED_START {
- 402 9 : raid_genz_int64(nd, size, v);
- 403 9 : } SPEED_STOP
+ 401 32 : SPEED_START {
+ 402 28 : raid_genz_int64(nd, size, v);
+ 403 28 : } SPEED_STOP
404 :
- 405 1 : printf("%8" PRIu64, ds / dt);
- 406 1 : fflush(stdout);
+ 405 4 : printf("%8" PRIu64, ds / dt);
+ 406 4 : fflush(stdout);
407 :
408 : #ifdef CONFIG_X86
409 : #ifdef CONFIG_SSE2
- 410 1 : if (raid_cpu_has_sse2()) {
- 411 27 : SPEED_START {
- 412 26 : raid_genz_sse2(nd, size, v);
- 413 26 : } SPEED_STOP
+ 410 4 : if (raid_cpu_has_sse2()) {
+ 411 86 : SPEED_START {
+ 412 82 : raid_genz_sse2(nd, size, v);
+ 413 82 : } SPEED_STOP
414 :
- 415 1 : printf("%8" PRIu64, ds / dt);
- 416 1 : fflush(stdout);
+ 415 4 : printf("%8" PRIu64, ds / dt);
+ 416 4 : fflush(stdout);
417 :
418 : #ifdef CONFIG_X86_64
419 : SPEED_START {
@@ -488,11 +488,11 @@
426 : }
427 : #endif
428 :
- 429 1 : printf("%8s", "");
+ 429 4 : printf("%8s", "");
430 : #ifdef CONFIG_X86_64
431 : printf("%8s", "");
432 : #endif
- 433 1 : printf("%8s", "");
+ 433 4 : printf("%8s", "");
434 :
435 : #ifdef CONFIG_X86_64
436 : #ifdef CONFIG_AVX2
@@ -507,26 +507,26 @@
445 : #endif
446 : #endif
447 : #endif
- 448 1 : printf("\n");
+ 448 4 : printf("\n");
449 :
450 : /* GEN3 */
- 451 1 : printf("%8s", "gen3");
- 452 1 : printf("%8s", raid_gen3_tag());
- 453 1 : fflush(stdout);
+ 451 4 : printf("%8s", "gen3");
+ 452 4 : printf("%8s", raid_gen3_tag());
+ 453 4 : fflush(stdout);
454 :
- 455 4 : SPEED_START {
- 456 3 : raid_gen3_int8(nd, size, v);
- 457 3 : } SPEED_STOP
+ 455 12 : SPEED_START {
+ 456 8 : raid_gen3_int8(nd, size, v);
+ 457 8 : } SPEED_STOP
458 :
- 459 1 : printf("%8" PRIu64, ds / dt);
- 460 1 : fflush(stdout);
+ 459 4 : printf("%8" PRIu64, ds / dt);
+ 460 4 : fflush(stdout);
461 :
- 462 1 : printf("%8s", "");
- 463 1 : printf("%8s", "");
+ 462 4 : printf("%8s", "");
+ 463 4 : printf("%8s", "");
464 :
465 : #ifdef CONFIG_X86
- 466 1 : if (raid_cpu_has_sse2()) {
- 467 1 : printf("%8s", "");
+ 466 4 : if (raid_cpu_has_sse2()) {
+ 467 4 : printf("%8s", "");
468 :
469 : #ifdef CONFIG_X86_64
470 : printf("%8s", "");
@@ -536,13 +536,13 @@
474 :
475 : #ifdef CONFIG_X86
476 : #ifdef CONFIG_SSSE3
- 477 1 : if (raid_cpu_has_ssse3()) {
- 478 27 : SPEED_START {
- 479 26 : raid_gen3_ssse3(nd, size, v);
- 480 26 : } SPEED_STOP
+ 477 4 : if (raid_cpu_has_ssse3()) {
+ 478 53 : SPEED_START {
+ 479 50 : raid_gen3_ssse3(nd, size, v);
+ 480 50 : } SPEED_STOP
481 :
- 482 1 : printf("%8" PRIu64, ds / dt);
- 483 1 : fflush(stdout);
+ 482 3 : printf("%8" PRIu64, ds / dt);
+ 483 3 : fflush(stdout);
484 :
485 : #ifdef CONFIG_X86_64
486 : SPEED_START {
@@ -555,7 +555,7 @@
493 : }
494 : #endif
495 :
- 496 1 : printf("%8s", "");
+ 496 4 : printf("%8s", "");
497 :
498 : #ifdef CONFIG_X86_64
499 : #ifdef CONFIG_AVX2
@@ -570,27 +570,27 @@
508 : #endif
509 : #endif
510 : #endif
- 511 1 : printf("\n");
+ 511 4 : printf("\n");
512 :
513 : /* GEN4 */
- 514 1 : printf("%8s", "gen4");
- 515 1 : printf("%8s", raid_gen4_tag());
- 516 1 : fflush(stdout);
+ 514 4 : printf("%8s", "gen4");
+ 515 4 : printf("%8s", raid_gen4_tag());
+ 516 4 : fflush(stdout);
517 :
- 518 4 : SPEED_START {
- 519 3 : raid_gen4_int8(nd, size, v);
- 520 3 : } SPEED_STOP
+ 518 12 : SPEED_START {
+ 519 8 : raid_gen4_int8(nd, size, v);
+ 520 8 : } SPEED_STOP
521 :
- 522 1 : printf("%8" PRIu64, ds / dt);
- 523 1 : fflush(stdout);
+ 522 4 : printf("%8" PRIu64, ds / dt);
+ 523 4 : fflush(stdout);
524 :
- 525 1 : printf("%8s", "");
- 526 1 : printf("%8s", "");
+ 525 4 : printf("%8s", "");
+ 526 4 : printf("%8s", "");
527 :
528 : #ifdef CONFIG_X86
529 : #ifdef CONFIG_SSE2
- 530 1 : if (raid_cpu_has_sse2()) {
- 531 1 : printf("%8s", "");
+ 530 4 : if (raid_cpu_has_sse2()) {
+ 531 4 : printf("%8s", "");
532 :
533 : #ifdef CONFIG_X86_64
534 : printf("%8s", "");
@@ -601,13 +601,13 @@
539 :
540 : #ifdef CONFIG_X86
541 : #ifdef CONFIG_SSSE3
- 542 1 : if (raid_cpu_has_ssse3()) {
- 543 19 : SPEED_START {
- 544 18 : raid_gen4_ssse3(nd, size, v);
- 545 18 : } SPEED_STOP
+ 542 4 : if (raid_cpu_has_ssse3()) {
+ 543 36 : SPEED_START {
+ 544 33 : raid_gen4_ssse3(nd, size, v);
+ 545 33 : } SPEED_STOP
546 :
- 547 1 : printf("%8" PRIu64, ds / dt);
- 548 1 : fflush(stdout);
+ 547 3 : printf("%8" PRIu64, ds / dt);
+ 548 3 : fflush(stdout);
549 :
550 : #ifdef CONFIG_X86_64
551 : SPEED_START {
@@ -620,7 +620,7 @@
558 : }
559 : #endif
560 :
- 561 1 : printf("%8s", "");
+ 561 4 : printf("%8s", "");
562 :
563 : #ifdef CONFIG_X86_64
564 : #ifdef CONFIG_AVX2
@@ -635,27 +635,27 @@
573 : #endif
574 : #endif
575 : #endif
- 576 1 : printf("\n");
+ 576 4 : printf("\n");
577 :
578 : /* GEN5 */
- 579 1 : printf("%8s", "gen5");
- 580 1 : printf("%8s", raid_gen5_tag());
- 581 1 : fflush(stdout);
+ 579 4 : printf("%8s", "gen5");
+ 580 4 : printf("%8s", raid_gen5_tag());
+ 581 4 : fflush(stdout);
582 :
- 583 3 : SPEED_START {
- 584 2 : raid_gen5_int8(nd, size, v);
- 585 2 : } SPEED_STOP
+ 583 12 : SPEED_START {
+ 584 8 : raid_gen5_int8(nd, size, v);
+ 585 8 : } SPEED_STOP
586 :
- 587 1 : printf("%8" PRIu64, ds / dt);
- 588 1 : fflush(stdout);
+ 587 4 : printf("%8" PRIu64, ds / dt);
+ 588 4 : fflush(stdout);
589 :
- 590 1 : printf("%8s", "");
- 591 1 : printf("%8s", "");
+ 590 4 : printf("%8s", "");
+ 591 4 : printf("%8s", "");
592 :
593 : #ifdef CONFIG_X86
594 : #ifdef CONFIG_SSE2
- 595 1 : if (raid_cpu_has_sse2()) {
- 596 1 : printf("%8s", "");
+ 595 4 : if (raid_cpu_has_sse2()) {
+ 596 4 : printf("%8s", "");
597 :
598 : #ifdef CONFIG_X86_64
599 : printf("%8s", "");
@@ -666,13 +666,13 @@
604 :
605 : #ifdef CONFIG_X86
606 : #ifdef CONFIG_SSSE3
- 607 1 : if (raid_cpu_has_ssse3()) {
- 608 15 : SPEED_START {
- 609 14 : raid_gen5_ssse3(nd, size, v);
- 610 14 : } SPEED_STOP
+ 607 4 : if (raid_cpu_has_ssse3()) {
+ 608 25 : SPEED_START {
+ 609 22 : raid_gen5_ssse3(nd, size, v);
+ 610 22 : } SPEED_STOP
611 :
- 612 1 : printf("%8" PRIu64, ds / dt);
- 613 1 : fflush(stdout);
+ 612 3 : printf("%8" PRIu64, ds / dt);
+ 613 3 : fflush(stdout);
614 :
615 : #ifdef CONFIG_X86_64
616 : SPEED_START {
@@ -685,7 +685,7 @@
623 : }
624 : #endif
625 :
- 626 1 : printf("%8s", "");
+ 626 4 : printf("%8s", "");
627 :
628 : #ifdef CONFIG_X86_64
629 : #ifdef CONFIG_AVX2
@@ -700,27 +700,27 @@
638 : #endif
639 : #endif
640 : #endif
- 641 1 : printf("\n");
+ 641 4 : printf("\n");
642 :
643 : /* GEN6 */
- 644 1 : printf("%8s", "gen6");
- 645 1 : printf("%8s", raid_gen6_tag());
- 646 1 : fflush(stdout);
+ 644 4 : printf("%8s", "gen6");
+ 645 4 : printf("%8s", raid_gen6_tag());
+ 646 4 : fflush(stdout);
647 :
- 648 3 : SPEED_START {
- 649 2 : raid_gen6_int8(nd, size, v);
- 650 2 : } SPEED_STOP
+ 648 11 : SPEED_START {
+ 649 7 : raid_gen6_int8(nd, size, v);
+ 650 7 : } SPEED_STOP
651 :
- 652 1 : printf("%8" PRIu64, ds / dt);
- 653 1 : fflush(stdout);
+ 652 4 : printf("%8" PRIu64, ds / dt);
+ 653 4 : fflush(stdout);
654 :
- 655 1 : printf("%8s", "");
- 656 1 : printf("%8s", "");
+ 655 4 : printf("%8s", "");
+ 656 4 : printf("%8s", "");
657 :
658 : #ifdef CONFIG_X86
659 : #ifdef CONFIG_SSE2
- 660 1 : if (raid_cpu_has_sse2()) {
- 661 1 : printf("%8s", "");
+ 660 4 : if (raid_cpu_has_sse2()) {
+ 661 4 : printf("%8s", "");
662 :
663 : #ifdef CONFIG_X86_64
664 : printf("%8s", "");
@@ -731,13 +731,13 @@
669 :
670 : #ifdef CONFIG_X86
671 : #ifdef CONFIG_SSSE3
- 672 1 : if (raid_cpu_has_ssse3()) {
- 673 13 : SPEED_START {
- 674 12 : raid_gen6_ssse3(nd, size, v);
- 675 12 : } SPEED_STOP
+ 672 4 : if (raid_cpu_has_ssse3()) {
+ 673 21 : SPEED_START {
+ 674 18 : raid_gen6_ssse3(nd, size, v);
+ 675 18 : } SPEED_STOP
676 :
- 677 1 : printf("%8" PRIu64, ds / dt);
- 678 1 : fflush(stdout);
+ 677 3 : printf("%8" PRIu64, ds / dt);
+ 678 3 : fflush(stdout);
679 :
680 : #ifdef CONFIG_X86_64
681 : SPEED_START {
@@ -750,7 +750,7 @@
688 : }
689 : #endif
690 :
- 691 1 : printf("%8s", "");
+ 691 4 : printf("%8s", "");
692 :
693 : #ifdef CONFIG_X86_64
694 : #ifdef CONFIG_AVX2
@@ -765,248 +765,248 @@
703 : #endif
704 : #endif
705 : #endif
- 706 1 : printf("\n");
- 707 1 : printf("\n");
+ 706 4 : printf("\n");
+ 707 4 : printf("\n");
708 :
709 : /* recover table */
- 710 1 : printf("RAID functions used for recovering with 'fix':\n");
- 711 1 : printf("%8s", "");
- 712 1 : printf("%8s", "best");
- 713 1 : printf("%8s", "int8");
+ 710 4 : printf("RAID functions used for recovering with 'fix':\n");
+ 711 4 : printf("%8s", "");
+ 712 4 : printf("%8s", "best");
+ 713 4 : printf("%8s", "int8");
714 : #ifdef CONFIG_X86
- 715 1 : printf("%8s", "ssse3");
- 716 1 : printf("%8s", "avx2");
+ 715 4 : printf("%8s", "ssse3");
+ 716 4 : printf("%8s", "avx2");
717 : #endif
- 718 1 : printf("\n");
+ 718 4 : printf("\n");
719 :
- 720 1 : printf("%8s", "rec1");
- 721 1 : printf("%8s", raid_rec1_tag());
- 722 1 : fflush(stdout);
+ 720 4 : printf("%8s", "rec1");
+ 721 4 : printf("%8s", raid_rec1_tag());
+ 722 4 : fflush(stdout);
723 :
- 724 3 : SPEED_START {
- 725 18 : for (j = 0; j < nd; ++j)
+ 724 11 : SPEED_START {
+ 725 63 : for (j = 0; j < nd; ++j)
726 : /* +1 to avoid GEN1 optimized case */
- 727 16 : raid_rec1_int8(1, id, ip + 1, nd, size, v);
- 728 2 : } SPEED_STOP
+ 727 56 : raid_rec1_int8(1, id, ip + 1, nd, size, v);
+ 728 7 : } SPEED_STOP
729 :
- 730 1 : printf("%8" PRIu64, ds / dt);
- 731 1 : fflush(stdout);
+ 730 4 : printf("%8" PRIu64, ds / dt);
+ 731 4 : fflush(stdout);
732 :
733 : #ifdef CONFIG_X86
734 : #ifdef CONFIG_SSSE3
- 735 1 : if (raid_cpu_has_ssse3()) {
- 736 5 : SPEED_START {
- 737 36 : for (j = 0; j < nd; ++j)
+ 735 4 : if (raid_cpu_has_ssse3()) {
+ 736 10 : SPEED_START {
+ 737 63 : for (j = 0; j < nd; ++j)
738 : /* +1 to avoid GEN1 optimized case */
- 739 32 : raid_rec1_ssse3(1, id, ip + 1, nd, size, v);
- 740 4 : } SPEED_STOP
+ 739 56 : raid_rec1_ssse3(1, id, ip + 1, nd, size, v);
+ 740 7 : } SPEED_STOP
741 :
- 742 1 : printf("%8" PRIu64, ds / dt);
+ 742 3 : printf("%8" PRIu64, ds / dt);
743 : }
744 : #endif
745 : #ifdef CONFIG_AVX2
- 746 1 : if (raid_cpu_has_avx2()) {
- 747 0 : SPEED_START {
- 748 0 : for (j = 0; j < nd; ++j)
+ 746 4 : if (raid_cpu_has_avx2()) {
+ 747 2 : SPEED_START {
+ 748 9 : for (j = 0; j < nd; ++j)
749 : /* +1 to avoid GEN1 optimized case */
- 750 0 : raid_rec1_avx2(1, id, ip + 1, nd, size, v);
- 751 0 : } SPEED_STOP
+ 750 8 : raid_rec1_avx2(1, id, ip + 1, nd, size, v);
+ 751 1 : } SPEED_STOP
752 :
- 753 0 : printf("%8" PRIu64, ds / dt);
+ 753 1 : printf("%8" PRIu64, ds / dt);
754 : }
755 : #endif
756 : #endif
- 757 1 : printf("\n");
+ 757 4 : printf("\n");
758 :
- 759 1 : printf("%8s", "rec2");
- 760 1 : printf("%8s", raid_rec2_tag());
- 761 1 : fflush(stdout);
+ 759 4 : printf("%8s", "rec2");
+ 760 4 : printf("%8s", raid_rec2_tag());
+ 761 4 : fflush(stdout);
762 :
- 763 3 : SPEED_START {
- 764 18 : for (j = 0; j < nd; ++j)
+ 763 8 : SPEED_START {
+ 764 36 : for (j = 0; j < nd; ++j)
765 : /* +1 to avoid GEN2 optimized case */
- 766 16 : raid_rec2_int8(2, id, ip + 1, nd, size, v);
- 767 2 : } SPEED_STOP
+ 766 32 : raid_rec2_int8(2, id, ip + 1, nd, size, v);
+ 767 4 : } SPEED_STOP
768 :
- 769 1 : printf("%8" PRIu64, ds / dt);
- 770 1 : fflush(stdout);
+ 769 4 : printf("%8" PRIu64, ds / dt);
+ 770 4 : fflush(stdout);
771 :
772 : #ifdef CONFIG_X86
773 : #ifdef CONFIG_SSSE3
- 774 1 : if (raid_cpu_has_ssse3()) {
- 775 3 : SPEED_START {
- 776 18 : for (j = 0; j < nd; ++j)
+ 774 4 : if (raid_cpu_has_ssse3()) {
+ 775 9 : SPEED_START {
+ 776 54 : for (j = 0; j < nd; ++j)
777 : /* +1 to avoid GEN2 optimized case */
- 778 16 : raid_rec2_ssse3(2, id, ip + 1, nd, size, v);
- 779 2 : } SPEED_STOP
+ 778 48 : raid_rec2_ssse3(2, id, ip + 1, nd, size, v);
+ 779 6 : } SPEED_STOP
780 :
- 781 1 : printf("%8" PRIu64, ds / dt);
+ 781 3 : printf("%8" PRIu64, ds / dt);
782 : }
783 : #endif
784 : #ifdef CONFIG_AVX2
- 785 1 : if (raid_cpu_has_avx2()) {
- 786 0 : SPEED_START {
- 787 0 : for (j = 0; j < nd; ++j)
+ 785 4 : if (raid_cpu_has_avx2()) {
+ 786 2 : SPEED_START {
+ 787 9 : for (j = 0; j < nd; ++j)
788 : /* +1 to avoid GEN1 optimized case */
- 789 0 : raid_rec2_avx2(2, id, ip + 1, nd, size, v);
- 790 0 : } SPEED_STOP
+ 789 8 : raid_rec2_avx2(2, id, ip + 1, nd, size, v);
+ 790 1 : } SPEED_STOP
791 :
- 792 0 : printf("%8" PRIu64, ds / dt);
+ 792 1 : printf("%8" PRIu64, ds / dt);
793 : }
794 : #endif
795 : #endif
- 796 1 : printf("\n");
+ 796 4 : printf("\n");
797 :
- 798 1 : printf("%8s", "rec3");
- 799 1 : printf("%8s", raid_recX_tag());
- 800 1 : fflush(stdout);
+ 798 4 : printf("%8s", "rec3");
+ 799 4 : printf("%8s", raid_recX_tag());
+ 800 4 : fflush(stdout);
801 :
- 802 2 : SPEED_START {
- 803 9 : for (j = 0; j < nd; ++j)
- 804 8 : raid_recX_int8(3, id, ip, nd, size, v);
- 805 1 : } SPEED_STOP
+ 802 8 : SPEED_START {
+ 803 36 : for (j = 0; j < nd; ++j)
+ 804 32 : raid_recX_int8(3, id, ip, nd, size, v);
+ 805 4 : } SPEED_STOP
806 :
- 807 1 : printf("%8" PRIu64, ds / dt);
- 808 1 : fflush(stdout);
+ 807 4 : printf("%8" PRIu64, ds / dt);
+ 808 4 : fflush(stdout);
809 :
810 : #ifdef CONFIG_X86
811 : #ifdef CONFIG_SSSE3
- 812 1 : if (raid_cpu_has_ssse3()) {
- 813 3 : SPEED_START {
- 814 18 : for (j = 0; j < nd; ++j)
- 815 16 : raid_recX_ssse3(3, id, ip, nd, size, v);
- 816 2 : } SPEED_STOP
+ 812 4 : if (raid_cpu_has_ssse3()) {
+ 813 6 : SPEED_START {
+ 814 27 : for (j = 0; j < nd; ++j)
+ 815 24 : raid_recX_ssse3(3, id, ip, nd, size, v);
+ 816 3 : } SPEED_STOP
817 :
- 818 1 : printf("%8" PRIu64, ds / dt);
+ 818 3 : printf("%8" PRIu64, ds / dt);
819 : }
820 : #endif
821 : #ifdef CONFIG_AVX2
- 822 1 : if (raid_cpu_has_avx2()) {
- 823 0 : SPEED_START {
- 824 0 : for (j = 0; j < nd; ++j)
- 825 0 : raid_recX_avx2(3, id, ip, nd, size, v);
- 826 0 : } SPEED_STOP
+ 822 4 : if (raid_cpu_has_avx2()) {
+ 823 2 : SPEED_START {
+ 824 9 : for (j = 0; j < nd; ++j)
+ 825 8 : raid_recX_avx2(3, id, ip, nd, size, v);
+ 826 1 : } SPEED_STOP
827 :
- 828 0 : printf("%8" PRIu64, ds / dt);
+ 828 1 : printf("%8" PRIu64, ds / dt);
829 : }
830 : #endif
831 : #endif
- 832 1 : printf("\n");
+ 832 4 : printf("\n");
833 :
- 834 1 : printf("%8s", "rec4");
- 835 1 : printf("%8s", raid_recX_tag());
- 836 1 : fflush(stdout);
+ 834 4 : printf("%8s", "rec4");
+ 835 4 : printf("%8s", raid_recX_tag());
+ 836 4 : fflush(stdout);
837 :
- 838 2 : SPEED_START {
- 839 9 : for (j = 0; j < nd; ++j)
- 840 8 : raid_recX_int8(4, id, ip, nd, size, v);
- 841 1 : } SPEED_STOP
+ 838 8 : SPEED_START {
+ 839 36 : for (j = 0; j < nd; ++j)
+ 840 32 : raid_recX_int8(4, id, ip, nd, size, v);
+ 841 4 : } SPEED_STOP
842 :
- 843 1 : printf("%8" PRIu64, ds / dt);
- 844 1 : fflush(stdout);
+ 843 4 : printf("%8" PRIu64, ds / dt);
+ 844 4 : fflush(stdout);
845 :
846 : #ifdef CONFIG_X86
847 : #ifdef CONFIG_SSSE3
- 848 1 : if (raid_cpu_has_ssse3()) {
- 849 2 : SPEED_START {
- 850 9 : for (j = 0; j < nd; ++j)
- 851 8 : raid_recX_ssse3(4, id, ip, nd, size, v);
- 852 1 : } SPEED_STOP
+ 848 4 : if (raid_cpu_has_ssse3()) {
+ 849 6 : SPEED_START {
+ 850 27 : for (j = 0; j < nd; ++j)
+ 851 24 : raid_recX_ssse3(4, id, ip, nd, size, v);
+ 852 3 : } SPEED_STOP
853 :
- 854 1 : printf("%8" PRIu64, ds / dt);
+ 854 3 : printf("%8" PRIu64, ds / dt);
855 : }
856 : #endif
857 : #ifdef CONFIG_AVX2
- 858 1 : if (raid_cpu_has_avx2()) {
- 859 0 : SPEED_START {
- 860 0 : for (j = 0; j < nd; ++j)
- 861 0 : raid_recX_avx2(4, id, ip, nd, size, v);
- 862 0 : } SPEED_STOP
+ 858 4 : if (raid_cpu_has_avx2()) {
+ 859 2 : SPEED_START {
+ 860 9 : for (j = 0; j < nd; ++j)
+ 861 8 : raid_recX_avx2(4, id, ip, nd, size, v);
+ 862 1 : } SPEED_STOP
863 :
- 864 0 : printf("%8" PRIu64, ds / dt);
+ 864 1 : printf("%8" PRIu64, ds / dt);
865 : }
866 : #endif
867 : #endif
- 868 1 : printf("\n");
+ 868 4 : printf("\n");
869 :
- 870 1 : printf("%8s", "rec5");
- 871 1 : printf("%8s", raid_recX_tag());
- 872 1 : fflush(stdout);
+ 870 4 : printf("%8s", "rec5");
+ 871 4 : printf("%8s", raid_recX_tag());
+ 872 4 : fflush(stdout);
873 :
- 874 2 : SPEED_START {
- 875 9 : for (j = 0; j < nd; ++j)
- 876 8 : raid_recX_int8(5, id, ip, nd, size, v);
- 877 1 : } SPEED_STOP
+ 874 8 : SPEED_START {
+ 875 36 : for (j = 0; j < nd; ++j)
+ 876 32 : raid_recX_int8(5, id, ip, nd, size, v);
+ 877 4 : } SPEED_STOP
878 :
- 879 1 : printf("%8" PRIu64, ds / dt);
- 880 1 : fflush(stdout);
+ 879 4 : printf("%8" PRIu64, ds / dt);
+ 880 4 : fflush(stdout);
881 :
882 : #ifdef CONFIG_X86
883 : #ifdef CONFIG_SSSE3
- 884 1 : if (raid_cpu_has_ssse3()) {
- 885 2 : SPEED_START {
- 886 9 : for (j = 0; j < nd; ++j)
- 887 8 : raid_recX_ssse3(5, id, ip, nd, size, v);
- 888 1 : } SPEED_STOP
+ 884 4 : if (raid_cpu_has_ssse3()) {
+ 885 6 : SPEED_START {
+ 886 27 : for (j = 0; j < nd; ++j)
+ 887 24 : raid_recX_ssse3(5, id, ip, nd, size, v);
+ 888 3 : } SPEED_STOP
889 :
- 890 1 : printf("%8" PRIu64, ds / dt);
+ 890 3 : printf("%8" PRIu64, ds / dt);
891 : }
892 : #endif
893 : #ifdef CONFIG_AVX2
- 894 1 : if (raid_cpu_has_avx2()) {
- 895 0 : SPEED_START {
- 896 0 : for (j = 0; j < nd; ++j)
- 897 0 : raid_recX_avx2(5, id, ip, nd, size, v);
- 898 0 : } SPEED_STOP
+ 894 4 : if (raid_cpu_has_avx2()) {
+ 895 2 : SPEED_START {
+ 896 9 : for (j = 0; j < nd; ++j)
+ 897 8 : raid_recX_avx2(5, id, ip, nd, size, v);
+ 898 1 : } SPEED_STOP
899 :
- 900 0 : printf("%8" PRIu64, ds / dt);
+ 900 1 : printf("%8" PRIu64, ds / dt);
901 : }
902 : #endif
903 : #endif
- 904 1 : printf("\n");
+ 904 4 : printf("\n");
905 :
- 906 1 : printf("%8s", "rec6");
- 907 1 : printf("%8s", raid_recX_tag());
- 908 1 : fflush(stdout);
+ 906 4 : printf("%8s", "rec6");
+ 907 4 : printf("%8s", raid_recX_tag());
+ 908 4 : fflush(stdout);
909 :
- 910 2 : SPEED_START {
- 911 9 : for (j = 0; j < nd; ++j)
- 912 8 : raid_recX_int8(6, id, ip, nd, size, v);
- 913 1 : } SPEED_STOP
+ 910 8 : SPEED_START {
+ 911 36 : for (j = 0; j < nd; ++j)
+ 912 32 : raid_recX_int8(6, id, ip, nd, size, v);
+ 913 4 : } SPEED_STOP
914 :
- 915 1 : printf("%8" PRIu64, ds / dt);
- 916 1 : fflush(stdout);
+ 915 4 : printf("%8" PRIu64, ds / dt);
+ 916 4 : fflush(stdout);
917 :
918 : #ifdef CONFIG_X86
919 : #ifdef CONFIG_SSSE3
- 920 1 : if (raid_cpu_has_ssse3()) {
- 921 2 : SPEED_START {
- 922 9 : for (j = 0; j < nd; ++j)
- 923 8 : raid_recX_ssse3(6, id, ip, nd, size, v);
- 924 1 : } SPEED_STOP
+ 920 4 : if (raid_cpu_has_ssse3()) {
+ 921 6 : SPEED_START {
+ 922 27 : for (j = 0; j < nd; ++j)
+ 923 24 : raid_recX_ssse3(6, id, ip, nd, size, v);
+ 924 3 : } SPEED_STOP
925 :
- 926 1 : printf("%8" PRIu64, ds / dt);
+ 926 3 : printf("%8" PRIu64, ds / dt);
927 : }
928 : #endif
929 : #ifdef CONFIG_AVX2
- 930 1 : if (raid_cpu_has_avx2()) {
- 931 0 : SPEED_START {
- 932 0 : for (j = 0; j < nd; ++j)
- 933 0 : raid_recX_avx2(6, id, ip, nd, size, v);
- 934 0 : } SPEED_STOP
+ 930 4 : if (raid_cpu_has_avx2()) {
+ 931 2 : SPEED_START {
+ 932 9 : for (j = 0; j < nd; ++j)
+ 933 8 : raid_recX_avx2(6, id, ip, nd, size, v);
+ 934 1 : } SPEED_STOP
935 :
- 936 0 : printf("%8" PRIu64, ds / dt);
+ 936 1 : printf("%8" PRIu64, ds / dt);
937 : }
938 : #endif
939 : #endif
- 940 1 : printf("\n");
- 941 1 : printf("\n");
+ 940 4 : printf("\n");
+ 941 4 : printf("\n");
942 :
- 943 1 : printf("If the 'best' expectations are wrong, please report it in the SnapRAID forum\n\n");
+ 943 4 : printf("If the 'best' expectations are wrong, please report it in the SnapRAID forum\n\n");
944 :
- 945 1 : free(v_alloc);
- 946 1 : free(v);
- 947 1 : }
+ 945 4 : free(v_alloc);
+ 946 4 : free(v);
+ 947 4 : }
948 :
diff --git a/cov/cmdline/spooky2.c.func-sort-c.html b/cov/cmdline/spooky2.c.func-sort-c.html
index 76e853f3..6c0e404b 100644
--- a/cov/cmdline/spooky2.c.func-sort-c.html
+++ b/cov/cmdline/spooky2.c.func-sort-c.html
@@ -61,7 +61,7 @@
| SpookyHash128 |
- 3862036 |
+ 3860981 |
diff --git a/cov/cmdline/spooky2.c.func.html b/cov/cmdline/spooky2.c.func.html
index ba50a7ed..3324da70 100644
--- a/cov/cmdline/spooky2.c.func.html
+++ b/cov/cmdline/spooky2.c.func.html
@@ -61,7 +61,7 @@
| SpookyHash128 |
- 3862036 |
+ 3860981 |
diff --git a/cov/cmdline/spooky2.c.gcov.html b/cov/cmdline/spooky2.c.gcov.html
index f94f2459..4af0687c 100644
--- a/cov/cmdline/spooky2.c.gcov.html
+++ b/cov/cmdline/spooky2.c.gcov.html
@@ -170,7 +170,7 @@
108 : //
109 : #define sc_const 0xdeadbeefdeadbeefLL
110 :
- 111 3862036 : void SpookyHash128(const void* data, size_t size, const uint8_t* seed, uint8_t* digest)
+ 111 3860981 : void SpookyHash128(const void* data, size_t size, const uint8_t* seed, uint8_t* digest)
112 : {
113 : uint64_t h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11;
114 : uint64_t buf[sc_numVars];
@@ -183,39 +183,39 @@
121 : unsigned i;
122 : #endif
123 :
- 124 3862036 : h9 = ((const uint64_t*)seed)[0];
- 125 3862036 : h10 = ((const uint64_t*)seed)[1];
+ 124 3860981 : h9 = ((const uint64_t*)seed)[0];
+ 125 3860981 : h10 = ((const uint64_t*)seed)[1];
126 :
127 : #if WORDS_BIGENDIAN
128 : h9 = util_swap64(h9);
129 : h10 = util_swap64(h10);
130 : #endif
131 :
- 132 3862036 : h0 = h3 = h6 = h9;
- 133 3862036 : h1 = h4 = h7 = h10;
- 134 3862036 : h2 = h5 = h8 = h11 = sc_const;
+ 132 3860981 : h0 = h3 = h6 = h9;
+ 133 3860981 : h1 = h4 = h7 = h10;
+ 134 3860981 : h2 = h5 = h8 = h11 = sc_const;
135 :
- 136 3862036 : nblocks = size / sc_blockSize;
- 137 3862036 : blocks = data;
- 138 3862036 : end = blocks + nblocks * sc_numVars;
+ 136 3860981 : nblocks = size / sc_blockSize;
+ 137 3860981 : blocks = data;
+ 138 3860981 : end = blocks + nblocks * sc_numVars;
139 :
140 : /* body */
- 141 38442160 : while (blocks < end) {
+ 141 38823778 : while (blocks < end) {
142 : #if WORDS_BIGENDIAN
143 : for (i = 0; i < sc_numVars; ++i)
144 : buf[i] = util_swap64(blocks[i]);
145 : Mix(buf, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11);
146 : #else
- 147 30718088 : Mix(blocks, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11);
+ 147 31101816 : Mix(blocks, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11);
148 : #endif
- 149 30718088 : blocks += sc_numVars;
+ 149 31101816 : blocks += sc_numVars;
150 : }
151 :
152 : /* tail */
- 153 3862036 : size_remainder = (size - ((const uint8_t*)end - (const uint8_t*)data));
- 154 3862036 : memcpy(buf, end, size_remainder);
- 155 3862036 : memset(((uint8_t*)buf) + size_remainder, 0, sc_blockSize - size_remainder);
- 156 3862036 : ((uint8_t*)buf)[sc_blockSize - 1] = size_remainder;
+ 153 3860981 : size_remainder = (size - ((const uint8_t*)end - (const uint8_t*)data));
+ 154 3860981 : memcpy(buf, end, size_remainder);
+ 155 3860981 : memset(((uint8_t*)buf) + size_remainder, 0, sc_blockSize - size_remainder);
+ 156 3860981 : ((uint8_t*)buf)[sc_blockSize - 1] = size_remainder;
157 :
158 : /* finalization */
159 : #if WORDS_BIGENDIAN
@@ -223,16 +223,16 @@
161 : buf[i] = util_swap64(buf[i]);
162 : #endif
163 :
- 164 3862036 : End(buf, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11);
+ 164 3860981 : End(buf, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11);
165 :
166 : #if WORDS_BIGENDIAN
167 : h0 = util_swap64(h0);
168 : h1 = util_swap64(h1);
169 : #endif
170 :
- 171 3862036 : ((uint64_t*)digest)[0] = h0;
- 172 3862036 : ((uint64_t*)digest)[1] = h1;
- 173 3862036 : }
+ 171 3860981 : ((uint64_t*)digest)[0] = h0;
+ 172 3860981 : ((uint64_t*)digest)[1] = h1;
+ 173 3860981 : }
174 :
diff --git a/cov/cmdline/state.c.func-sort-c.html b/cov/cmdline/state.c.func-sort-c.html
index 6db3278b..69b487d1 100644
--- a/cov/cmdline/state.c.func-sort-c.html
+++ b/cov/cmdline/state.c.func-sort-c.html
@@ -69,23 +69,23 @@
| state_progress |
- 1073508 |
+ 1073409 |
| state_usage_misc |
- 1063748 |
+ 1063055 |
| state_usage_disk |
- 912951 |
+ 912357 |
| state_usage_hash |
- 777372 |
+ 776808 |
| state_usage_parity |
- 774617 |
+ 774023 |
| fs_position_is_required |
@@ -93,15 +93,15 @@
| lev_config_name |
- 186562 |
+ 186548 |
| state_usage_sched |
- 149935 |
+ 149836 |
| state_usage_raid |
- 140430 |
+ 140365 |
| find_disk_by_name |
@@ -121,7 +121,7 @@
| state_progress_latest |
- 489 |
+ 495 |
| validate_smartctl |
diff --git a/cov/cmdline/state.c.func.html b/cov/cmdline/state.c.func.html
index d986f9f0..4ee01dd6 100644
--- a/cov/cmdline/state.c.func.html
+++ b/cov/cmdline/state.c.func.html
@@ -93,7 +93,7 @@
| lev_config_name |
- 186562 |
+ 186548 |
| lev_config_scan |
@@ -141,7 +141,7 @@
| state_progress |
- 1073508 |
+ 1073409 |
| state_progress_begin |
@@ -157,7 +157,7 @@
| state_progress_latest |
- 489 |
+ 495 |
| state_progress_restart |
@@ -189,19 +189,19 @@
| state_usage_disk |
- 912951 |
+ 912357 |
| state_usage_hash |
- 777372 |
+ 776808 |
| state_usage_misc |
- 1063748 |
+ 1063055 |
| state_usage_parity |
- 774617 |
+ 774023 |
| state_usage_print |
@@ -209,11 +209,11 @@
| state_usage_raid |
- 140430 |
+ 140365 |
| state_usage_sched |
- 149935 |
+ 149836 |
| state_usage_waste |
diff --git a/cov/cmdline/state.c.gcov.html b/cov/cmdline/state.c.gcov.html
index 036fb65b..c9beeecb 100644
--- a/cov/cmdline/state.c.gcov.html
+++ b/cov/cmdline/state.c.gcov.html
@@ -125,10 +125,10 @@
63 0 : return 0;
64 : }
65 :
- 66 186562 : const char* lev_config_name(unsigned l)
+ 66 186548 : const char* lev_config_name(unsigned l)
67 : {
- 68 186562 : switch (l) {
- 69 86860 : case 0 : return "parity";
+ 68 186548 : switch (l) {
+ 69 86846 : case 0 : return "parity";
70 60620 : case 1 : return "2-parity";
71 9810 : case 2 : return "3-parity";
72 9785 : case 3 : return "4-parity";
@@ -1864,12 +1864,12 @@
1802 : int c;
1803 :
1804 : /* read the command */
- 1805 3735977 : c = sgetc(f);
- 1806 3735977 : if (c == EOF) {
+ 1805 3735825 : c = sgetc(f);
+ 1806 3735825 : if (c == EOF) {
1807 251 : break;
1808 : }
1809 :
- 1810 3735726 : if (c == 'f') {
+ 1810 3735574 : if (c == 'f') {
1811 : /* file */
1812 : char sub[PATH_MAX];
1813 : uint64_t v_size;
@@ -1881,25 +1881,25 @@
1819 : struct snapraid_disk* disk;
1820 : uint32_t mapping;
1821 :
- 1822 3612169 : ret = sgetb32(f, &mapping);
- 1823 3612169 : if (ret < 0 || mapping >= mapping_max) {
+ 1822 3612018 : ret = sgetb32(f, &mapping);
+ 1823 3612018 : if (ret < 0 || mapping >= mapping_max) {
1824 : /* LCOV_EXCL_START */
1825 : decoding_error(path, f);
1826 : log_fatal("Internal inconsistency in mapping index!\n");
1827 : os_abort();
1828 : /* LCOV_EXCL_STOP */
1829 : }
- 1830 3612169 : disk = tommy_array_get(&disk_mapping, mapping);
+ 1830 3612018 : disk = tommy_array_get(&disk_mapping, mapping);
1831 :
- 1832 3612169 : ret = sgetb64(f, &v_size);
- 1833 3612169 : if (ret < 0) {
+ 1832 3612018 : ret = sgetb64(f, &v_size);
+ 1833 3612018 : if (ret < 0) {
1834 : /* LCOV_EXCL_START */
1835 : decoding_error(path, f);
1836 : os_abort();
1837 : /* LCOV_EXCL_STOP */
1838 : }
1839 :
- 1840 3612169 : if (state->block_size == 0) {
+ 1840 3612018 : if (state->block_size == 0) {
1841 : /* LCOV_EXCL_START */
1842 : decoding_error(path, f);
1843 : log_fatal("Internal incosistency due zero blocksize!\n");
@@ -1908,7 +1908,7 @@
1846 : }
1847 :
1848 : /* check for impossible file size to avoid to crash for a too big allocation */
- 1849 3612169 : if (v_size / state->block_size > blockmax) {
+ 1849 3612018 : if (v_size / state->block_size > blockmax) {
1850 : /* LCOV_EXCL_START */
1851 : decoding_error(path, f);
1852 : log_fatal("Internal inconsistency in file size too big!\n");
@@ -1916,16 +1916,16 @@
1854 : /* LCOV_EXCL_STOP */
1855 : }
1856 :
- 1857 3612169 : ret = sgetb64(f, &v_mtime_sec);
- 1858 3612169 : if (ret < 0) {
+ 1857 3612018 : ret = sgetb64(f, &v_mtime_sec);
+ 1858 3612018 : if (ret < 0) {
1859 : /* LCOV_EXCL_START */
1860 : decoding_error(path, f);
1861 : os_abort();
1862 : /* LCOV_EXCL_STOP */
1863 : }
1864 :
- 1865 3612169 : ret = sgetb32(f, &v_mtime_nsec);
- 1866 3612169 : if (ret < 0) {
+ 1865 3612018 : ret = sgetb32(f, &v_mtime_nsec);
+ 1866 3612018 : if (ret < 0) {
1867 : /* LCOV_EXCL_START */
1868 : decoding_error(path, f);
1869 : os_abort();
@@ -1933,27 +1933,27 @@
1871 : }
1872 :
1873 : /* STAT_NSEC_INVALID is encoded as 0 */
- 1874 3612169 : if (v_mtime_nsec == 0)
+ 1874 3612018 : if (v_mtime_nsec == 0)
1875 0 : v_mtime_nsec = STAT_NSEC_INVALID;
1876 : else
- 1877 3612169 : --v_mtime_nsec;
+ 1877 3612018 : --v_mtime_nsec;
1878 :
- 1879 3612169 : ret = sgetb64(f, &v_inode);
- 1880 3612169 : if (ret < 0) {
+ 1879 3612018 : ret = sgetb64(f, &v_inode);
+ 1880 3612018 : if (ret < 0) {
1881 : /* LCOV_EXCL_START */
1882 : decoding_error(path, f);
1883 : os_abort();
1884 : /* LCOV_EXCL_STOP */
1885 : }
1886 :
- 1887 3612169 : ret = sgetbs(f, sub, sizeof(sub));
- 1888 3612169 : if (ret < 0) {
+ 1887 3612018 : ret = sgetbs(f, sub, sizeof(sub));
+ 1888 3612018 : if (ret < 0) {
1889 : /* LCOV_EXCL_START */
1890 : decoding_error(path, f);
1891 : os_abort();
1892 : /* LCOV_EXCL_STOP */
1893 : }
- 1894 3612169 : if (!*sub) {
+ 1894 3612018 : if (!*sub) {
1895 : /* LCOV_EXCL_START */
1896 : decoding_error(path, f);
1897 : log_fatal("Internal inconsistency for null file!\n");
@@ -1962,40 +1962,40 @@
1900 : }
1901 :
1902 : /* allocate the file */
- 1903 3612169 : file = file_alloc(state->block_size, sub, v_size, v_mtime_sec, v_mtime_nsec, v_inode, 0);
+ 1903 3612018 : file = file_alloc(state->block_size, sub, v_size, v_mtime_sec, v_mtime_nsec, v_inode, 0);
1904 :
1905 : /* insert the file in the file containers */
- 1906 3612169 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
- 1907 3612169 : tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
- 1908 3612169 : tommy_hashdyn_insert(&disk->stampset, &file->stampset, file, file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec));
- 1909 3612169 : tommy_list_insert_tail(&disk->filelist, &file->nodelist, file);
+ 1906 3612018 : tommy_hashdyn_insert(&disk->inodeset, &file->nodeset, file, file_inode_hash(file->inode));
+ 1907 3612018 : tommy_hashdyn_insert(&disk->pathset, &file->pathset, file, file_path_hash(file->sub));
+ 1908 3612018 : tommy_hashdyn_insert(&disk->stampset, &file->stampset, file, file_stamp_hash(file->size, file->mtime_sec, file->mtime_nsec));
+ 1909 3612018 : tommy_list_insert_tail(&disk->filelist, &file->nodelist, file);
1910 :
1911 : /* read all the blocks */
- 1912 3612169 : v_idx = 0;
- 1913 10857200 : while (v_idx < file->blockmax) {
+ 1912 3612018 : v_idx = 0;
+ 1913 10856725 : while (v_idx < file->blockmax) {
1914 : block_off_t v_pos;
1915 : uint32_t v_count;
1916 :
1917 : /* get the "subcommand */
- 1918 3632862 : c = sgetc(f);
+ 1918 3632690 : c = sgetc(f);
1919 :
- 1920 3632862 : ret = sgetb32(f, &v_pos);
- 1921 3632862 : if (ret < 0) {
+ 1920 3632690 : ret = sgetb32(f, &v_pos);
+ 1921 3632690 : if (ret < 0) {
1922 : /* LCOV_EXCL_START */
1923 : decoding_error(path, f);
1924 : os_abort();
1925 : /* LCOV_EXCL_STOP */
1926 : }
1927 :
- 1928 3632862 : ret = sgetb32(f, &v_count);
- 1929 3632862 : if (ret < 0) {
+ 1928 3632690 : ret = sgetb32(f, &v_count);
+ 1929 3632690 : if (ret < 0) {
1930 : /* LCOV_EXCL_START */
1931 : decoding_error(path, f);
1932 : os_abort();
1933 : /* LCOV_EXCL_STOP */
1934 : }
1935 :
- 1936 3632862 : if (v_idx + v_count > file->blockmax) {
+ 1936 3632690 : if (v_idx + v_count > file->blockmax) {
1937 : /* LCOV_EXCL_START */
1938 : decoding_error(path, f);
1939 : log_fatal("Internal inconsistency in block number!\n");
@@ -2003,7 +2003,7 @@
1941 : /* LCOV_EXCL_STOP */
1942 : }
1943 :
- 1944 3632862 : if (v_pos + v_count > blockmax) {
+ 1944 3632689 : if (v_pos + v_count > blockmax) {
1945 : /* LCOV_EXCL_START */
1946 : decoding_error(path, f);
1947 : log_fatal("Internal inconsistency in block size %u/%u!\n", blockmax, v_pos + v_count);
@@ -2038,9 +2038,9 @@
1976 : }
1977 :
1978 : /* read the hash only for 'blk/chg/rep', and not for 'new' */
- 1979 8897030 : if (c != 'n') {
- 1980 8897030 : ret = sread(f, block->hash, BLOCK_HASH_SIZE);
- 1981 8897030 : if (ret < 0) {
+ 1979 8896647 : if (c != 'n') {
+ 1980 8896647 : ret = sread(f, block->hash, BLOCK_HASH_SIZE);
+ 1981 8896647 : if (ret < 0) {
1982 : /* LCOV_EXCL_START */
1983 : decoding_error(path, f);
1984 : os_abort();
@@ -2053,8 +2053,8 @@
1991 :
1992 : /* if the block contains a hash of past data */
1993 : /* and we are clearing such indeterminate hashes */
- 1994 8897030 : if (state->clear_past_hash
- 1995 2543126 : && block_has_past_hash(block)
+ 1994 8896647 : if (state->clear_past_hash
+ 1995 2542743 : && block_has_past_hash(block)
1996 : ) {
1997 : /* set the hash value to INVALID */
1998 28006 : hash_invalid_set(block->hash);
@@ -2065,8 +2065,8 @@
2003 : /* in other sync commands */
2004 : /* note that this is required only in sync, and we detect */
2005 : /* this using the clear_past_hash flag */
- 2006 8897030 : if (state->clear_past_hash
- 2007 2543126 : && state->opt.force_nocopy
+ 2006 8896647 : if (state->clear_past_hash
+ 2007 2542743 : && state->opt.force_nocopy
2008 14195 : && block_state_get(block) == BLOCK_STATE_REP
2009 : ) {
2010 : /* set the hash value to INVALID */
@@ -2078,25 +2078,25 @@
2016 : /* if we want a full reallocation, marks block as invalid parity */
2017 : /* note that we do this after the force_nocopy option */
2018 : /* to avoid to mixup the two things */
- 2019 8897030 : if (state->opt.force_realloc
+ 2019 8896647 : if (state->opt.force_realloc
2020 27826 : && block_state_get(block) == BLOCK_STATE_BLK) {
2021 : /* convert from BLK to REP */
2022 27826 : block_state_set(block, BLOCK_STATE_REP);
2023 : }
2024 :
2025 : /* set the parity association */
- 2026 8897030 : fs_allocate(disk, v_pos, file, v_idx);
+ 2026 8896647 : fs_allocate(disk, v_pos, file, v_idx);
2027 :
2028 : /* go to the next block */
- 2029 8897030 : ++v_idx;
- 2030 8897030 : ++v_pos;
- 2031 8897030 : --v_count;
+ 2029 8896647 : ++v_idx;
+ 2030 8896647 : ++v_pos;
+ 2031 8896647 : --v_count;
2032 : }
2033 : }
2034 :
2035 : /* stat */
- 2036 3612169 : ++count_file;
- 2037 123557 : } else if (c == 'i') {
+ 2036 3612017 : ++count_file;
+ 2037 123556 : } else if (c == 'i') {
2038 : /* "inf" command */
2039 : snapraid_info info;
2040 : uint32_t v_pos;
@@ -2111,7 +2111,7 @@
2049 : }
2050 :
2051 251 : v_pos = 0;
- 2052 44707 : while (v_pos < blockmax) {
+ 2052 55933 : while (v_pos < blockmax) {
2053 : int bad;
2054 : int rehash;
2055 : int justsynced;
@@ -2119,15 +2119,15 @@
2057 : uint32_t flag;
2058 : uint32_t v_count;
2059 :
- 2060 44205 : ret = sgetb32(f, &v_count);
- 2061 44205 : if (ret < 0) {
+ 2060 55431 : ret = sgetb32(f, &v_count);
+ 2061 55431 : if (ret < 0) {
2062 : /* LCOV_EXCL_START */
2063 : decoding_error(path, f);
2064 : os_abort();
2065 : /* LCOV_EXCL_STOP */
2066 : }
2067 :
- 2068 44205 : if (v_pos + v_count > blockmax) {
+ 2068 55431 : if (v_pos + v_count > blockmax) {
2069 : /* LCOV_EXCL_START */
2070 : decoding_error(path, f);
2071 : log_fatal("Internal inconsistency in info size %u/%u!\n", blockmax, v_pos + v_count);
@@ -2135,8 +2135,8 @@
2073 : /* LCOV_EXCL_STOP */
2074 : }
2075 :
- 2076 44205 : ret = sgetb32(f, &flag);
- 2077 44205 : if (ret < 0) {
+ 2076 55431 : ret = sgetb32(f, &flag);
+ 2077 55431 : if (ret < 0) {
2078 : /* LCOV_EXCL_START */
2079 : decoding_error(path, f);
2080 : os_abort();
@@ -2144,10 +2144,10 @@
2082 : }
2083 :
2084 : /* if there is an info */
- 2085 44205 : if ((flag & 1) != 0) {
+ 2085 55431 : if ((flag & 1) != 0) {
2086 : /* read the time */
- 2087 44190 : ret = sgetb32(f, &t);
- 2088 44190 : if (ret < 0) {
+ 2087 55416 : ret = sgetb32(f, &t);
+ 2088 55416 : if (ret < 0) {
2089 : /* LCOV_EXCL_START */
2090 : decoding_error(path, f);
2091 : os_abort();
@@ -2155,11 +2155,11 @@
2093 : }
2094 :
2095 : /* analyze the flags */
- 2096 44190 : bad = (flag & 2) != 0;
- 2097 44190 : rehash = (flag & 4) != 0;
- 2098 44190 : justsynced = (flag & 8) != 0;
+ 2096 55416 : bad = (flag & 2) != 0;
+ 2097 55416 : rehash = (flag & 4) != 0;
+ 2098 55416 : justsynced = (flag & 8) != 0;
2099 :
- 2100 44190 : if (rehash && state->prevhash == HASH_UNDEFINED) {
+ 2100 55416 : if (rehash && state->prevhash == HASH_UNDEFINED) {
2101 : /* LCOV_EXCL_START */
2102 : decoding_error(path, f);
2103 : log_fatal("Internal inconsistency for missing previous checksum!\n");
@@ -2167,12 +2167,12 @@
2105 : /* LCOV_EXCL_STOP */
2106 : }
2107 :
- 2108 44190 : info = info_make(t + v_oldest, bad, rehash, justsynced);
+ 2108 55416 : info = info_make(t + v_oldest, bad, rehash, justsynced);
2109 : } else {
2110 15 : info = 0;
2111 : }
2112 :
- 2113 1636221 : while (v_count) {
+ 2113 1658673 : while (v_count) {
2114 : /* insert the info in the array */
2115 1547811 : info_set(&state->infoarr, v_pos, info);
2116 :
@@ -2195,7 +2195,7 @@
2133 1547811 : --v_count;
2134 : }
2135 : }
- 2136 123306 : } else if (c == 'h') {
+ 2136 123305 : } else if (c == 'h') {
2137 : /* hole */
2138 : uint32_t v_pos;
2139 : struct snapraid_disk* disk;
@@ -2293,7 +2293,7 @@
2231 : /* LCOV_EXCL_STOP */
2232 : }
2233 : }
- 2234 121919 : } else if (c == 's') {
+ 2234 121918 : } else if (c == 's') {
2235 : /* symlink */
2236 : char sub[PATH_MAX];
2237 : char linkto[PATH_MAX];
@@ -2344,7 +2344,7 @@
2282 :
2283 : /* stat */
2284 116468 : ++count_symlink;
- 2285 5451 : } else if (c == 'a') {
+ 2285 5450 : } else if (c == 'a') {
2286 : /* hardlink */
2287 : char sub[PATH_MAX];
2288 : char linkto[PATH_MAX];
@@ -2403,7 +2403,7 @@
2341 :
2342 : /* stat */
2343 597 : ++count_hardlink;
- 2344 4854 : } else if (c == 'r') {
+ 2344 4853 : } else if (c == 'r') {
2345 : /* dir */
2346 : char sub[PATH_MAX];
2347 : struct snapraid_dir* dir;
@@ -2445,7 +2445,7 @@
2383 :
2384 : /* stat */
2385 790 : ++count_dir;
- 2386 4064 : } else if (c == 'c') {
+ 2386 4063 : } else if (c == 'c') {
2387 : /* get the subcommand */
2388 252 : c = sgetc(f);
2389 :
@@ -2472,7 +2472,7 @@
2410 : os_abort();
2411 : /* LCOV_EXCL_STOP */
2412 : }
- 2413 3812 : } else if (c == 'C') {
+ 2413 3811 : } else if (c == 'C') {
2414 : /* get the sub-command */
2415 4 : c = sgetc(f);
2416 :
@@ -2499,7 +2499,7 @@
2437 : os_abort();
2438 : /* LCOV_EXCL_STOP */
2439 : }
- 2440 3808 : } else if (c == 'z') {
+ 2440 3807 : } else if (c == 'z') {
2441 : uint32_t block_size;
2442 :
2443 252 : ret = sgetb32(f, &block_size);
@@ -2531,7 +2531,7 @@
2469 : exit(EXIT_FAILURE);
2470 : /* LCOV_EXCL_STOP */
2471 : }
- 2472 3556 : } else if (c == 'y') {
+ 2472 3555 : } else if (c == 'y') {
2473 : uint32_t hash_size;
2474 :
2475 252 : ret = sgetb32(f, &hash_size);
@@ -2563,7 +2563,7 @@
2501 : exit(EXIT_FAILURE);
2502 : /* LCOV_EXCL_STOP */
2503 : }
- 2504 3304 : } else if (c == 'x') {
+ 2504 3303 : } else if (c == 'x') {
2505 252 : ret = sgetb32(f, &blockmax);
2506 252 : if (ret < 0) {
2507 : /* LCOV_EXCL_START */
@@ -2571,7 +2571,7 @@
2509 : os_abort();
2510 : /* LCOV_EXCL_STOP */
2511 : }
- 2512 4445 : } else if (c == 'm' || c == 'M') {
+ 2512 4444 : } else if (c == 'm' || c == 'M') {
2513 : struct snapraid_map* map;
2514 : char uuid[UUID_MAX];
2515 : uint32_t v_pos;
@@ -2658,7 +2658,7 @@
2596 1393 : tommy_array_grow(&disk_mapping, mapping_max + 1);
2597 1393 : tommy_array_set(&disk_mapping, mapping_max, disk);
2598 1393 : ++mapping_max;
- 2599 1659 : } else if (c == 'P') {
+ 2599 1658 : } else if (c == 'P') {
2600 : /* from SnapRAID 7.0 the 'P' command includes the free space */
2601 : /* from SnapRAID 11.0 the 'P' command is deprecated by 'Q' */
2602 : char v_uuid[UUID_MAX];
@@ -2720,7 +2720,7 @@
2658 0 : state->parity[v_level].total_blocks = v_total_blocks;
2659 0 : state->parity[v_level].free_blocks = v_free_blocks;
2660 : }
- 2661 1659 : } else if (c == 'Q') {
+ 2661 1658 : } else if (c == 'Q') {
2662 : /* from SnapRAID 11.0 the 'Q' command include size info and multi file support */
2663 : uint32_t v_level;
2664 : uint32_t v_total_blocks;
@@ -2845,7 +2845,7 @@
2783 : }
2784 : }
2785 : }
- 2786 252 : } else if (c == 'N') {
+ 2786 251 : } else if (c == 'N') {
2787 : uint32_t crc_stored;
2788 : uint32_t crc_computed;
2789 :
@@ -2879,7 +2879,7 @@
2817 : os_abort();
2818 : /* LCOV_EXCL_STOP */
2819 : }
- 2820 3735725 : }
+ 2820 3735573 : }
2821 :
2822 251 : tommy_array_done(&disk_mapping);
2823 :
@@ -3141,30 +3141,30 @@
3079 :
3080 : /* for all the blocks of the file */
3081 1770884 : begin = 0;
- 3082 5323009 : while (begin < file->blockmax) {
- 3083 1781241 : unsigned v_state = block_state_get(fs_file2block_get(file, begin));
- 3084 1781241 : block_off_t v_pos = fs_file2par_get(disk, file, begin);
+ 3082 5322967 : while (begin < file->blockmax) {
+ 3083 1781199 : unsigned v_state = block_state_get(fs_file2block_get(file, begin));
+ 3084 1781199 : block_off_t v_pos = fs_file2par_get(disk, file, begin);
3085 : uint32_t v_count;
3086 :
3087 : block_off_t end;
3088 :
3089 : /* find the end of run of blocks */
- 3090 1781241 : end = begin + 1;
- 3091 6146381 : while (end < file->blockmax) {
+ 3090 1781199 : end = begin + 1;
+ 3091 6146339 : while (end < file->blockmax) {
3092 2596728 : if (v_state != block_state_get(fs_file2block_get(file, end)))
3093 12 : break;
3094 2596716 : if (v_pos + (end - begin) != fs_file2par_get(disk, file, end))
- 3095 12817 : break;
- 3096 2583899 : ++end;
+ 3095 12775 : break;
+ 3096 2583941 : ++end;
3097 : }
3098 :
- 3099 1781241 : switch (v_state) {
+ 3099 1781199 : switch (v_state) {
3100 : case BLOCK_STATE_BLK :
- 3101 1678555 : sputc('b', f);
- 3102 1678555 : break;
+ 3101 1678581 : sputc('b', f);
+ 3102 1678581 : break;
3103 : case BLOCK_STATE_CHG :
- 3104 67768 : sputc('g', f);
- 3105 67768 : break;
+ 3104 67700 : sputc('g', f);
+ 3105 67700 : break;
3106 : case BLOCK_STATE_REP :
3107 34918 : sputc('p', f);
3108 34918 : break;
@@ -3175,19 +3175,19 @@
3113 : /* LCOV_EXCL_STOP */
3114 : }
3115 :
- 3116 1781241 : sputb32(v_pos, f);
+ 3116 1781199 : sputb32(v_pos, f);
3117 :
- 3118 1781241 : v_count = end - begin;
- 3119 1781241 : sputb32(v_count, f);
+ 3118 1781199 : v_count = end - begin;
+ 3119 1781199 : sputb32(v_count, f);
3120 :
3121 : /* write hashes */
- 3122 6146381 : for (idx = begin; idx < end; ++idx) {
+ 3122 6146339 : for (idx = begin; idx < end; ++idx) {
3123 4365140 : struct snapraid_block* block = fs_file2block_get(file, idx);
3124 :
3125 4365140 : swrite(block->hash, BLOCK_HASH_SIZE, f);
3126 : }
3127 :
- 3128 1781241 : if (serror(f)) {
+ 3128 1781199 : if (serror(f)) {
3129 : /* LCOV_EXCL_START */
3130 : log_fatal("Error writing the content file '%s'. %s.\n", serrorfile(f), strerror(errno));
3131 : return context;
@@ -3195,7 +3195,7 @@
3133 : }
3134 :
3135 : /* next begin position */
- 3136 1781241 : begin = end;
+ 3136 1781199 : begin = end;
3137 : }
3138 :
3139 1770884 : ++count_file;
@@ -3304,44 +3304,44 @@
3242 151 : sputc('i', f);
3243 151 : sputb32(info_oldest, f);
3244 151 : begin = 0;
- 3245 15146 : while (begin < blockmax) {
+ 3245 19734 : while (begin < blockmax) {
3246 : snapraid_info info;
3247 : block_off_t end;
3248 : time_t t;
3249 : unsigned flag;
3250 :
- 3251 14844 : info = info_get(&state->infoarr, begin);
+ 3251 19432 : info = info_get(&state->infoarr, begin);
3252 :
3253 : /* find the end of run of blocks */
- 3254 14844 : end = begin + 1;
- 3255 770943 : while (end < blockmax
+ 3254 19432 : end = begin + 1;
+ 3255 775531 : while (end < blockmax
3256 755951 : && info == info_get(&state->infoarr, end)
3257 : ) {
- 3258 741255 : ++end;
+ 3258 736667 : ++end;
3259 : }
3260 :
- 3261 14844 : sputb32(end - begin, f);
+ 3261 19432 : sputb32(end - begin, f);
3262 :
3263 : /* if there is info */
- 3264 14844 : if (info) {
+ 3264 19432 : if (info) {
3265 : /* other flags */
- 3266 14821 : flag = 1; /* info is present */
- 3267 14821 : if (info_get_bad(info))
- 3268 1340 : flag |= 2;
- 3269 14821 : if (info_get_rehash(info))
- 3270 4967 : flag |= 4;
- 3271 14821 : if (info_get_justsynced(info))
- 3272 7432 : flag |= 8;
- 3273 14821 : sputb32(flag, f);
+ 3266 19409 : flag = 1; /* info is present */
+ 3267 19409 : if (info_get_bad(info))
+ 3268 1358 : flag |= 2;
+ 3269 19409 : if (info_get_rehash(info))
+ 3270 5212 : flag |= 4;
+ 3271 19409 : if (info_get_justsynced(info))
+ 3272 12050 : flag |= 8;
+ 3273 19409 : sputb32(flag, f);
3274 :
- 3275 14821 : t = info_get_time(info) - info_oldest;
- 3276 14821 : sputb32(t, f);
+ 3275 19409 : t = info_get_time(info) - info_oldest;
+ 3276 19409 : sputb32(t, f);
3277 : } else {
3278 : /* write a special 0 flag to mark missing info */
3279 23 : sputb32(0, f);
3280 : }
3281 :
- 3282 14844 : if (serror(f)) {
+ 3282 19432 : if (serror(f)) {
3283 : /* LCOV_EXCL_START */
3284 : log_fatal("Error writing the content file '%s'. %s.\n", serrorfile(f), strerror(errno));
3285 : return context;
@@ -3349,7 +3349,7 @@
3287 : }
3288 :
3289 : /* next begin position */
- 3290 14844 : begin = end;
+ 3290 19432 : begin = end;
3291 : }
3292 :
3293 151 : sputc('N', f);
@@ -3438,7 +3438,7 @@
3376 711614 : time_t info_time = info_get_time(info);
3377 :
3378 711614 : if (!info_oldest || info_time < info_oldest)
- 3379 152 : info_oldest = info_time;
+ 3379 150 : info_oldest = info_time;
3380 :
3381 711614 : if (info_get_rehash(info))
3382 13822 : info_has_rehash = 1;
@@ -4089,7 +4089,7 @@
4027 78138 : || filter_existence(filter_missing, disk->dir, file->sub) != 0
4028 38646 : || filter_correctness(filter_error, &state->infoarr, disk, file) != 0
4029 : ) {
- 4030 109469 : file_flag_set(file, FILE_IS_EXCLUDED);
+ 4030 109457 : file_flag_set(file, FILE_IS_EXCLUDED);
4031 : }
4032 : }
4033 :
@@ -4229,23 +4229,23 @@
4167 : /**
4168 : * Set the latest tick data in the progress vector.
4169 : */
- 4170 489 : static void state_progress_latest(struct snapraid_state* state)
+ 4170 495 : static void state_progress_latest(struct snapraid_state* state)
4171 : {
4172 : tommy_node* i;
4173 : unsigned l;
4174 :
- 4175 489 : state->progress_tick_misc[state->progress_ptr] = state->tick_misc;
- 4176 489 : state->progress_tick_sched[state->progress_ptr] = state->tick_sched;
- 4177 489 : state->progress_tick_raid[state->progress_ptr] = state->tick_raid;
- 4178 489 : state->progress_tick_hash[state->progress_ptr] = state->tick_hash;
- 4179 489 : state->progress_tick_io[state->progress_ptr] = state->tick_io;
- 4180 3416 : for (i = state->disklist; i != 0; i = i->next) {
- 4181 2927 : struct snapraid_disk* disk = i->data;
- 4182 2927 : disk->progress_tick[state->progress_ptr] = disk->tick;
+ 4175 495 : state->progress_tick_misc[state->progress_ptr] = state->tick_misc;
+ 4176 495 : state->progress_tick_sched[state->progress_ptr] = state->tick_sched;
+ 4177 495 : state->progress_tick_raid[state->progress_ptr] = state->tick_raid;
+ 4178 495 : state->progress_tick_hash[state->progress_ptr] = state->tick_hash;
+ 4179 495 : state->progress_tick_io[state->progress_ptr] = state->tick_io;
+ 4180 3457 : for (i = state->disklist; i != 0; i = i->next) {
+ 4181 2962 : struct snapraid_disk* disk = i->data;
+ 4182 2962 : disk->progress_tick[state->progress_ptr] = disk->tick;
4183 : }
- 4184 2774 : for (l = 0; l < state->level; ++l)
- 4185 2285 : state->parity[l].progress_tick[state->progress_ptr] = state->parity[l].tick;
- 4186 489 : }
+ 4184 2811 : for (l = 0; l < state->level; ++l)
+ 4185 2316 : state->parity[l].progress_tick[state->progress_ptr] = state->parity[l].tick;
+ 4186 495 : }
4187 :
4188 : /**
4189 : * Number of columns
@@ -4395,45 +4395,45 @@
4333 1 : printf("\n");
4334 : }
4335 :
- 4336 1073508 : int state_progress(struct snapraid_state* state, struct snapraid_io* io, block_off_t blockpos, block_off_t countpos, block_off_t countmax, data_off_t countsize)
+ 4336 1073409 : int state_progress(struct snapraid_state* state, struct snapraid_io* io, block_off_t blockpos, block_off_t countpos, block_off_t countmax, data_off_t countsize)
4337 : {
4338 : time_t now;
4339 : int pred;
4340 :
- 4341 1073508 : now = time(0);
+ 4341 1073409 : now = time(0);
4342 :
4343 : /* previous position */
- 4344 1073508 : pred = state->progress_ptr + PROGRESS_MAX - 1;
- 4345 1073508 : if (pred >= PROGRESS_MAX)
- 4346 1073309 : pred -= PROGRESS_MAX;
+ 4344 1073409 : pred = state->progress_ptr + PROGRESS_MAX - 1;
+ 4345 1073409 : if (pred >= PROGRESS_MAX)
+ 4346 1073210 : pred -= PROGRESS_MAX;
4347 :
4348 : /* if the previous measure is different */
- 4349 1073508 : if (state->progress_tick == 0
- 4350 1073309 : || state->progress_time[pred] != now
+ 4349 1073409 : if (state->progress_tick == 0
+ 4350 1073210 : || state->progress_time[pred] != now
4351 : ) {
4352 : time_t elapsed;
- 4353 393 : unsigned out_perc = 0;
- 4354 393 : unsigned out_speed = 0;
- 4355 393 : unsigned out_cpu = 0;
- 4356 393 : unsigned out_eta = 0;
- 4357 393 : int out_computed = 0;
+ 4353 399 : unsigned out_perc = 0;
+ 4354 399 : unsigned out_speed = 0;
+ 4355 399 : unsigned out_cpu = 0;
+ 4356 399 : unsigned out_eta = 0;
+ 4357 399 : int out_computed = 0;
4358 :
4359 : /* store the new measure */
- 4360 393 : state->progress_time[state->progress_ptr] = now;
- 4361 393 : state->progress_pos[state->progress_ptr] = countpos;
- 4362 393 : state->progress_size[state->progress_ptr] = countsize;
- 4363 393 : state_progress_latest(state);
+ 4360 399 : state->progress_time[state->progress_ptr] = now;
+ 4361 399 : state->progress_pos[state->progress_ptr] = countpos;
+ 4362 399 : state->progress_size[state->progress_ptr] = countsize;
+ 4363 399 : state_progress_latest(state);
4364 :
- 4365 393 : elapsed = now - state->progress_whole_start - state->progress_wasted;
+ 4365 399 : elapsed = now - state->progress_whole_start - state->progress_wasted;
4366 :
4367 : /* completion percentage */
- 4368 393 : if (countmax)
- 4369 393 : out_perc = countpos * 100 / countmax;
+ 4368 399 : if (countmax)
+ 4369 399 : out_perc = countpos * 100 / countmax;
4370 :
4371 : /* if we have at least 5 measures */
- 4372 393 : if (state->progress_tick >= 5
+ 4372 399 : if (state->progress_tick >= 5
4373 : /* or if we are running in test mode, with at least one measure */
- 4374 369 : || (state->opt.force_progress && state->progress_tick >= 1)
+ 4374 378 : || (state->opt.force_progress && state->progress_tick >= 1)
4375 : ) {
4376 : int oldest;
4377 : int past;
@@ -4448,88 +4448,88 @@
4386 : uint64_t oldest_tick_total;
4387 :
4388 : /* number of past measures */
- 4389 194 : past = state->progress_tick;
+ 4389 200 : past = state->progress_tick;
4390 :
4391 : /* drop the oldest ones, to promptly */
4392 : /* skip the startup phase */
- 4393 194 : past -= past / 5;
+ 4393 200 : past -= past / 5;
4394 :
4395 : /* check how much we can go in the past */
- 4396 194 : if (past >= PROGRESS_MAX - 1) {
+ 4396 200 : if (past >= PROGRESS_MAX - 1) {
4397 : /* the vector is filled, so we are already in position */
4398 : /* to get the possible oldest one */
4399 0 : oldest = state->progress_ptr + 1;
4400 : } else {
4401 : /* go backward the number of positions selected */
- 4402 194 : oldest = state->progress_ptr + PROGRESS_MAX - past;
+ 4402 200 : oldest = state->progress_ptr + PROGRESS_MAX - past;
4403 : }
- 4404 194 : if (oldest >= PROGRESS_MAX)
- 4405 194 : oldest -= PROGRESS_MAX;
+ 4404 200 : if (oldest >= PROGRESS_MAX)
+ 4405 200 : oldest -= PROGRESS_MAX;
4406 :
- 4407 388 : tick_cpu = state->progress_tick_misc[state->progress_ptr]
- 4408 194 : + state->progress_tick_sched[state->progress_ptr]
- 4409 194 : + state->progress_tick_raid[state->progress_ptr]
- 4410 194 : + state->progress_tick_hash[state->progress_ptr];
- 4411 194 : tick_total = tick_cpu + state->progress_tick_io[state->progress_ptr];
+ 4407 400 : tick_cpu = state->progress_tick_misc[state->progress_ptr]
+ 4408 200 : + state->progress_tick_sched[state->progress_ptr]
+ 4409 200 : + state->progress_tick_raid[state->progress_ptr]
+ 4410 200 : + state->progress_tick_hash[state->progress_ptr];
+ 4411 200 : tick_total = tick_cpu + state->progress_tick_io[state->progress_ptr];
4412 :
- 4413 388 : oldest_tick_cpu = state->progress_tick_misc[oldest]
- 4414 194 : + state->progress_tick_sched[oldest]
- 4415 194 : + state->progress_tick_raid[oldest]
- 4416 194 : + state->progress_tick_hash[oldest];
- 4417 194 : oldest_tick_total = oldest_tick_cpu + state->progress_tick_io[oldest];
+ 4413 400 : oldest_tick_cpu = state->progress_tick_misc[oldest]
+ 4414 200 : + state->progress_tick_sched[oldest]
+ 4415 200 : + state->progress_tick_raid[oldest]
+ 4416 200 : + state->progress_tick_hash[oldest];
+ 4417 200 : oldest_tick_total = oldest_tick_cpu + state->progress_tick_io[oldest];
4418 :
- 4419 194 : delta_time = now - state->progress_time[oldest];
- 4420 194 : delta_pos = countpos - state->progress_pos[oldest];
- 4421 194 : delta_size = countsize - state->progress_size[oldest];
- 4422 194 : delta_tick_cpu = tick_cpu - oldest_tick_cpu;
- 4423 194 : delta_tick_total = tick_total - oldest_tick_total;
+ 4419 200 : delta_time = now - state->progress_time[oldest];
+ 4420 200 : delta_pos = countpos - state->progress_pos[oldest];
+ 4421 200 : delta_size = countsize - state->progress_size[oldest];
+ 4422 200 : delta_tick_cpu = tick_cpu - oldest_tick_cpu;
+ 4423 200 : delta_tick_total = tick_total - oldest_tick_total;
4424 :
4425 : /* estimate the speed in MB/s */
- 4426 194 : if (delta_time != 0)
- 4427 194 : out_speed = (unsigned)(delta_size / MEGA / delta_time);
+ 4426 200 : if (delta_time != 0)
+ 4427 200 : out_speed = (unsigned)(delta_size / MEGA / delta_time);
4428 :
4429 : /* estimate the cpu usage percentage */
- 4430 194 : if (delta_tick_total != 0)
- 4431 74 : out_cpu = (unsigned)(delta_tick_cpu * 100U / delta_tick_total);
+ 4430 200 : if (delta_tick_total != 0)
+ 4431 82 : out_cpu = (unsigned)(delta_tick_cpu * 100U / delta_tick_total);
4432 :
4433 : /* estimate the remaining time in minutes */
- 4434 194 : if (delta_pos != 0)
- 4435 194 : out_eta = (countmax - countpos) * delta_time / (60 * delta_pos);
+ 4434 200 : if (delta_pos != 0)
+ 4435 200 : out_eta = (countmax - countpos) * delta_time / (60 * delta_pos);
4436 :
- 4437 194 : if (state->opt.force_stats) {
+ 4437 200 : if (state->opt.force_stats) {
4438 0 : os_clear();
4439 0 : state_progress_graph(state, io, state->progress_ptr, oldest);
4440 : }
4441 :
4442 : /* we have the output value */
- 4443 194 : out_computed = 1;
+ 4443 200 : out_computed = 1;
4444 : }
4445 :
- 4446 393 : if (state->opt.gui) {
+ 4446 399 : if (state->opt.gui) {
4447 6 : log_tag("run:pos:%u:%u:%" PRIu64 ":%u:%u:%u:%u:%" PRIu64 "\n", blockpos, countpos, countsize, out_perc, out_eta, out_speed, out_cpu, (uint64_t)elapsed);
4448 6 : log_flush();
4449 : } else {
- 4450 387 : msg_bar("%u%%, %u MB", out_perc, (unsigned)(countsize / MEGA));
- 4451 387 : if (out_computed) {
- 4452 193 : msg_bar(", %u MB/s", out_speed);
- 4453 193 : msg_bar(", CPU %u%%", out_cpu);
- 4454 193 : msg_bar(", %u:%02u ETA", out_eta / 60, out_eta % 60);
+ 4450 393 : msg_bar("%u%%, %u MB", out_perc, (unsigned)(countsize / MEGA));
+ 4451 393 : if (out_computed) {
+ 4452 199 : msg_bar(", %u MB/s", out_speed);
+ 4453 199 : msg_bar(", CPU %u%%", out_cpu);
+ 4454 199 : msg_bar(", %u:%02u ETA", out_eta / 60, out_eta % 60);
4455 : }
- 4456 387 : msg_bar("%s\r", PROGRESS_CLEAR);
- 4457 387 : msg_flush();
+ 4456 393 : msg_bar("%s\r", PROGRESS_CLEAR);
+ 4457 393 : msg_flush();
4458 : }
4459 :
4460 : /* next position to fill */
- 4461 393 : ++state->progress_ptr;
- 4462 393 : if (state->progress_ptr >= PROGRESS_MAX)
+ 4461 399 : ++state->progress_ptr;
+ 4462 399 : if (state->progress_ptr >= PROGRESS_MAX)
4463 0 : state->progress_ptr -= PROGRESS_MAX;
4464 :
4465 : /* one more measure */
- 4466 393 : ++state->progress_tick;
+ 4466 399 : ++state->progress_tick;
4467 : }
4468 :
4469 : /* stop if requested */
- 4470 1073508 : if (global_interrupt) {
+ 4470 1073409 : if (global_interrupt) {
4471 : /* LCOV_EXCL_START */
4472 : if (!state->opt.gui) {
4473 : log_fatal("\n");
@@ -4541,7 +4541,7 @@
4479 : /* LCOV_EXCL_STOP */
4480 : }
4481 :
- 4482 1073508 : return 0;
+ 4482 1073409 : return 0;
4483 : }
4484 :
4485 104 : void state_usage_waste(struct snapraid_state* state)
@@ -4551,83 +4551,83 @@
4489 104 : state->tick_last = now;
4490 104 : }
4491 :
- 4492 1063748 : void state_usage_misc(struct snapraid_state* state)
+ 4492 1063055 : void state_usage_misc(struct snapraid_state* state)
4493 : {
- 4494 1063748 : uint64_t now = tick();
- 4495 1063748 : uint64_t delta = now - state->tick_last;
+ 4494 1063055 : uint64_t now = tick();
+ 4495 1063055 : uint64_t delta = now - state->tick_last;
4496 :
4497 : /* increment the time spent in computations */
- 4498 1063748 : state->tick_misc += delta;
+ 4498 1063055 : state->tick_misc += delta;
4499 :
- 4500 1063748 : state->tick_last = now;
- 4501 1063748 : }
+ 4500 1063055 : state->tick_last = now;
+ 4501 1063055 : }
4502 :
- 4503 149935 : void state_usage_sched(struct snapraid_state* state)
+ 4503 149836 : void state_usage_sched(struct snapraid_state* state)
4504 : {
- 4505 149935 : uint64_t now = tick();
- 4506 149935 : uint64_t delta = now - state->tick_last;
+ 4505 149836 : uint64_t now = tick();
+ 4506 149836 : uint64_t delta = now - state->tick_last;
4507 :
4508 : /* increment the time spent in computations */
- 4509 149935 : state->tick_sched += delta;
+ 4509 149836 : state->tick_sched += delta;
4510 :
- 4511 149935 : state->tick_last = now;
- 4512 149935 : }
+ 4511 149836 : state->tick_last = now;
+ 4512 149836 : }
4513 :
- 4514 140430 : void state_usage_raid(struct snapraid_state* state)
+ 4514 140365 : void state_usage_raid(struct snapraid_state* state)
4515 : {
- 4516 140430 : uint64_t now = tick();
- 4517 140430 : uint64_t delta = now - state->tick_last;
+ 4516 140365 : uint64_t now = tick();
+ 4517 140365 : uint64_t delta = now - state->tick_last;
4518 :
4519 : /* increment the time spent in computations */
- 4520 140430 : state->tick_raid += delta;
+ 4520 140365 : state->tick_raid += delta;
4521 :
- 4522 140430 : state->tick_last = now;
- 4523 140430 : }
+ 4522 140365 : state->tick_last = now;
+ 4523 140365 : }
4524 :
- 4525 777372 : void state_usage_hash(struct snapraid_state* state)
+ 4525 776808 : void state_usage_hash(struct snapraid_state* state)
4526 : {
- 4527 777372 : uint64_t now = tick();
- 4528 777372 : uint64_t delta = now - state->tick_last;
+ 4527 776808 : uint64_t now = tick();
+ 4528 776808 : uint64_t delta = now - state->tick_last;
4529 :
4530 : /* increment the time spent in computations */
- 4531 777372 : state->tick_hash += delta;
+ 4531 776808 : state->tick_hash += delta;
4532 :
- 4533 777372 : state->tick_last = now;
- 4534 777372 : }
+ 4533 776808 : state->tick_last = now;
+ 4534 776808 : }
4535 :
- 4536 912951 : void state_usage_disk(struct snapraid_state* state, struct snapraid_handle* handle_map, unsigned* waiting_map, unsigned waiting_mac)
+ 4536 912357 : void state_usage_disk(struct snapraid_state* state, struct snapraid_handle* handle_map, unsigned* waiting_map, unsigned waiting_mac)
4537 : {
- 4538 912951 : uint64_t now = tick();
- 4539 912951 : uint64_t delta = now - state->tick_last;
+ 4538 912357 : uint64_t now = tick();
+ 4539 912357 : uint64_t delta = now - state->tick_last;
4540 : unsigned i;
4541 :
4542 : /* increment the time spent in the data disks */
- 4543 927928 : for (i = 0; i < waiting_mac; ++i) {
- 4544 14977 : struct snapraid_disk* disk = handle_map[waiting_map[i]].disk;
+ 4543 956230 : for (i = 0; i < waiting_mac; ++i) {
+ 4544 43873 : struct snapraid_disk* disk = handle_map[waiting_map[i]].disk;
4545 :
- 4546 14977 : if (!disk)
- 4547 5 : continue;
+ 4546 43873 : if (!disk)
+ 4547 6 : continue;
4548 :
- 4549 14972 : disk->tick += delta;
+ 4549 43867 : disk->tick += delta;
4550 : }
- 4551 912951 : state->tick_io += delta;
+ 4551 912357 : state->tick_io += delta;
4552 :
- 4553 912951 : state->tick_last = now;
- 4554 912951 : }
+ 4553 912357 : state->tick_last = now;
+ 4554 912357 : }
4555 :
- 4556 774617 : void state_usage_parity(struct snapraid_state* state, unsigned* waiting_map, unsigned waiting_mac)
+ 4556 774023 : void state_usage_parity(struct snapraid_state* state, unsigned* waiting_map, unsigned waiting_mac)
4557 : {
- 4558 774617 : uint64_t now = tick();
- 4559 774617 : uint64_t delta = now - state->tick_last;
+ 4558 774023 : uint64_t now = tick();
+ 4559 774023 : uint64_t delta = now - state->tick_last;
4560 : unsigned i;
4561 :
4562 : /* increment the time spent in the parity disk */
- 4563 848719 : for (i = 0; i < waiting_mac; ++i)
- 4564 74102 : state->parity[waiting_map[i]].tick += delta;
- 4565 774617 : state->tick_io += delta;
+ 4563 851328 : for (i = 0; i < waiting_mac; ++i)
+ 4564 77305 : state->parity[waiting_map[i]].tick += delta;
+ 4565 774023 : state->tick_io += delta;
4566 :
- 4567 774617 : state->tick_last = now;
- 4568 774617 : }
+ 4567 774023 : state->tick_last = now;
+ 4568 774023 : }
4569 :
4570 96 : void state_usage_print(struct snapraid_state* state)
4571 : {
diff --git a/cov/cmdline/status.c.gcov.html b/cov/cmdline/status.c.gcov.html
index 6afb54af..6945eda7 100644
--- a/cov/cmdline/status.c.gcov.html
+++ b/cov/cmdline/status.c.gcov.html
@@ -395,10 +395,10 @@
333 39752 : scrub_time = info_get_time(info);
334 :
335 39752 : if (info_get_justsynced(info)) {
- 336 20457 : ++unscrubbed_blocks;
+ 336 20453 : ++unscrubbed_blocks;
337 :
338 : /* mark the time as not scrubbed */
- 339 20457 : scrub_time |= TIME_NEW;
+ 339 20453 : scrub_time |= TIME_NEW;
340 : }
341 :
342 39752 : timemap[count++] = scrub_time;
@@ -430,16 +430,16 @@
368 : /* output the info map */
369 8 : i = 0;
370 8 : log_tag("info_count:%u\n", count);
- 371 33 : while (i < count) {
- 372 17 : unsigned j = i + 1;
- 373 39769 : while (j < count && timemap[i] == timemap[j])
- 374 39735 : ++j;
- 375 17 : if ((timemap[i] & TIME_NEW) == 0) {
- 376 8 : log_tag("info_time:%" PRIu64 ":%u:scrubbed\n", (uint64_t)timemap[i], j - i);
+ 371 35 : while (i < count) {
+ 372 19 : unsigned j = i + 1;
+ 373 39771 : while (j < count && timemap[i] == timemap[j])
+ 374 39733 : ++j;
+ 375 19 : if ((timemap[i] & TIME_NEW) == 0) {
+ 376 7 : log_tag("info_time:%" PRIu64 ":%u:scrubbed\n", (uint64_t)timemap[i], j - i);
377 : } else {
- 378 9 : log_tag("info_time:%" PRIu64 ":%u:new\n", (uint64_t)(timemap[i] & ~TIME_NEW), j - i);
+ 378 12 : log_tag("info_time:%" PRIu64 ":%u:new\n", (uint64_t)(timemap[i] & ~TIME_NEW), j - i);
379 : }
- 380 17 : i = j;
+ 380 19 : i = j;
381 : }
382 :
383 8 : oldest = timemap[0];
@@ -462,9 +462,9 @@
400 560 : step_new = 0;
401 40872 : while (barpos < count && timemap[barpos] <= limit) {
402 39752 : if ((timemap[barpos] & TIME_NEW) != 0)
- 403 20457 : ++step_new;
+ 403 20453 : ++step_new;
404 : else
- 405 19295 : ++step_scrubbed;
+ 405 19299 : ++step_scrubbed;
406 39752 : ++barpos;
407 : }
408 :
@@ -494,20 +494,20 @@
432 8400 : unsigned scrubbed = bar_scrubbed[x];
433 :
434 8400 : if (both > pivot_upper) {
- 435 149 : if (scrubbed > pivot_lower)
- 436 71 : printf("*");
+ 435 145 : if (scrubbed > pivot_lower)
+ 436 63 : printf("*");
437 : else
- 438 78 : printf("o");
- 439 8251 : } else if (both > pivot_lower) {
- 440 16 : if (scrubbed == both)
+ 438 82 : printf("o");
+ 439 8255 : } else if (both > pivot_lower) {
+ 440 19 : if (scrubbed == both)
441 7 : printf("*");
442 : else
- 443 9 : printf("o");
+ 443 12 : printf("o");
444 : } else {
- 445 8235 : if (y == GRAPH_ROW - 1)
- 446 544 : printf("_");
+ 445 8236 : if (y == GRAPH_ROW - 1)
+ 446 541 : printf("_");
447 : else
- 448 7691 : printf(" ");
+ 448 7695 : printf(" ");
449 : }
450 : }
451 120 : printf("\n");
@@ -559,19 +559,19 @@
497 :
498 : /* print some of the errors */
499 2 : bad_print = 0;
- 500 723 : for (i = 0; i < blockmax; ++i) {
- 501 723 : snapraid_info info = info_get(&state->infoarr, i);
+ 500 720 : for (i = 0; i < blockmax; ++i) {
+ 501 720 : snapraid_info info = info_get(&state->infoarr, i);
502 :
503 : /* skip unused blocks */
- 504 723 : if (info == 0)
+ 504 720 : if (info == 0)
505 0 : continue;
506 :
- 507 723 : if (info_get_bad(info)) {
+ 507 720 : if (info_get_bad(info)) {
508 202 : printf(" %u", i);
509 202 : ++bad_print;
510 : }
511 :
- 512 723 : if (bad_print > 100) {
+ 512 720 : if (bad_print > 100) {
513 2 : printf(" and %u more...", bad - bad_print);
514 2 : break;
515 : }
diff --git a/cov/cmdline/stream.c.func-sort-c.html b/cov/cmdline/stream.c.func-sort-c.html
index 37237d4d..7f51850b 100644
--- a/cov/cmdline/stream.c.func-sort-c.html
+++ b/cov/cmdline/stream.c.func-sort-c.html
@@ -61,23 +61,23 @@
| swrite |
- 20711595 |
+ 20725275 |
| sgetb32 |
- 18635654 |
+ 18668535 |
| sread |
- 12811254 |
+ 12810720 |
| sgetb64 |
- 10850327 |
+ 10849874 |
| sputb32 |
- 9113968 |
+ 9127648 |
| sputb64 |
@@ -85,7 +85,7 @@
| sgetbs |
- 3877387 |
+ 3877236 |
| sputbs |
@@ -93,7 +93,7 @@
| sfill |
- 607114 |
+ 607111 |
| sgetc_uncached |
@@ -129,7 +129,7 @@
| sdeplete |
- 1143 |
+ 1142 |
| sopen_multi_file |
diff --git a/cov/cmdline/stream.c.func.html b/cov/cmdline/stream.c.func.html
index 16fc21bb..8191ded9 100644
--- a/cov/cmdline/stream.c.func.html
+++ b/cov/cmdline/stream.c.func.html
@@ -73,11 +73,11 @@
| sdeplete |
- 1143 |
+ 1142 |
| sfill |
- 607114 |
+ 607111 |
| sflush |
@@ -85,11 +85,11 @@
| sgetb32 |
- 18635654 |
+ 18668535 |
| sgetb64 |
- 10850327 |
+ 10849874 |
| sgetble32 |
@@ -97,7 +97,7 @@
| sgetbs |
- 3877387 |
+ 3877236 |
| sgetc_uncached |
@@ -141,7 +141,7 @@
| sputb32 |
- 9113968 |
+ 9127648 |
| sputb64 |
@@ -157,7 +157,7 @@
| sread |
- 12811254 |
+ 12810720 |
| ssync |
@@ -169,7 +169,7 @@
| swrite |
- 20711595 |
+ 20725275 |
diff --git a/cov/cmdline/stream.c.gcov.html b/cov/cmdline/stream.c.gcov.html
index 81dac81e..ddbc7331 100644
--- a/cov/cmdline/stream.c.gcov.html
+++ b/cov/cmdline/stream.c.gcov.html
@@ -263,17 +263,17 @@
201 : * Fill the read stream buffer.
202 : * \return 0 if at least on char is read, or EOF on error.
203 : */
- 204 607114 : static int sfill(STREAM* s)
+ 204 607111 : static int sfill(STREAM* s)
205 : {
206 : ssize_t ret;
207 :
- 208 607114 : if (s->state != STREAM_STATE_READ) {
+ 208 607111 : if (s->state != STREAM_STATE_READ) {
209 : /* LCOV_EXCL_START */
210 : return EOF;
211 : /* LCOV_EXCL_STOP */
212 : }
213 :
- 214 606062 : ret = read(s->handle[0].f, s->buffer, STREAM_SIZE);
+ 214 606059 : ret = read(s->handle[0].f, s->buffer, STREAM_SIZE);
215 :
216 606062 : if (ret < 0) {
217 : /* LCOV_EXCL_START */
@@ -291,38 +291,38 @@
229 604407 : s->crc = crc32c(s->crc, s->buffer, ret);
230 :
231 : /* update the offset */
- 232 604405 : s->offset_uncached = s->offset;
- 233 604405 : s->offset += ret;
+ 232 604404 : s->offset_uncached = s->offset;
+ 233 604404 : s->offset += ret;
234 :
- 235 604405 : s->pos = s->buffer;
- 236 604405 : s->end = s->buffer + ret;
+ 235 604404 : s->pos = s->buffer;
+ 236 604404 : s->end = s->buffer + ret;
237 :
- 238 604405 : return 0;
+ 238 604404 : return 0;
239 : }
240 :
- 241 1143 : int sdeplete(STREAM* s, unsigned char* last)
+ 241 1142 : int sdeplete(STREAM* s, unsigned char* last)
242 : {
243 : /* last four bytes */
- 244 1143 : last[0] = 0;
- 245 1143 : last[1] = 0;
- 246 1143 : last[2] = 0;
- 247 1143 : last[3] = 0;
+ 244 1142 : last[0] = 0;
+ 245 1142 : last[1] = 0;
+ 246 1142 : last[2] = 0;
+ 247 1142 : last[3] = 0;
248 :
249 : while (1) {
250 : /* increase the position up to 4 bytes before the end */
- 251 308267 : if (s->pos + 4 <= s->end)
- 252 148389 : s->pos = s->end - 4;
+ 251 308265 : if (s->pos + 4 <= s->end)
+ 252 148388 : s->pos = s->end - 4;
253 :
254 : /* insert the last 4 bytes */
- 255 1469857 : while (s->pos < s->end) {
- 256 853323 : last[0] = last[1];
- 257 853323 : last[1] = last[2];
- 258 853323 : last[2] = last[3];
- 259 853323 : last[3] = *s->pos++;
+ 255 1469850 : while (s->pos < s->end) {
+ 256 853320 : last[0] = last[1];
+ 257 853320 : last[1] = last[2];
+ 258 853320 : last[2] = last[3];
+ 259 853320 : last[3] = *s->pos++;
260 : }
261 :
262 : /* fill again the buffer until the end of the file */
- 263 308267 : if (sfill(s) != 0) {
+ 263 308265 : if (sfill(s) != 0) {
264 : /* on error fail */
265 1141 : if (serror(s)) {
266 : /* LCOV_EXCL_START */
@@ -333,7 +333,7 @@
271 : /* on EOF terminate */
272 1141 : break;
273 : }
- 274 307124 : }
+ 274 307123 : }
275 :
276 1141 : return 0;
277 : }
@@ -445,35 +445,35 @@
383 8138 : return i - str;
384 : }
385 :
- 386 12811254 : int sread(STREAM* f, void* void_data, unsigned size)
+ 386 12810720 : int sread(STREAM* f, void* void_data, unsigned size)
387 : {
- 388 12811254 : unsigned char* data = void_data;
+ 388 12810720 : unsigned char* data = void_data;
389 :
390 : /* if there is enough space in memory */
- 391 12811254 : if (sptrlookup(f, size)) {
+ 391 12810720 : if (sptrlookup(f, size)) {
392 : /* optimized version with all the data in memory */
- 393 12785041 : unsigned char* pos = sptrget(f);
+ 393 12784282 : unsigned char* pos = sptrget(f);
394 :
395 : /* copy it */
- 396 217739589 : while (size--)
- 397 192169507 : *data++ = *pos++;
+ 396 217726263 : while (size--)
+ 397 192157699 : *data++ = *pos++;
398 :
- 399 12785041 : sptrset(f, pos);
+ 399 12784282 : sptrset(f, pos);
400 : } else {
401 : /* standard version using sgetc() */
- 402 1376048 : while (size--) {
- 403 1323622 : int c = sgetc(f);
- 404 1323622 : if (c == EOF) {
+ 402 1380323 : while (size--) {
+ 403 1327447 : int c = sgetc(f);
+ 404 1327447 : if (c == EOF) {
405 : /* LCOV_EXCL_START */
406 : return -1;
407 : /* LCOV_EXCL_STOP */
408 : }
409 :
- 410 1323622 : *data++ = c;
+ 410 1327447 : *data++ = c;
411 : }
412 : }
413 :
- 414 12811254 : return 0;
+ 414 12810720 : return 0;
415 : }
416 :
417 5410 : int sgetline(STREAM* f, char* str, int size)
@@ -586,76 +586,76 @@
524 : }
525 : }
526 :
- 527 18635654 : int sgetb32(STREAM* f, uint32_t* value)
+ 527 18668535 : int sgetb32(STREAM* f, uint32_t* value)
528 : {
529 : uint32_t v;
530 : unsigned char b;
531 : unsigned char s;
532 : int c;
533 :
- 534 18635654 : v = 0;
- 535 18635654 : s = 0;
+ 534 18668535 : v = 0;
+ 535 18668535 : s = 0;
536 : loop:
- 537 35583277 : c = sgetc(f);
- 538 35583277 : if (c == EOF) {
+ 537 36576764 : c = sgetc(f);
+ 538 36576764 : if (c == EOF) {
539 : /* LCOV_EXCL_START */
540 : return -1;
541 : /* LCOV_EXCL_STOP */
542 : }
543 :
- 544 35583277 : b = (unsigned char)c;
- 545 35583277 : if ((b & 0x80) == 0) {
- 546 16947623 : v |= (uint32_t)b << s;
- 547 16947623 : s += 7;
- 548 16947623 : if (s >= 32) {
+ 544 36576764 : b = (unsigned char)c;
+ 545 36576764 : if ((b & 0x80) == 0) {
+ 546 17908229 : v |= (uint32_t)b << s;
+ 547 17908229 : s += 7;
+ 548 17908229 : if (s >= 32) {
549 : /* LCOV_EXCL_START */
550 : return -1;
551 : /* LCOV_EXCL_STOP */
552 : }
- 553 16947623 : goto loop;
+ 553 17908229 : goto loop;
554 : }
555 :
- 556 18635654 : v |= (uint32_t)(b & 0x7f) << s;
+ 556 18668535 : v |= (uint32_t)(b & 0x7f) << s;
557 :
- 558 18635654 : *value = v;
+ 558 18668535 : *value = v;
559 :
- 560 18635654 : return 0;
+ 560 18668535 : return 0;
561 : }
562 :
- 563 10850327 : int sgetb64(STREAM* f, uint64_t* value)
+ 563 10849874 : int sgetb64(STREAM* f, uint64_t* value)
564 : {
565 : uint64_t v;
566 : unsigned char b;
567 : unsigned char s;
568 : int c;
569 :
- 570 10850327 : v = 0;
- 571 10850327 : s = 0;
+ 570 10849874 : v = 0;
+ 571 10849874 : s = 0;
572 : loop:
- 573 39669689 : c = sgetc(f);
- 574 39669689 : if (c == EOF) {
+ 573 39668034 : c = sgetc(f);
+ 574 39668034 : if (c == EOF) {
575 : /* LCOV_EXCL_START */
576 : return -1;
577 : /* LCOV_EXCL_STOP */
578 : }
579 :
- 580 39669689 : b = (unsigned char)c;
- 581 39669689 : if ((b & 0x80) == 0) {
- 582 28819362 : v |= (uint64_t)b << s;
- 583 28819362 : s += 7;
- 584 28819362 : if (s >= 64) {
+ 580 39668034 : b = (unsigned char)c;
+ 581 39668034 : if ((b & 0x80) == 0) {
+ 582 28818160 : v |= (uint64_t)b << s;
+ 583 28818160 : s += 7;
+ 584 28818160 : if (s >= 64) {
585 : /* LCOV_EXCL_START */
586 : return -1;
587 : /* LCOV_EXCL_STOP */
588 : }
- 589 28819362 : goto loop;
+ 589 28818160 : goto loop;
590 : }
591 :
- 592 10850327 : v |= (uint64_t)(b & 0x7f) << s;
+ 592 10849874 : v |= (uint64_t)(b & 0x7f) << s;
593 :
- 594 10850327 : *value = v;
+ 594 10849874 : *value = v;
595 :
- 596 10850327 : return 0;
+ 596 10849874 : return 0;
597 : }
598 :
599 379 : int sgetble32(STREAM* f, uint32_t* value)
@@ -673,35 +673,35 @@
611 379 : return 0;
612 : }
613 :
- 614 3877387 : int sgetbs(STREAM* f, char* str, int size)
+ 614 3877236 : int sgetbs(STREAM* f, char* str, int size)
615 : {
616 : uint32_t len;
617 :
- 618 3877387 : if (sgetb32(f, &len) < 0) {
+ 618 3877236 : if (sgetb32(f, &len) < 0) {
619 : /* LCOV_EXCL_START */
620 : return -1;
621 : /* LCOV_EXCL_STOP */
622 : }
623 :
- 624 3877387 : if (len + 1 > (uint32_t)size) {
+ 624 3877236 : if (len + 1 > (uint32_t)size) {
625 : /* LCOV_EXCL_START */
626 : return -1;
627 : /* LCOV_EXCL_STOP */
628 : }
629 :
- 630 3877387 : str[len] = 0;
+ 630 3877236 : str[len] = 0;
631 :
- 632 3877387 : return sread(f, str, (int)len);
+ 632 3877236 : return sread(f, str, (int)len);
633 : }
634 :
- 635 20711595 : int swrite(const void* void_data, unsigned size, STREAM* f)
+ 635 20725275 : int swrite(const void* void_data, unsigned size, STREAM* f)
636 : {
- 637 20711595 : const unsigned char* data = void_data;
+ 637 20725275 : const unsigned char* data = void_data;
638 :
639 : /* if there is enough space in memory */
- 640 20711595 : if (sptrlookup(f, size)) {
+ 640 20725275 : if (sptrlookup(f, size)) {
641 : /* optimized version with all the data in memory */
- 642 20705435 : unsigned char* pos = sptrget(f);
+ 642 20719102 : unsigned char* pos = sptrget(f);
643 :
644 : /**
645 : * Update the crc *before* writing the data in the buffer
@@ -710,17 +710,17 @@
648 : * to be able to detect memory errors on the buffer,
649 : * happening before we write it on the file.
650 : */
- 651 20705435 : f->crc_stream = crc32c_plain(f->crc_stream, data, size);
+ 651 20719102 : f->crc_stream = crc32c_plain(f->crc_stream, data, size);
652 :
653 : /* copy it */
- 654 172587335 : while (size--)
- 655 131176465 : *pos++ = *data++;
+ 654 173066513 : while (size--)
+ 655 131628309 : *pos++ = *data++;
656 :
- 657 20705435 : sptrset(f, pos);
+ 657 20719102 : sptrset(f, pos);
658 : } else {
659 : /* standard version using sputc() */
- 660 200869 : while (size--) {
- 661 188549 : if (sputc(*data++, f) != 0) {
+ 660 202070 : while (size--) {
+ 661 189724 : if (sputc(*data++, f) != 0) {
662 : /* LCOV_EXCL_START */
663 : return -1;
664 : /* LCOV_EXCL_STOP */
@@ -728,28 +728,28 @@
666 : }
667 : }
668 :
- 669 20711595 : return 0;
+ 669 20725275 : return 0;
670 : }
671 :
- 672 9113968 : int sputb32(uint32_t value, STREAM* s)
+ 672 9127648 : int sputb32(uint32_t value, STREAM* s)
673 : {
674 : unsigned char b;
675 : unsigned char buf[16];
676 : unsigned i;
677 :
- 678 9113968 : i = 0;
+ 678 9127648 : i = 0;
679 : loop:
- 680 17456278 : b = value & 0x7f;
- 681 17456278 : value >>= 7;
+ 680 17909297 : b = value & 0x7f;
+ 681 17909297 : value >>= 7;
682 :
- 683 17456278 : if (value) {
- 684 8342310 : buf[i++] = b;
- 685 8342310 : goto loop;
+ 683 17909297 : if (value) {
+ 684 8781649 : buf[i++] = b;
+ 685 8781649 : goto loop;
686 : }
687 :
- 688 9113968 : buf[i++] = b | 0x80;
+ 688 9127648 : buf[i++] = b | 0x80;
689 :
- 690 9113968 : return swrite(buf, i, s);
+ 690 9127648 : return swrite(buf, i, s);
691 : }
692 :
693 5317120 : int sputb64(uint64_t value, STREAM* s)
diff --git a/cov/cmdline/stream.h.func-sort-c.html b/cov/cmdline/stream.h.func-sort-c.html
index b327f735..75f8a41a 100644
--- a/cov/cmdline/stream.h.func-sort-c.html
+++ b/cov/cmdline/stream.h.func-sort-c.html
@@ -61,27 +61,27 @@
| sgetc |
- 84208356 |
+ 85203689 |
| sptrlookup |
- 33528259 |
+ 33541405 |
| sptrset |
- 33490476 |
+ 33503384 |
| sptrget |
- 33490476 |
+ 33503384 |
| sputc |
- 3807708 |
+ 3808841 |
| serror |
- 3630957 |
+ 3635503 |
| sungetc |
diff --git a/cov/cmdline/stream.h.func.html b/cov/cmdline/stream.h.func.html
index 8f7d3b61..713353fa 100644
--- a/cov/cmdline/stream.h.func.html
+++ b/cov/cmdline/stream.h.func.html
@@ -65,7 +65,7 @@
| serror |
- 3630957 |
+ 3635503 |
| serrorfile |
@@ -73,7 +73,7 @@
| sgetc |
- 84208356 |
+ 85203689 |
| sgeteol |
@@ -85,19 +85,19 @@
| sptrget |
- 33490476 |
+ 33503384 |
| sptrlookup |
- 33528259 |
+ 33541405 |
| sptrset |
- 33490476 |
+ 33503384 |
| sputc |
- 3807708 |
+ 3808841 |
| sungetc |
diff --git a/cov/cmdline/stream.h.gcov.html b/cov/cmdline/stream.h.gcov.html
index a562a45d..28434aaf 100644
--- a/cov/cmdline/stream.h.gcov.html
+++ b/cov/cmdline/stream.h.gcov.html
@@ -221,33 +221,33 @@
159 : /**
160 : * Check if the buffer has enough data loaded.
161 : */
- 162 33528259 : static inline int sptrlookup(STREAM* s, int size)
+ 162 33541405 : static inline int sptrlookup(STREAM* s, int size)
163 : {
- 164 33528259 : return s->pos + size <= s->end;
+ 164 33541405 : return s->pos + size <= s->end;
165 : }
166 :
167 : /**
168 : * Get the current stream ptr.
169 : */
- 170 33490476 : static inline unsigned char* sptrget(STREAM* s)
+ 170 33503384 : static inline unsigned char* sptrget(STREAM* s)
171 : {
- 172 33490476 : return s->pos;
+ 172 33503384 : return s->pos;
173 : }
174 :
175 : /**
176 : * Set the current stream ptr.
177 : */
- 178 33490476 : static inline void sptrset(STREAM* s, unsigned char* ptr)
+ 178 33503384 : static inline void sptrset(STREAM* s, unsigned char* ptr)
179 : {
- 180 33490476 : s->pos = ptr;
- 181 33490476 : }
+ 180 33503384 : s->pos = ptr;
+ 181 33503384 : }
182 :
183 : /**
184 : * Check the error status. Like ferror().
185 : */
- 186 3630957 : static inline int serror(STREAM* s)
+ 186 3635503 : static inline int serror(STREAM* s)
187 : {
- 188 3630957 : return s->state == STREAM_STATE_ERROR;
+ 188 3635503 : return s->state == STREAM_STATE_ERROR;
189 : }
190 :
191 : /**
@@ -291,11 +291,11 @@
229 : /**
230 : * Read a char. Like fgetc().
231 : */
- 232 84208356 : static inline int sgetc(STREAM* s)
+ 232 85203689 : static inline int sgetc(STREAM* s)
233 : {
- 234 84208356 : if (tommy_unlikely(s->pos == s->end))
+ 234 85203689 : if (tommy_unlikely(s->pos == s->end))
235 298847 : return sgetc_uncached(s);
- 236 83909509 : return *s->pos++;
+ 236 84904842 : return *s->pos++;
237 : }
238 :
239 : /**
@@ -407,9 +407,9 @@
345 : * Write a char. Like fputc().
346 : * Return 0 on success or -1 on error.
347 : */
- 348 3807708 : static inline int sputc(int c, STREAM* s)
+ 348 3808841 : static inline int sputc(int c, STREAM* s)
349 : {
- 350 3807708 : if (s->pos == s->end) {
+ 350 3808841 : if (s->pos == s->end) {
351 38580 : if (sflush(s) != 0)
352 0 : return -1;
353 : }
@@ -421,11 +421,11 @@
359 : * to be able to detect memory errors on the buffer,
360 : * happening before we write it on the file.
361 : */
- 362 3807708 : s->crc_stream = crc32c_plain_char(s->crc_stream, c);
+ 362 3808841 : s->crc_stream = crc32c_plain_char(s->crc_stream, c);
363 :
- 364 3807708 : *s->pos++ = c;
+ 364 3808841 : *s->pos++ = c;
365 :
- 366 3807708 : return 0;
+ 366 3808841 : return 0;
367 : }
368 :
369 : /**
diff --git a/cov/cmdline/support.c.func-sort-c.html b/cov/cmdline/support.c.func-sort-c.html
index e16aa4ab..e2b16089 100644
--- a/cov/cmdline/support.c.func-sort-c.html
+++ b/cov/cmdline/support.c.func-sort-c.html
@@ -61,123 +61,123 @@
| thread_mutex_unlock |
- 80937280 |
+ 80857847 |
| thread_mutex_lock |
- 80931472 |
+ 80853291 |
| pathcmp |
- 51890441 |
+ 51888281 |
| pathprint |
- 51564443 |
+ 51562554 |
| unlock_memory |
- 20175842 |
+ 20174119 |
| lock_memory |
- 20175842 |
+ 20174119 |
| malloc_counter_inc |
- 20175368 |
+ 20173645 |
| malloc_nofail |
- 14365336 |
+ 14364256 |
| advise_read |
- 8904745 |
+ 8903012 |
| pathcpy |
- 7892641 |
+ 7891437 |
| strdup_nofail |
- 5800015 |
-
-
- | lock_msg |
- 3885087 |
+ 5799372 |
| unlock_msg |
- 3885087 |
+ 3888570 |
+
+
+ | lock_msg |
+ 3888569 |
| log_tag |
- 2906282 |
+ 2908990 |
| advise_flags |
- 2495144 |
+ 2494931 |
| advise_init |
- 2495049 |
+ 2494857 |
| esc_tag |
- 2427117 |
+ 2429566 |
| advise_open |
- 2416674 |
+ 2416121 |
| thread_cond_wait |
- 1125861 |
+ 1095193 |
| advise_write |
- 900515 |
+ 900323 |
| mkancestor |
- 793086 |
+ 793097 |
| log_error |
- 535740 |
+ 536153 |
| esc_shell_multi |
- 355793 |
+ 356012 |
| msg_info |
- 295568 |
+ 295787 |
| thread_cond_broadcast |
- 265024 |
+ 255449 |
| thread_cond_broadcast_and_unlock |
- 264832 |
+ 255259 |
| msg_verbose |
- 126843 |
+ 126951 |
| fmtime |
- 119588 |
+ 119601 |
| thread_cond_signal |
- 87252 |
+ 84548 |
| thread_cond_signal_and_unlock |
- 87252 |
+ 84548 |
| pathexport |
@@ -205,23 +205,23 @@
| thread_mutex_init |
- 2263 |
+ 2268 |
| thread_create |
- 2207 |
+ 2200 |
| thread_join |
- 2207 |
+ 2200 |
| thread_mutex_destroy |
- 2075 |
+ 2074 |
| msg_bar |
- 1748 |
+ 1778 |
| strsplit |
@@ -245,7 +245,7 @@
| msg_flush |
- 585 |
+ 591 |
| malloc_counter_get |
@@ -253,15 +253,15 @@
| thread_cond_init |
- 384 |
+ 380 |
| thread_cond_destroy |
- 384 |
+ 380 |
| lock_init |
- 294 |
+ 297 |
| pathcat |
diff --git a/cov/cmdline/support.c.func.html b/cov/cmdline/support.c.func.html
index 100ef92f..decef537 100644
--- a/cov/cmdline/support.c.func.html
+++ b/cov/cmdline/support.c.func.html
@@ -61,23 +61,23 @@
| advise_flags |
- 2495144 |
+ 2494931 |
| advise_init |
- 2495049 |
+ 2494857 |
| advise_open |
- 2416674 |
+ 2416121 |
| advise_read |
- 8904745 |
+ 8903012 |
| advise_write |
- 900515 |
+ 900323 |
| calloc_nofail |
@@ -85,15 +85,15 @@
| esc_shell_multi |
- 355793 |
+ 356012 |
| esc_tag |
- 2427117 |
+ 2429566 |
| fmtime |
- 119588 |
+ 119601 |
| lock_done |
@@ -101,19 +101,19 @@
| lock_init |
- 294 |
+ 297 |
| lock_memory |
- 20175842 |
+ 20174119 |
| lock_msg |
- 3885087 |
+ 3888569 |
| log_error |
- 535740 |
+ 536153 |
| log_expected |
@@ -129,7 +129,7 @@
| log_tag |
- 2906282 |
+ 2908990 |
| malloc_counter_get |
@@ -137,27 +137,27 @@
| malloc_counter_inc |
- 20175368 |
+ 20173645 |
| malloc_nofail |
- 14365336 |
+ 14364256 |
| mkancestor |
- 793086 |
+ 793097 |
| msg_bar |
- 1748 |
+ 1778 |
| msg_flush |
- 585 |
+ 591 |
| msg_info |
- 295568 |
+ 295787 |
| msg_progress |
@@ -169,7 +169,7 @@
| msg_verbose |
- 126843 |
+ 126951 |
| pathcat |
@@ -181,11 +181,11 @@
| pathcmp |
- 51890441 |
+ 51888281 |
| pathcpy |
- 7892641 |
+ 7891437 |
| pathcut |
@@ -201,7 +201,7 @@
| pathprint |
- 51564443 |
+ 51562554 |
| pathslash |
@@ -237,7 +237,7 @@
| strdup_nofail |
- 5800015 |
+ 5799372 |
| strpolish |
@@ -249,63 +249,63 @@
| thread_cond_broadcast |
- 265024 |
+ 255449 |
| thread_cond_broadcast_and_unlock |
- 264832 |
+ 255259 |
| thread_cond_destroy |
- 384 |
+ 380 |
| thread_cond_init |
- 384 |
+ 380 |
| thread_cond_signal |
- 87252 |
+ 84548 |
| thread_cond_signal_and_unlock |
- 87252 |
+ 84548 |
| thread_cond_wait |
- 1125861 |
+ 1095193 |
| thread_create |
- 2207 |
+ 2200 |
| thread_join |
- 2207 |
+ 2200 |
| thread_mutex_destroy |
- 2075 |
+ 2074 |
| thread_mutex_init |
- 2263 |
+ 2268 |
| thread_mutex_lock |
- 80931472 |
+ 80853291 |
| thread_mutex_unlock |
- 80937280 |
+ 80857847 |
| unlock_memory |
- 20175842 |
+ 20174119 |
| unlock_msg |
- 3885087 |
+ 3888570 |
diff --git a/cov/cmdline/support.c.gcov.html b/cov/cmdline/support.c.gcov.html
index bec9d5db..41f959a4 100644
--- a/cov/cmdline/support.c.gcov.html
+++ b/cov/cmdline/support.c.gcov.html
@@ -92,42 +92,42 @@
30 : static pthread_mutex_t memory_lock;
31 : #endif
32 :
- 33 3885087 : void lock_msg(void)
+ 33 3888569 : void lock_msg(void)
34 : {
35 : #if HAVE_PTHREAD
- 36 3885087 : thread_mutex_lock(&msg_lock);
+ 36 3888569 : thread_mutex_lock(&msg_lock);
37 : #endif
- 38 3885087 : }
+ 38 3888570 : }
39 :
- 40 3885087 : void unlock_msg(void)
+ 40 3888570 : void unlock_msg(void)
41 : {
42 : #if HAVE_PTHREAD
- 43 3885087 : thread_mutex_unlock(&msg_lock);
+ 43 3888570 : thread_mutex_unlock(&msg_lock);
44 : #endif
- 45 3885087 : }
+ 45 3888570 : }
46 :
- 47 20175842 : void lock_memory(void)
+ 47 20174119 : void lock_memory(void)
48 : {
49 : #if HAVE_PTHREAD
- 50 20175842 : thread_mutex_lock(&memory_lock);
+ 50 20174119 : thread_mutex_lock(&memory_lock);
51 : #endif
- 52 20175842 : }
+ 52 20174119 : }
53 :
- 54 20175842 : void unlock_memory(void)
+ 54 20174119 : void unlock_memory(void)
55 : {
56 : #if HAVE_PTHREAD
- 57 20175842 : thread_mutex_unlock(&memory_lock);
+ 57 20174119 : thread_mutex_unlock(&memory_lock);
58 : #endif
- 59 20175842 : }
+ 59 20174119 : }
60 :
- 61 294 : void lock_init(void)
+ 61 297 : void lock_init(void)
62 : {
63 : #if HAVE_PTHREAD
64 : /* initialize the locks as first operation as log_fatal depends on them */
- 65 294 : thread_mutex_init(&msg_lock, 0);
- 66 294 : thread_mutex_init(&memory_lock, 0);
+ 65 297 : thread_mutex_init(&msg_lock, 0);
+ 66 297 : thread_mutex_init(&memory_lock, 0);
67 : #endif
- 68 294 : }
+ 68 297 : }
69 :
70 263 : void lock_done(void)
71 : {
@@ -176,18 +176,18 @@
114 809 : unlock_msg();
115 809 : }
116 :
- 117 535740 : void log_error(const char* format, ...)
+ 117 536153 : void log_error(const char* format, ...)
118 : {
119 : va_list ap;
120 :
- 121 535740 : lock_msg();
+ 121 536153 : lock_msg();
122 :
- 123 535740 : if (stdlog) {
- 124 533860 : va_start(ap, format);
- 125 533860 : fprintf(stdlog, "msg:error: ");
- 126 533860 : vfprintf(stdlog, format, ap);
- 127 533860 : fflush(stdlog);
- 128 533860 : va_end(ap);
+ 123 536153 : if (stdlog) {
+ 124 534273 : va_start(ap, format);
+ 125 534273 : fprintf(stdlog, "msg:error: ");
+ 126 534273 : vfprintf(stdlog, format, ap);
+ 127 534273 : fflush(stdlog);
+ 128 534273 : va_end(ap);
129 : } else {
130 1880 : va_start(ap, format);
131 1880 : vfprintf(stderr, format, ap);
@@ -195,8 +195,8 @@
133 1880 : va_end(ap);
134 : }
135 :
- 136 535740 : unlock_msg();
- 137 535740 : }
+ 136 536153 : unlock_msg();
+ 137 536153 : }
138 :
139 11259 : void log_expected(const char* format, ...)
140 : {
@@ -215,22 +215,22 @@
153 11259 : unlock_msg();
154 11259 : }
155 :
- 156 2906282 : void log_tag(const char* format, ...)
+ 156 2908990 : void log_tag(const char* format, ...)
157 : {
158 : va_list ap;
159 :
- 160 2906282 : lock_msg();
+ 160 2908990 : lock_msg();
161 :
- 162 2906284 : if (stdlog) {
- 163 2570905 : va_start(ap, format);
- 164 2570905 : vfprintf(stdlog, format, ap);
+ 162 2908991 : if (stdlog) {
+ 163 2573555 : va_start(ap, format);
+ 164 2573555 : vfprintf(stdlog, format, ap);
165 : /* here we intentionally don't flush */
166 : /* to make the output faster */
- 167 2570905 : va_end(ap);
+ 167 2573555 : va_end(ap);
168 : }
169 :
- 170 2906284 : unlock_msg();
- 171 2906284 : }
+ 170 2908991 : unlock_msg();
+ 171 2908991 : }
172 :
173 1190 : void log_flush(void)
174 : {
@@ -268,24 +268,24 @@
206 616 : unlock_msg();
207 616 : }
208 :
- 209 295568 : void msg_info(const char* format, ...)
+ 209 295787 : void msg_info(const char* format, ...)
210 : {
211 : va_list ap;
212 :
- 213 295568 : lock_msg();
+ 213 295787 : lock_msg();
214 :
215 : /* don't output in stdlog as these messages */
216 : /* are always paired with a msg_tag() call */
217 :
- 218 295568 : if (msg_level >= MSG_INFO) {
- 219 28818 : va_start(ap, format);
- 220 28818 : vfprintf(stdout, format, ap);
- 221 28818 : fflush(stdout);
- 222 28818 : va_end(ap);
+ 218 295787 : if (msg_level >= MSG_INFO) {
+ 219 28811 : va_start(ap, format);
+ 220 28811 : vfprintf(stdout, format, ap);
+ 221 28811 : fflush(stdout);
+ 222 28811 : va_end(ap);
223 : }
224 :
- 225 295568 : unlock_msg();
- 226 295568 : }
+ 225 295787 : unlock_msg();
+ 226 295787 : }
227 :
228 4445 : void msg_progress(const char* format, ...)
229 : {
@@ -311,75 +311,75 @@
249 4445 : unlock_msg();
250 4445 : }
251 :
- 252 1748 : void msg_bar(const char* format, ...)
+ 252 1778 : void msg_bar(const char* format, ...)
253 : {
254 : va_list ap;
255 :
- 256 1748 : lock_msg();
+ 256 1778 : lock_msg();
257 :
258 : /* don't output in stdlog as these messages */
259 : /* are intended for screen only */
260 : /* also don't flush stdout as they are intended to be partial messages */
261 :
- 262 1748 : if (msg_level >= MSG_BAR) {
+ 262 1778 : if (msg_level >= MSG_BAR) {
263 0 : va_start(ap, format);
264 0 : vfprintf(stdout, format, ap);
265 0 : va_end(ap);
266 : }
267 :
- 268 1748 : unlock_msg();
- 269 1748 : }
+ 268 1778 : unlock_msg();
+ 269 1778 : }
270 :
- 271 126843 : void msg_verbose(const char* format, ...)
+ 271 126951 : void msg_verbose(const char* format, ...)
272 : {
273 : va_list ap;
274 :
- 275 126843 : lock_msg();
+ 275 126951 : lock_msg();
276 :
- 277 126843 : if (stdlog) {
- 278 124985 : va_start(ap, format);
- 279 124985 : fprintf(stdlog, "msg:verbose: ");
- 280 124985 : vfprintf(stdlog, format, ap);
- 281 124985 : fflush(stdlog);
- 282 124985 : va_end(ap);
+ 277 126951 : if (stdlog) {
+ 278 125093 : va_start(ap, format);
+ 279 125093 : fprintf(stdlog, "msg:verbose: ");
+ 280 125093 : vfprintf(stdlog, format, ap);
+ 281 125093 : fflush(stdlog);
+ 282 125093 : va_end(ap);
283 : }
284 :
- 285 126843 : if (msg_level >= MSG_VERBOSE) {
+ 285 126951 : if (msg_level >= MSG_VERBOSE) {
286 87 : va_start(ap, format);
287 87 : vfprintf(stdout, format, ap);
288 87 : fflush(stdout);
289 87 : va_end(ap);
290 : }
291 :
- 292 126843 : unlock_msg();
- 293 126843 : }
+ 292 126951 : unlock_msg();
+ 293 126951 : }
294 :
- 295 585 : void msg_flush(void)
+ 295 591 : void msg_flush(void)
296 : {
- 297 585 : lock_msg();
+ 297 591 : lock_msg();
298 :
- 299 585 : fflush(stdout);
- 300 585 : fflush(stderr);
+ 299 591 : fflush(stdout);
+ 300 591 : fflush(stderr);
301 :
- 302 585 : unlock_msg();
- 303 585 : }
+ 302 591 : unlock_msg();
+ 303 591 : }
304 :
305 64 : void printc(char c, size_t pad)
306 : {
- 307 184 : while (pad) {
+ 307 181 : while (pad) {
308 : /* group writes in long pieces */
309 : char buf[128];
- 310 56 : size_t len = pad;
+ 310 53 : size_t len = pad;
311 :
- 312 56 : if (len >= sizeof(buf))
+ 312 53 : if (len >= sizeof(buf))
313 0 : len = sizeof(buf) - 1;
314 :
- 315 56 : memset(buf, c, len);
- 316 56 : buf[len] = 0;
+ 315 53 : memset(buf, c, len);
+ 316 53 : buf[len] = 0;
317 :
- 318 56 : fputs(buf, stdout);
+ 318 53 : fputs(buf, stdout);
319 :
- 320 56 : pad -= len;
+ 320 53 : pad -= len;
321 : }
322 64 : }
323 :
@@ -451,17 +451,17 @@
389 : *p++ = to; \
390 : break
391 :
- 392 2427117 : const char* esc_tag(const char* str, char* buffer)
+ 392 2429566 : const char* esc_tag(const char* str, char* buffer)
393 : {
- 394 2427117 : char* begin = buffer;
- 395 2427117 : char* end = begin + ESC_MAX;
- 396 2427117 : char* p = begin;
+ 394 2429566 : char* begin = buffer;
+ 395 2429566 : char* end = begin + ESC_MAX;
+ 396 2429566 : char* p = begin;
397 :
398 : /* copy string with escaping */
- 399 36368385 : while (*str) {
- 400 31514151 : char c = *str;
+ 399 36399361 : while (*str) {
+ 400 31540229 : char c = *str;
401 :
- 402 31514151 : switch (c) {
+ 402 31540229 : switch (c) {
403 :
404 0 : ESCAPE('\n', '\\', 'n');
405 0 : ESCAPE('\r', '\\', 'r');
@@ -469,21 +469,21 @@
407 0 : ESCAPE('\\', '\\', '\\');
408 :
409 : default:
- 410 31514151 : if (p == end)
+ 410 31540229 : if (p == end)
411 0 : goto bail;
- 412 31514151 : *p++ = c;
- 413 31514151 : break;
+ 412 31540229 : *p++ = c;
+ 413 31540229 : break;
414 : }
415 :
- 416 31514151 : ++str;
+ 416 31540229 : ++str;
417 : }
418 :
419 : /* put final 0 */
- 420 2427117 : if (p == end)
+ 420 2429566 : if (p == end)
421 0 : goto bail;
- 422 2427117 : *p = 0;
+ 422 2429566 : *p = 0;
423 :
- 424 4854234 : return begin;
+ 424 4859132 : return begin;
425 :
426 : bail:
427 : /* LCOV_EXCL_START */
@@ -492,11 +492,11 @@
430 : /* LCOV_EXCL_STOP */
431 : }
432 :
- 433 355793 : const char* esc_shell_multi(const char** str_map, unsigned str_max, char* buffer)
+ 433 356012 : const char* esc_shell_multi(const char** str_map, unsigned str_max, char* buffer)
434 : {
- 435 355793 : char* begin = buffer;
- 436 355793 : char* end = begin + ESC_MAX;
- 437 355793 : char* p = begin;
+ 435 356012 : char* begin = buffer;
+ 436 356012 : char* end = begin + ESC_MAX;
+ 437 356012 : char* p = begin;
438 : unsigned str_mac;
439 : const char* str;
440 :
@@ -517,24 +517,24 @@
455 : #endif
456 :
457 : /* copy string with escaping */
- 458 355793 : str_mac = 0;
- 459 355793 : str = str_map[str_mac];
+ 458 356012 : str_mac = 0;
+ 459 356012 : str = str_map[str_mac];
460 : while (1) {
461 : /* get the next char */
- 462 5121824 : char c = *str;
+ 462 5124568 : char c = *str;
463 :
464 : /* if one string is finished, go to the next */
- 465 10279738 : while (c == 0 && str_mac + 1 < str_max) {
+ 465 10285226 : while (c == 0 && str_mac + 1 < str_max) {
466 36090 : ++str_mac;
467 36090 : str = str_map[str_mac];
468 36090 : c = *str;
469 : }
470 :
471 : /* if we read all the strings, stop */
- 472 5121824 : if (!c)
- 473 355793 : break;
+ 472 5124568 : if (!c)
+ 473 356012 : break;
474 :
- 475 4766031 : switch (c) {
+ 475 4768556 : switch (c) {
476 : #ifdef _WIN32
477 : /*
478 : * Windows shell escape
@@ -609,24 +609,24 @@
547 : case '/' :
548 : case '-' :
549 : /* safe chars for all shells, unquoted */
- 550 4687072 : if (p == end)
+ 550 4689540 : if (p == end)
551 0 : goto bail;
- 552 4687072 : *p++ = c;
- 553 4687072 : break;
+ 552 4689540 : *p++ = c;
+ 553 4689540 : break;
554 : default :
555 : /* all the others are quoted with \ */
- 556 78959 : if (p == end)
+ 556 79016 : if (p == end)
557 0 : goto bail;
- 558 78959 : *p++ = '\\';
- 559 78959 : if (p == end)
+ 558 79016 : *p++ = '\\';
+ 559 79016 : if (p == end)
560 0 : goto bail;
- 561 78959 : *p++ = c;
- 562 78959 : break;
+ 561 79016 : *p++ = c;
+ 562 79016 : break;
563 : #endif
564 : }
565 :
- 566 4766031 : ++str;
- 567 4766031 : }
+ 566 4768556 : ++str;
+ 567 4768556 : }
568 :
569 : #ifdef _WIN32
570 : if (has_quote) {
@@ -637,11 +637,11 @@
575 : #endif
576 :
577 : /* put final 0 */
- 578 355793 : if (p == end)
+ 578 356012 : if (p == end)
579 0 : goto bail;
- 580 355793 : *p = 0;
+ 580 356012 : *p = 0;
581 :
- 582 711586 : return begin;
+ 582 712024 : return begin;
583 :
584 : bail:
585 : /* LCOV_EXCL_START */
@@ -692,19 +692,19 @@
630 : /****************************************************************************/
631 : /* path */
632 :
- 633 7892641 : void pathcpy(char* dst, size_t size, const char* src)
+ 633 7891437 : void pathcpy(char* dst, size_t size, const char* src)
634 : {
- 635 7892641 : size_t len = strlen(src);
+ 635 7891437 : size_t len = strlen(src);
636 :
- 637 7892641 : if (len + 1 > size) {
+ 637 7891437 : if (len + 1 > size) {
638 : /* LCOV_EXCL_START */
639 : log_fatal("Path too long '%s'\n", src);
640 : os_abort();
641 : /* LCOV_EXCL_STOP */
642 : }
643 :
- 644 7892641 : memcpy(dst, src, len + 1);
- 645 7892641 : }
+ 644 7891437 : memcpy(dst, src, len + 1);
+ 645 7891437 : }
646 :
647 265 : void pathcat(char* dst, size_t size, const char* src)
648 : {
@@ -777,16 +777,16 @@
715 : #endif
716 17589 : }
717 :
- 718 51564443 : void pathprint(char* dst, size_t size, const char* format, ...)
+ 718 51562554 : void pathprint(char* dst, size_t size, const char* format, ...)
719 : {
720 : size_t len;
721 : va_list ap;
722 :
- 723 51564443 : va_start(ap, format);
- 724 51564443 : len = vsnprintf(dst, size, format, ap);
- 725 51564443 : va_end(ap);
+ 723 51562554 : va_start(ap, format);
+ 724 51562554 : len = vsnprintf(dst, size, format, ap);
+ 725 51562554 : va_end(ap);
726 :
- 727 51564443 : if (len >= size) {
+ 727 51562554 : if (len >= size) {
728 : /* LCOV_EXCL_START */
729 : if (size > 0) {
730 : dst[size - 1] = 0;
@@ -797,7 +797,7 @@
735 : os_abort();
736 : /* LCOV_EXCL_STOP */
737 : }
- 738 51564443 : }
+ 738 51562554 : }
739 :
740 7693 : void pathslash(char* dst, size_t size)
741 : {
@@ -826,7 +826,7 @@
764 0 : dst[0] = 0;
765 100 : }
766 :
- 767 51890441 : int pathcmp(const char* a, const char* b)
+ 767 51888281 : int pathcmp(const char* a, const char* b)
768 : {
769 : #ifdef _WIN32
770 : char ai[PATH_MAX];
@@ -839,32 +839,32 @@
777 : /* case insensitive compare in Windows */
778 : return stricmp(ai, bi);
779 : #else
- 780 51890441 : return strcmp(a, b);
+ 780 51888281 : return strcmp(a, b);
781 : #endif
782 : }
783 :
784 : /****************************************************************************/
785 : /* file-system */
786 :
- 787 793086 : int mkancestor(const char* file)
+ 787 793097 : int mkancestor(const char* file)
788 : {
789 : char dir[PATH_MAX];
790 : struct stat st;
791 : char* c;
792 :
- 793 793086 : pathcpy(dir, sizeof(dir), file);
+ 793 793097 : pathcpy(dir, sizeof(dir), file);
794 :
- 795 793086 : c = strrchr(dir, '/');
- 796 793086 : if (!c) {
+ 795 793097 : c = strrchr(dir, '/');
+ 796 793097 : if (!c) {
797 : /* no ancestor */
798 0 : return 0;
799 : }
800 :
801 : /* clear the file */
- 802 793086 : *c = 0;
+ 802 793097 : *c = 0;
803 :
804 : /* if it's the root dir */
- 805 793086 : if (*dir == 0) {
+ 805 793097 : if (*dir == 0) {
806 : /* nothing more to do */
807 0 : return 0;
808 : }
@@ -887,9 +887,9 @@
825 : * Also in Windows it's better to use lstat() than stat() because it
826 : * doesn't need to open the dir with CreateFile().
827 : */
- 828 793086 : if (lstat(dir, &st) == 0) {
+ 828 793097 : if (lstat(dir, &st) == 0) {
829 : /* it already exists */
- 830 793006 : return 0;
+ 830 793017 : return 0;
831 : }
832 :
833 : /* recursively create them all */
@@ -910,7 +910,7 @@
848 80 : return 0;
849 : }
850 :
- 851 119588 : int fmtime(int f, int64_t mtime_sec, int mtime_nsec)
+ 851 119601 : int fmtime(int f, int64_t mtime_sec, int mtime_nsec)
852 : {
853 : #if HAVE_FUTIMENS
854 : struct timespec tv[2];
@@ -920,15 +920,15 @@
858 : int ret;
859 :
860 : #if HAVE_FUTIMENS /* futimens() is preferred because it gives nanosecond precision */
- 861 119588 : tv[0].tv_sec = mtime_sec;
- 862 119588 : if (mtime_nsec != STAT_NSEC_INVALID)
- 863 119588 : tv[0].tv_nsec = mtime_nsec;
+ 861 119601 : tv[0].tv_sec = mtime_sec;
+ 862 119601 : if (mtime_nsec != STAT_NSEC_INVALID)
+ 863 119601 : tv[0].tv_nsec = mtime_nsec;
864 : else
865 0 : tv[0].tv_nsec = 0;
- 866 119588 : tv[1].tv_sec = tv[0].tv_sec;
- 867 119588 : tv[1].tv_nsec = tv[0].tv_nsec;
+ 866 119601 : tv[1].tv_sec = tv[0].tv_sec;
+ 867 119601 : tv[1].tv_nsec = tv[0].tv_nsec;
868 :
- 869 119588 : ret = futimens(f, tv);
+ 869 119601 : ret = futimens(f, tv);
870 : #elif HAVE_FUTIMES /* fallback to futimes() if nanosecond precision is not available */
871 : tv[0].tv_sec = mtime_sec;
872 : if (mtime_nsec != STAT_NSEC_INVALID)
@@ -953,60 +953,60 @@
891 : #error No function available to set file timestamps with sub-second precision
892 : #endif
893 :
- 894 119588 : return ret;
+ 894 119601 : return ret;
895 : }
896 :
897 : /****************************************************************************/
898 : /* advise */
899 :
- 900 2495049 : void advise_init(struct advise_struct* advise, int mode)
+ 900 2494857 : void advise_init(struct advise_struct* advise, int mode)
901 : {
- 902 2495049 : advise->mode = mode;
- 903 2495049 : advise->dirty_begin = 0;
- 904 2495049 : advise->dirty_end = 0;
- 905 2495049 : }
+ 902 2494857 : advise->mode = mode;
+ 903 2494857 : advise->dirty_begin = 0;
+ 904 2494857 : advise->dirty_end = 0;
+ 905 2494857 : }
906 :
- 907 2495144 : int advise_flags(struct advise_struct* advise)
+ 907 2494931 : int advise_flags(struct advise_struct* advise)
908 : {
- 909 2495144 : int flags = 0;
+ 909 2494931 : int flags = 0;
910 :
- 911 2495144 : if (advise->mode == ADVISE_SEQUENTIAL
- 912 2483806 : || advise->mode == ADVISE_FLUSH
- 913 34019 : || advise->mode == ADVISE_FLUSH_WINDOW
- 914 22679 : || advise->mode == ADVISE_DISCARD
- 915 22680 : || advise->mode == ADVISE_DISCARD_WINDOW
+ 911 2494931 : if (advise->mode == ADVISE_SEQUENTIAL
+ 912 2483486 : || advise->mode == ADVISE_FLUSH
+ 913 34023 : || advise->mode == ADVISE_FLUSH_WINDOW
+ 914 22684 : || advise->mode == ADVISE_DISCARD
+ 915 22684 : || advise->mode == ADVISE_DISCARD_WINDOW
916 : )
- 917 2483805 : flags |= O_SEQUENTIAL;
+ 917 2483585 : flags |= O_SEQUENTIAL;
918 :
919 : #if HAVE_DIRECT_IO
- 920 2495144 : if (advise->mode == ADVISE_DIRECT)
+ 920 2494931 : if (advise->mode == ADVISE_DIRECT)
921 0 : flags |= O_DIRECT;
922 : #endif
923 :
- 924 2495144 : return flags;
+ 924 2494931 : return flags;
925 : }
926 :
- 927 2416674 : int advise_open(struct advise_struct* advise, int f)
+ 927 2416121 : int advise_open(struct advise_struct* advise, int f)
928 : {
929 : (void)advise;
930 : (void)f;
931 :
932 : #if HAVE_POSIX_FADVISE
- 933 2416674 : if (advise->mode == ADVISE_SEQUENTIAL
- 934 2405332 : || advise->mode == ADVISE_FLUSH
- 935 34023 : || advise->mode == ADVISE_FLUSH_WINDOW
- 936 22682 : || advise->mode == ADVISE_DISCARD
- 937 22683 : || advise->mode == ADVISE_DISCARD_WINDOW
+ 933 2416121 : if (advise->mode == ADVISE_SEQUENTIAL
+ 934 2404826 : || advise->mode == ADVISE_FLUSH
+ 935 34025 : || advise->mode == ADVISE_FLUSH_WINDOW
+ 936 22684 : || advise->mode == ADVISE_DISCARD
+ 937 22684 : || advise->mode == ADVISE_DISCARD_WINDOW
938 : ) {
939 : int ret;
940 :
941 : /* advise sequential access */
- 942 2405363 : ret = posix_fadvise(f, 0, 0, POSIX_FADV_SEQUENTIAL);
- 943 2405378 : if (ret == ENOSYS) {
+ 942 2404810 : ret = posix_fadvise(f, 0, 0, POSIX_FADV_SEQUENTIAL);
+ 943 2404853 : if (ret == ENOSYS) {
944 : /* call is not supported, like in armhf, see posix_fadvise manpage */
945 0 : ret = 0;
946 : }
- 947 2405378 : if (ret != 0) {
+ 947 2404853 : if (ret != 0) {
948 : /* LCOV_EXCL_START */
949 : errno = ret; /* posix_fadvise return the error code */
950 : return -1;
@@ -1015,10 +1015,10 @@
953 : }
954 : #endif
955 :
- 956 2416689 : return 0;
+ 956 2416164 : return 0;
957 : }
958 :
- 959 900515 : int advise_write(struct advise_struct* advise, int f, data_off_t offset, data_off_t size)
+ 959 900323 : int advise_write(struct advise_struct* advise, int f, data_off_t offset, data_off_t size)
960 : {
961 : data_off_t flush_offset;
962 : data_off_t flush_size;
@@ -1031,10 +1031,10 @@
969 : (void)discard_offset;
970 : (void)discard_size;
971 :
- 972 900515 : flush_offset = 0;
- 973 900515 : flush_size = 0;
- 974 900515 : discard_offset = 0;
- 975 900515 : discard_size = 0;
+ 972 900323 : flush_offset = 0;
+ 973 900323 : flush_size = 0;
+ 974 900323 : discard_offset = 0;
+ 975 900323 : discard_size = 0;
976 :
977 : /*
978 : * Follow Linus recommendations about fast writes.
@@ -1089,11 +1089,11 @@
1027 : * ---
1028 : */
1029 :
- 1030 900515 : switch (advise->mode) {
+ 1030 900323 : switch (advise->mode) {
1031 : case ADVISE_FLUSH :
- 1032 881768 : flush_offset = offset;
- 1033 881768 : flush_size = size;
- 1034 881768 : break;
+ 1032 881574 : flush_offset = offset;
+ 1033 881574 : flush_size = size;
+ 1034 881574 : break;
1035 : case ADVISE_DISCARD :
1036 0 : discard_offset = offset;
1037 0 : discard_size = size;
@@ -1155,12 +1155,12 @@
1093 : }
1094 :
1095 : #if HAVE_SYNC_FILE_RANGE
- 1096 900515 : if (flush_size != 0) {
+ 1096 900323 : if (flush_size != 0) {
1097 : int ret;
1098 :
1099 : /* start writing immediately */
- 1100 881771 : ret = sync_file_range(f, flush_offset, flush_size, SYNC_FILE_RANGE_WRITE);
- 1101 881771 : if (ret != 0) {
+ 1100 881575 : ret = sync_file_range(f, flush_offset, flush_size, SYNC_FILE_RANGE_WRITE);
+ 1101 881569 : if (ret != 0) {
1102 : /* LCOV_EXCL_START */
1103 : return -1;
1104 : /* LCOV_EXCL_STOP */
@@ -1169,7 +1169,7 @@
1107 : #endif
1108 :
1109 : #if HAVE_SYNC_FILE_RANGE && HAVE_POSIX_FADVISE
- 1110 900515 : if (discard_size != 0) {
+ 1110 900317 : if (discard_size != 0) {
1111 : int ret;
1112 :
1113 : /* send the data to the disk and wait until it's written */
@@ -1192,10 +1192,10 @@
1130 : }
1131 : #endif
1132 :
- 1133 900515 : return 0;
+ 1133 900317 : return 0;
1134 : }
1135 :
- 1136 8904745 : int advise_read(struct advise_struct* advise, int f, data_off_t offset, data_off_t size)
+ 1136 8903012 : int advise_read(struct advise_struct* advise, int f, data_off_t offset, data_off_t size)
1137 : {
1138 : (void)advise;
1139 : (void)f;
@@ -1203,15 +1203,15 @@
1141 : (void)size;
1142 :
1143 : #if HAVE_POSIX_FADVISE
- 1144 8904745 : if (advise->mode == ADVISE_DISCARD
- 1145 8904917 : || advise->mode == ADVISE_DISCARD_WINDOW
+ 1144 8903012 : if (advise->mode == ADVISE_DISCARD
+ 1145 8903128 : || advise->mode == ADVISE_DISCARD_WINDOW
1146 : ) {
1147 : int ret;
1148 :
1149 : /* flush the data from the cache */
- 1150 27639 : ret = posix_fadvise(f, offset, size, POSIX_FADV_DONTNEED);
+ 1150 27677 : ret = posix_fadvise(f, offset, size, POSIX_FADV_DONTNEED);
1151 : /* for POSIX_FADV_DONTNEED we don't allow failure with ENOSYS */
- 1152 27825 : if (ret != 0) {
+ 1152 27824 : if (ret != 0) {
1153 : /* LCOV_EXCL_START */
1154 : errno = ret; /* posix_fadvise return the error code */
1155 : return -1;
@@ -1258,7 +1258,7 @@
1196 : * ---
1197 : */
1198 :
- 1199 8904931 : return 0;
+ 1199 8903159 : return 0;
1200 : }
1201 :
1202 : /****************************************************************************/
@@ -1282,14 +1282,14 @@
1220 474 : return ret;
1221 : }
1222 :
- 1223 20175368 : void malloc_counter_inc(size_t inc)
+ 1223 20173645 : void malloc_counter_inc(size_t inc)
1224 : {
- 1225 20175368 : lock_memory();
+ 1225 20173645 : lock_memory();
1226 :
- 1227 20175368 : mcounter += inc;
+ 1227 20173645 : mcounter += inc;
1228 :
- 1229 20175368 : unlock_memory();
- 1230 20175368 : }
+ 1229 20173645 : unlock_memory();
+ 1230 20173645 : }
1231 :
1232 : /* LCOV_EXCL_START */
1233 : static ssize_t malloc_print(int f, const char* str)
@@ -1341,11 +1341,11 @@
1279 : }
1280 : /* LCOV_EXCL_STOP */
1281 :
- 1282 14365336 : void* malloc_nofail(size_t size)
+ 1282 14364256 : void* malloc_nofail(size_t size)
1283 : {
- 1284 14365336 : void* ptr = malloc(size);
+ 1284 14364256 : void* ptr = malloc(size);
1285 :
- 1286 14365336 : if (!ptr) {
+ 1286 14364256 : if (!ptr) {
1287 : /* LCOV_EXCL_START */
1288 : malloc_fail(size);
1289 : exit(EXIT_FAILURE);
@@ -1359,12 +1359,12 @@
1297 : /* Filling the memory doesn't ensure to disable OOM, but it increase a lot the chances to */
1298 : /* get a real error from malloc() instead than a process killed. */
1299 : /* Note that calloc() doesn't have the same effect. */
- 1300 14365336 : memset(ptr, 0xA5, size);
+ 1300 14364256 : memset(ptr, 0xA5, size);
1301 : #endif
1302 :
- 1303 14365336 : malloc_counter_inc(size);
+ 1303 14364256 : malloc_counter_inc(size);
1304 :
- 1305 14365336 : return ptr;
+ 1305 14364256 : return ptr;
1306 : }
1307 :
1308 10017 : void* calloc_nofail(size_t count, size_t size)
@@ -1390,27 +1390,27 @@
1328 10017 : return ptr;
1329 : }
1330 :
- 1331 5800015 : char* strdup_nofail(const char* str)
+ 1331 5799372 : char* strdup_nofail(const char* str)
1332 : {
1333 : size_t size;
1334 : char* ptr;
1335 :
- 1336 5800015 : size = strlen(str) + 1;
+ 1336 5799372 : size = strlen(str) + 1;
1337 :
- 1338 5800015 : ptr = malloc(size);
+ 1338 5799372 : ptr = malloc(size);
1339 :
- 1340 5800015 : if (!ptr) {
+ 1340 5799372 : if (!ptr) {
1341 : /* LCOV_EXCL_START */
1342 : malloc_fail(size);
1343 : exit(EXIT_FAILURE);
1344 : /* LCOV_EXCL_STOP */
1345 : }
1346 :
- 1347 5800015 : memcpy(ptr, str, size);
+ 1347 5799372 : memcpy(ptr, str, size);
1348 :
- 1349 5800015 : malloc_counter_inc(size);
+ 1349 5799372 : malloc_counter_inc(size);
1350 :
- 1351 5800015 : return ptr;
+ 1351 5799372 : return ptr;
1352 : }
1353 :
1354 : /****************************************************************************/
@@ -1552,95 +1552,95 @@
1490 : /* thread */
1491 :
1492 : #if HAVE_PTHREAD
- 1493 2263 : void thread_mutex_init(pthread_mutex_t* mutex, pthread_mutexattr_t* attr)
+ 1493 2268 : void thread_mutex_init(pthread_mutex_t* mutex, pthread_mutexattr_t* attr)
1494 : {
- 1495 2263 : if (pthread_mutex_init(mutex, attr) != 0) {
+ 1495 2268 : if (pthread_mutex_init(mutex, attr) != 0) {
1496 : /* LCOV_EXCL_START */
1497 : log_fatal("Failed call to pthread_mutex_init().\n");
1498 : os_abort();
1499 : /* LCOV_EXCL_STOP */
1500 : }
- 1501 2263 : }
+ 1501 2268 : }
1502 :
- 1503 2075 : void thread_mutex_destroy(pthread_mutex_t* mutex)
+ 1503 2074 : void thread_mutex_destroy(pthread_mutex_t* mutex)
1504 : {
- 1505 2075 : if (pthread_mutex_destroy(mutex) != 0) {
+ 1505 2074 : if (pthread_mutex_destroy(mutex) != 0) {
1506 : /* LCOV_EXCL_START */
1507 : log_fatal("Failed call to pthread_mutex_destroy().\n");
1508 : os_abort();
1509 : /* LCOV_EXCL_STOP */
1510 : }
- 1511 2075 : }
+ 1511 2074 : }
1512 :
- 1513 80931472 : void thread_mutex_lock(pthread_mutex_t* mutex)
+ 1513 80853291 : void thread_mutex_lock(pthread_mutex_t* mutex)
1514 : {
- 1515 80931472 : if (pthread_mutex_lock(mutex) != 0) {
+ 1515 80853291 : if (pthread_mutex_lock(mutex) != 0) {
1516 : /* LCOV_EXCL_START */
1517 : log_fatal("Failed call to pthread_mutex_lock().\n");
1518 : os_abort();
1519 : /* LCOV_EXCL_STOP */
1520 : }
- 1521 80938570 : }
+ 1521 80859260 : }
1522 :
- 1523 80937280 : void thread_mutex_unlock(pthread_mutex_t* mutex)
+ 1523 80857847 : void thread_mutex_unlock(pthread_mutex_t* mutex)
1524 : {
- 1525 80937280 : if (pthread_mutex_unlock(mutex) != 0) {
+ 1525 80857847 : if (pthread_mutex_unlock(mutex) != 0) {
1526 : /* LCOV_EXCL_START */
1527 : log_fatal("Failed call to pthread_mutex_unlock().\n");
1528 : os_abort();
1529 : /* LCOV_EXCL_STOP */
1530 : }
- 1531 80939786 : }
+ 1531 80860763 : }
1532 :
- 1533 384 : void thread_cond_init(pthread_cond_t* cond, pthread_condattr_t* attr)
+ 1533 380 : void thread_cond_init(pthread_cond_t* cond, pthread_condattr_t* attr)
1534 : {
- 1535 384 : if (pthread_cond_init(cond, attr) != 0) {
+ 1535 380 : if (pthread_cond_init(cond, attr) != 0) {
1536 : /* LCOV_EXCL_START */
1537 : log_fatal("Failed call to pthread_cond_init().\n");
1538 : os_abort();
1539 : /* LCOV_EXCL_STOP */
1540 : }
- 1541 384 : }
+ 1541 380 : }
1542 :
- 1543 384 : void thread_cond_destroy(pthread_cond_t* cond)
+ 1543 380 : void thread_cond_destroy(pthread_cond_t* cond)
1544 : {
- 1545 384 : if (pthread_cond_destroy(cond) != 0) {
+ 1545 380 : if (pthread_cond_destroy(cond) != 0) {
1546 : /* LCOV_EXCL_START */
1547 : log_fatal("Failed call to pthread_cond_destroy().\n");
1548 : os_abort();
1549 : /* LCOV_EXCL_STOP */
1550 : }
- 1551 384 : }
+ 1551 380 : }
1552 :
- 1553 87252 : void thread_cond_signal(pthread_cond_t* cond)
+ 1553 84548 : void thread_cond_signal(pthread_cond_t* cond)
1554 : {
- 1555 87252 : if (pthread_cond_signal(cond) != 0) {
+ 1555 84548 : if (pthread_cond_signal(cond) != 0) {
1556 : /* LCOV_EXCL_START */
1557 : log_fatal("Failed call to pthread_cond_signal().\n");
1558 : os_abort();
1559 : /* LCOV_EXCL_STOP */
1560 : }
- 1561 87252 : }
+ 1561 84548 : }
1562 :
- 1563 265024 : void thread_cond_broadcast(pthread_cond_t* cond)
+ 1563 255449 : void thread_cond_broadcast(pthread_cond_t* cond)
1564 : {
- 1565 265024 : if (pthread_cond_broadcast(cond) != 0) {
+ 1565 255449 : if (pthread_cond_broadcast(cond) != 0) {
1566 : /* LCOV_EXCL_START */
1567 : log_fatal("Failed call to pthread_cond_broadcast().\n");
1568 : os_abort();
1569 : /* LCOV_EXCL_STOP */
1570 : }
- 1571 265024 : }
+ 1571 255449 : }
1572 :
- 1573 1125861 : void thread_cond_wait(pthread_cond_t* cond, pthread_mutex_t* mutex)
+ 1573 1095193 : void thread_cond_wait(pthread_cond_t* cond, pthread_mutex_t* mutex)
1574 : {
- 1575 1125861 : if (pthread_cond_wait(cond, mutex) != 0) {
+ 1575 1095193 : if (pthread_cond_wait(cond, mutex) != 0) {
1576 : /* LCOV_EXCL_START */
1577 : log_fatal("Failed call to pthread_cond_wait().\n");
1578 : os_abort();
1579 : /* LCOV_EXCL_STOP */
1580 : }
- 1581 1125861 : }
+ 1581 1095193 : }
1582 :
1583 : /**
1584 : * Implementation note about conditional variables.
@@ -1671,59 +1671,59 @@
1609 : */
1610 : int thread_cond_signal_outside = 0;
1611 :
- 1612 87252 : void thread_cond_signal_and_unlock(pthread_cond_t* cond, pthread_mutex_t* mutex)
+ 1612 84548 : void thread_cond_signal_and_unlock(pthread_cond_t* cond, pthread_mutex_t* mutex)
1613 : {
- 1614 87252 : if (thread_cond_signal_outside) {
+ 1614 84548 : if (thread_cond_signal_outside) {
1615 : /* without the thread checker unlock before signaling, */
1616 : /* this reduces the number of context switches */
1617 0 : thread_mutex_unlock(mutex);
1618 : }
1619 :
- 1620 87252 : thread_cond_signal(cond);
+ 1620 84548 : thread_cond_signal(cond);
1621 :
- 1622 87252 : if (!thread_cond_signal_outside) {
+ 1622 84548 : if (!thread_cond_signal_outside) {
1623 : /* with the thread checker unlock after signaling */
1624 : /* to make explicit the condition and mutex relation */
- 1625 87252 : thread_mutex_unlock(mutex);
+ 1625 84548 : thread_mutex_unlock(mutex);
1626 : }
- 1627 87252 : }
+ 1627 84548 : }
1628 :
- 1629 264832 : void thread_cond_broadcast_and_unlock(pthread_cond_t* cond, pthread_mutex_t* mutex)
+ 1629 255259 : void thread_cond_broadcast_and_unlock(pthread_cond_t* cond, pthread_mutex_t* mutex)
1630 : {
- 1631 264832 : if (thread_cond_signal_outside) {
+ 1631 255259 : if (thread_cond_signal_outside) {
1632 : /* without the thread checker unlock before signaling, */
1633 : /* this reduces the number of context switches */
1634 0 : thread_mutex_unlock(mutex);
1635 : }
1636 :
- 1637 264832 : thread_cond_broadcast(cond);
+ 1637 255259 : thread_cond_broadcast(cond);
1638 :
- 1639 264832 : if (!thread_cond_signal_outside) {
+ 1639 255259 : if (!thread_cond_signal_outside) {
1640 : /* with the thread checker unlock after signaling */
1641 : /* to make explicit the condition and mutex relation */
- 1642 264832 : thread_mutex_unlock(mutex);
+ 1642 255259 : thread_mutex_unlock(mutex);
1643 : }
- 1644 264832 : }
+ 1644 255259 : }
1645 :
- 1646 2207 : void thread_create(pthread_t* thread, pthread_attr_t* attr, void *(* func)(void *), void *arg)
+ 1646 2200 : void thread_create(pthread_t* thread, pthread_attr_t* attr, void *(* func)(void *), void *arg)
1647 : {
- 1648 2207 : if (pthread_create(thread, attr, func, arg) != 0) {
+ 1648 2200 : if (pthread_create(thread, attr, func, arg) != 0) {
1649 : /* LCOV_EXCL_START */
1650 : log_fatal("Failed call to pthread_create().\n");
1651 : os_abort();
1652 : /* LCOV_EXCL_STOP */
1653 : }
- 1654 2207 : }
+ 1654 2200 : }
1655 :
- 1656 2207 : void thread_join(pthread_t thread, void** retval)
+ 1656 2200 : void thread_join(pthread_t thread, void** retval)
1657 : {
- 1658 2207 : if (pthread_join(thread, retval) != 0) {
+ 1658 2200 : if (pthread_join(thread, retval) != 0) {
1659 : /* LCOV_EXCL_START */
1660 : log_fatal("Failed call to pthread_join().\n");
1661 : os_abort();
1662 : /* LCOV_EXCL_STOP */
1663 : }
- 1664 2207 : }
+ 1664 2200 : }
1665 :
1666 : #endif
1667 :
diff --git a/cov/cmdline/support.h.func-sort-c.html b/cov/cmdline/support.h.func-sort-c.html
index dab51d97..67aa7b3e 100644
--- a/cov/cmdline/support.h.func-sort-c.html
+++ b/cov/cmdline/support.h.func-sort-c.html
@@ -61,7 +61,7 @@
| esc_shell |
- 331733 |
+ 331952 |
diff --git a/cov/cmdline/support.h.func.html b/cov/cmdline/support.h.func.html
index 61b77cae..c53895e0 100644
--- a/cov/cmdline/support.h.func.html
+++ b/cov/cmdline/support.h.func.html
@@ -61,7 +61,7 @@
| esc_shell |
- 331733 |
+ 331952 |
diff --git a/cov/cmdline/support.h.gcov.html b/cov/cmdline/support.h.gcov.html
index 781f95a8..ba314b1d 100644
--- a/cov/cmdline/support.h.gcov.html
+++ b/cov/cmdline/support.h.gcov.html
@@ -291,9 +291,9 @@
229 : * \param buffer Preallocated buffer of ESC_MAX size.
230 : */
231 : const char* esc_shell_multi(const char** str_map, unsigned str_max, char* buffer);
- 232 331733 : static inline const char* esc_shell(const char* str, char* buffer)
+ 232 331952 : static inline const char* esc_shell(const char* str, char* buffer)
233 : {
- 234 331733 : return esc_shell_multi(&str, 1, buffer);
+ 234 331952 : return esc_shell_multi(&str, 1, buffer);
235 : }
236 :
237 : /**
diff --git a/cov/cmdline/sync.c.func-sort-c.html b/cov/cmdline/sync.c.func-sort-c.html
index 8a065cd7..acebb02b 100644
--- a/cov/cmdline/sync.c.func-sort-c.html
+++ b/cov/cmdline/sync.c.func-sort-c.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -65,11 +65,11 @@
| sync_data_reader |
- 688722 |
+ 688117 |
| sync_parity_writer |
- 544684 |
+ 544283 |
| failed_compare_by_index |
diff --git a/cov/cmdline/sync.c.func.html b/cov/cmdline/sync.c.func.html
index 42bfb613..be0b406f 100644
--- a/cov/cmdline/sync.c.func.html
+++ b/cov/cmdline/sync.c.func.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -81,11 +81,11 @@
| sync_data_reader |
- 688722 |
+ 688117 |
| sync_parity_writer |
- 544684 |
+ 544283 |
diff --git a/cov/cmdline/sync.c.gcov.html b/cov/cmdline/sync.c.gcov.html
index e0f74176..e35cac7e 100644
--- a/cov/cmdline/sync.c.gcov.html
+++ b/cov/cmdline/sync.c.gcov.html
@@ -31,9 +31,9 @@
|
-
+
-
+
@@ -524,56 +524,56 @@
462 4688742 : one_valid = 1;
463 :
464 4911646 : if (block_has_invalid_parity(block) || plan->force_full)
- 465 753400 : one_invalid = 1;
+ 465 753140 : one_invalid = 1;
466 : }
467 :
468 : /* if none valid or none invalid, we don't need to update */
469 820170 : if (!one_invalid || !one_valid)
- 470 590568 : return 0;
+ 470 590766 : return 0;
471 :
- 472 229602 : return 1;
+ 472 229404 : return 1;
473 : }
474 :
- 475 688722 : static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_task* task)
+ 475 688117 : static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_task* task)
476 : {
- 477 688722 : struct snapraid_io* io = worker->io;
- 478 688722 : struct snapraid_state* state = io->state;
- 479 688722 : struct snapraid_handle* handle = worker->handle;
- 480 688722 : struct snapraid_disk* disk = handle->disk;
- 481 688722 : block_off_t blockcur = task->position;
- 482 688722 : unsigned char* buffer = task->buffer;
+ 477 688117 : struct snapraid_io* io = worker->io;
+ 478 688117 : struct snapraid_state* state = io->state;
+ 479 688117 : struct snapraid_handle* handle = worker->handle;
+ 480 688117 : struct snapraid_disk* disk = handle->disk;
+ 481 688117 : block_off_t blockcur = task->position;
+ 482 688117 : unsigned char* buffer = task->buffer;
483 : int ret;
484 : char esc_buffer[ESC_MAX];
485 :
486 : /* if the disk position is not used */
- 487 688722 : if (!disk) {
+ 487 688117 : if (!disk) {
488 : /* use an empty block */
- 489 0 : memset(buffer, 0, state->block_size);
- 490 0 : task->state = TASK_STATE_DONE;
- 491 92200 : return;
+ 489 1 : memset(buffer, 0, state->block_size);
+ 490 1 : task->state = TASK_STATE_DONE;
+ 491 92173 : return;
492 : }
493 :
494 : /* get the block */
- 495 688725 : task->block = fs_par2block_find(disk, blockcur);
+ 495 688116 : task->block = fs_par2block_find(disk, blockcur);
496 :
497 : /* if the block has no file, meaning that it's EMPTY or DELETED, */
498 : /* it doesn't participate in the new parity computation */
- 499 688673 : if (!block_has_file(task->block)) {
+ 499 688081 : if (!block_has_file(task->block)) {
500 : /* use an empty block */
- 501 92188 : memset(buffer, 0, state->block_size);
- 502 92188 : task->state = TASK_STATE_DONE;
- 503 92188 : return;
+ 501 92153 : memset(buffer, 0, state->block_size);
+ 502 92153 : task->state = TASK_STATE_DONE;
+ 503 92153 : return;
504 : }
505 :
506 : /* get the file of this block */
- 507 596459 : task->file = fs_par2file_get(disk, blockcur, &task->file_pos);
+ 507 595895 : task->file = fs_par2file_get(disk, blockcur, &task->file_pos);
508 :
509 : /* if the file is different than the current one, close it */
- 510 596533 : if (handle->file != 0 && handle->file != task->file) {
+ 510 595951 : if (handle->file != 0 && handle->file != task->file) {
511 : /* keep a pointer at the file we are going to close for error reporting */
- 512 246230 : struct snapraid_file* report = handle->file;
- 513 246230 : ret = handle_close(handle);
- 514 246161 : if (ret == -1) {
+ 512 245994 : struct snapraid_file* report = handle->file;
+ 513 245994 : ret = handle_close(handle);
+ 514 245950 : if (ret == -1) {
515 : /* LCOV_EXCL_START */
516 : /* This one is really an unexpected error, because we are only reading */
517 : /* and closing a descriptor should never fail */
@@ -596,8 +596,8 @@
534 : }
535 : }
536 :
- 537 596464 : ret = handle_open(handle, task->file, state->file_mode, log_error, 0);
- 538 596411 : if (ret == -1) {
+ 537 595907 : ret = handle_open(handle, task->file, state->file_mode, log_error, 0);
+ 538 595847 : if (ret == -1) {
539 12 : if (errno == EIO) {
540 : /* LCOV_EXCL_START */
541 : log_tag("error:%u:%s:%s: Open EIO error. %s\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer), strerror(errno));
@@ -641,12 +641,12 @@
579 : }
580 :
581 : /* check if the file is changed */
- 582 596399 : if (handle->st.st_size != task->file->size
- 583 596450 : || handle->st.st_mtime != task->file->mtime_sec
- 584 596448 : || STAT_NSEC(&handle->st) != task->file->mtime_nsec
- 585 596442 : || handle->st.st_ino != task->file->inode
+ 582 595835 : if (handle->st.st_size != task->file->size
+ 583 595862 : || handle->st.st_mtime != task->file->mtime_sec
+ 584 595897 : || STAT_NSEC(&handle->st) != task->file->mtime_nsec
+ 585 595892 : || handle->st.st_ino != task->file->inode
586 : ) {
- 587 61 : log_tag("error:%u:%s:%s: Unexpected attribute change\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer));
+ 587 66 : log_tag("error:%u:%s:%s: Unexpected attribute change\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer));
588 6 : if (handle->st.st_size != task->file->size) {
589 2 : log_error("Unexpected size change at file '%s' from %" PRIu64 " to %" PRIu64 ".\n", handle->path, task->file->size, handle->st.st_size);
590 4 : } else if (handle->st.st_mtime != task->file->mtime_sec
@@ -663,8 +663,8 @@
601 6 : return;
602 : }
603 :
- 604 596338 : task->read_size = handle_read(handle, task->file_pos, buffer, state->block_size, log_error, 0);
- 605 596044 : if (task->read_size == -1) {
+ 604 595769 : task->read_size = handle_read(handle, task->file_pos, buffer, state->block_size, log_error, 0);
+ 605 595561 : if (task->read_size == -1) {
606 : /* LCOV_EXCL_START */
607 : if (errno == EIO) {
608 : log_tag("error:%u:%s:%s: Read EIO error at position %u. %s\n", blockcur, disk->name, esc_tag(task->file->sub, esc_buffer), task->file_pos, strerror(errno));
@@ -683,24 +683,24 @@
621 : }
622 :
623 : /* store the path of the opened file */
- 624 596044 : pathcpy(task->path, sizeof(task->path), handle->path);
+ 624 595561 : pathcpy(task->path, sizeof(task->path), handle->path);
625 :
- 626 596345 : task->state = TASK_STATE_DONE;
+ 626 595834 : task->state = TASK_STATE_DONE;
627 : }
628 :
- 629 544684 : static void sync_parity_writer(struct snapraid_worker* worker, struct snapraid_task* task)
+ 629 544283 : static void sync_parity_writer(struct snapraid_worker* worker, struct snapraid_task* task)
630 : {
- 631 544684 : struct snapraid_io* io = worker->io;
- 632 544684 : struct snapraid_state* state = io->state;
- 633 544684 : struct snapraid_parity_handle* parity_handle = worker->parity_handle;
- 634 544684 : unsigned level = parity_handle->level;
- 635 544684 : block_off_t blockcur = task->position;
- 636 544684 : unsigned char* buffer = task->buffer;
+ 631 544283 : struct snapraid_io* io = worker->io;
+ 632 544283 : struct snapraid_state* state = io->state;
+ 633 544283 : struct snapraid_parity_handle* parity_handle = worker->parity_handle;
+ 634 544283 : unsigned level = parity_handle->level;
+ 635 544283 : block_off_t blockcur = task->position;
+ 636 544283 : unsigned char* buffer = task->buffer;
637 : int ret;
638 :
639 : /* write parity */
- 640 544684 : ret = parity_write(parity_handle, blockcur, buffer, state->block_size);
- 641 544678 : if (ret == -1) {
+ 640 544283 : ret = parity_write(parity_handle, blockcur, buffer, state->block_size);
+ 641 544291 : if (ret == -1) {
642 : /* LCOV_EXCL_START */
643 : if (errno == EIO) {
644 : log_tag("parity_error:%u:%s: Write EIO error. %s\n", blockcur, lev_config_name(level), strerror(errno));
@@ -718,7 +718,7 @@
656 : /* LCOV_EXCL_STOP */
657 : }
658 :
- 659 544678 : task->state = TASK_STATE_DONE;
+ 659 544291 : task->state = TASK_STATE_DONE;
660 : }
661 :
662 83 : static int state_sync_process(struct snapraid_state* state, struct snapraid_parity_handle* parity_handle, block_off_t blockstart, block_off_t blockmax)
@@ -799,8 +799,8 @@
737 83 : plan.force_full = state->opt.force_full;
738 410168 : for (blockcur = blockstart; blockcur < blockmax; ++blockcur) {
739 410085 : if (!block_is_enabled(&plan, blockcur))
- 740 295284 : continue;
- 741 114801 : ++countmax;
+ 740 295383 : continue;
+ 741 114702 : ++countmax;
742 : }
743 :
744 : /* compute the autosave size for all disk, even if not read */
@@ -836,31 +836,31 @@
774 : int writer_error[IO_WRITER_ERROR_MAX];
775 :
776 : /* go to the next block */
- 777 114884 : blockcur = io_read_next(&io, &buffer);
- 778 114884 : if (blockcur >= blockmax)
+ 777 114785 : blockcur = io_read_next(&io, &buffer);
+ 778 114785 : if (blockcur >= blockmax)
779 166 : break;
780 :
781 : /* until now is scheduling */
- 782 114801 : state_usage_sched(state);
+ 782 114702 : state_usage_sched(state);
783 :
784 : /* one more block processed for autosave */
- 785 114801 : ++autosavedone;
- 786 114801 : --autosavemissing;
+ 785 114702 : ++autosavedone;
+ 786 114702 : --autosavemissing;
787 :
788 : /* by default process the block, and skip it if something goes wrong */
- 789 114801 : error_on_this_block = 0;
- 790 114801 : silent_error_on_this_block = 0;
- 791 114801 : io_error_on_this_block = 0;
- 792 114801 : fixed_error_on_this_block = 0;
+ 789 114702 : error_on_this_block = 0;
+ 790 114702 : silent_error_on_this_block = 0;
+ 791 114702 : io_error_on_this_block = 0;
+ 792 114702 : fixed_error_on_this_block = 0;
793 :
794 : /* keep track of the number of failed blocks */
- 795 114801 : failed_count = 0;
+ 795 114702 : failed_count = 0;
796 :
797 : /* get block specific info */
- 798 114801 : info = info_get(&state->infoarr, blockcur);
+ 798 114702 : info = info_get(&state->infoarr, blockcur);
799 :
800 : /* if we have to use the old hash */
- 801 114801 : rehash = info_get_rehash(info);
+ 801 114702 : rehash = info_get_rehash(info);
802 :
803 : /* if the parity requires to be updated */
804 : /* It could happens that all the blocks are EMPTY/BLK and CHG but with the hash */
@@ -869,18 +869,18 @@
807 : /* Note that CHG/DELETED blocks already present in the content file loaded */
808 : /* have the hash cleared (::clear_past_hash flag), and then they won't never match the hash. */
809 : /* We are treating only CHG blocks created at runtime. */
- 810 114801 : parity_needs_to_be_updated = state->opt.force_full || state->opt.force_parity_update;
+ 810 114702 : parity_needs_to_be_updated = state->opt.force_full || state->opt.force_parity_update;
811 :
812 : /* if the parity is going to be updated */
- 813 114801 : parity_going_to_be_updated = 0;
+ 813 114702 : parity_going_to_be_updated = 0;
814 :
815 : /* if the block is marked as bad, we force the parity update */
816 : /* because the bad block may be the result of a wrong parity */
- 817 114801 : if (info_get_bad(info))
+ 817 114702 : if (info_get_bad(info))
818 0 : parity_needs_to_be_updated = 1;
819 :
820 : /* for each disk, process the block */
- 821 803607 : for (j = 0; j < diskmax; ++j) {
+ 821 802914 : for (j = 0; j < diskmax; ++j) {
822 : struct snapraid_task* task;
823 : int read_size;
824 : unsigned char hash[HASH_MAX];
@@ -892,45 +892,45 @@
830 : unsigned diskcur;
831 :
832 : /* until now is misc */
- 833 688806 : state_usage_misc(state);
+ 833 688212 : state_usage_misc(state);
834 :
- 835 688806 : task = io_data_read(&io, &diskcur, waiting_map, &waiting_mac);
+ 835 688212 : task = io_data_read(&io, &diskcur, waiting_map, &waiting_mac);
836 :
837 : /* until now is disk */
- 838 688806 : state_usage_disk(state, handle, waiting_map, waiting_mac);
+ 838 688212 : state_usage_disk(state, handle, waiting_map, waiting_mac);
839 :
840 : /* get the results */
- 841 688806 : disk = task->disk;
- 842 688806 : block = task->block;
- 843 688806 : file = task->file;
- 844 688806 : file_pos = task->file_pos;
- 845 688806 : read_size = task->read_size;
+ 841 688212 : disk = task->disk;
+ 842 688212 : block = task->block;
+ 843 688212 : file = task->file;
+ 844 688212 : file_pos = task->file_pos;
+ 845 688212 : read_size = task->read_size;
846 :
847 : /* by default no rehash in case of "continue" */
- 848 688806 : rehandle[diskcur].block = 0;
+ 848 688212 : rehandle[diskcur].block = 0;
849 :
850 : /* if the disk position is not used */
- 851 688806 : if (!disk)
- 852 93087 : continue;
+ 851 688212 : if (!disk)
+ 852 93057 : continue;
853 :
854 : /* get the state of the block */
- 855 688806 : block_state = block_state_get(block);
+ 855 688212 : block_state = block_state_get(block);
856 :
857 : /* if the block has invalid parity, */
858 : /* we have to take care of it in case of recover */
- 859 688806 : if (block_has_invalid_parity(block)) {
+ 859 688212 : if (block_has_invalid_parity(block)) {
860 : /* store it in the failed set, because */
861 : /* the parity may be still computed with the previous content */
- 862 182902 : failed[failed_count].index = diskcur;
- 863 182902 : failed[failed_count].size = state->block_size;
- 864 182902 : failed[failed_count].block = block;
- 865 182902 : ++failed_count;
+ 862 182772 : failed[failed_count].index = diskcur;
+ 863 182772 : failed[failed_count].size = state->block_size;
+ 864 182772 : failed[failed_count].block = block;
+ 865 182772 : ++failed_count;
866 :
867 : /* if the block has invalid parity, we have to update the parity */
868 : /* to include this block change */
869 : /* This also apply to CHG blocks, but we are going to handle */
870 : /* later this case to do the updates only if really needed */
- 871 182902 : if (block_state != BLOCK_STATE_CHG)
+ 871 182772 : if (block_state != BLOCK_STATE_CHG)
872 88225 : parity_needs_to_be_updated = 1;
873 :
874 : /* note that DELETE blocks are skipped in the next check */
@@ -941,24 +941,24 @@
879 : }
880 :
881 : /* if the block is not used */
- 882 688806 : if (!block_has_file(block))
- 883 92216 : continue;
+ 882 688212 : if (!block_has_file(block))
+ 883 92186 : continue;
884 :
885 : /* handle error conditions */
- 886 596590 : if (task->state == TASK_STATE_IOERROR) {
+ 886 596026 : if (task->state == TASK_STATE_IOERROR) {
887 0 : ++io_error;
888 0 : goto bail;
889 : }
- 890 596590 : if (task->state == TASK_STATE_ERROR) {
+ 890 596026 : if (task->state == TASK_STATE_ERROR) {
891 0 : ++error;
892 0 : goto bail;
893 : }
- 894 596590 : if (task->state == TASK_STATE_ERROR_CONTINUE) {
+ 894 596026 : if (task->state == TASK_STATE_ERROR_CONTINUE) {
895 18 : ++error;
896 18 : error_on_this_block = 1;
897 18 : continue;
898 : }
- 899 596572 : if (task->state == TASK_STATE_IOERROR_CONTINUE) {
+ 899 596008 : if (task->state == TASK_STATE_IOERROR_CONTINUE) {
900 0 : ++io_error;
901 0 : if (io_error >= state->opt.io_error_limit) {
902 0 : log_fatal("DANGER! Unexpected input/output read error in a data disk, it isn't possible to sync.\n");
@@ -971,32 +971,32 @@
909 0 : io_error_on_this_block = 1;
910 0 : continue;
911 : }
- 912 596572 : if (task->state != TASK_STATE_DONE) {
+ 912 596008 : if (task->state != TASK_STATE_DONE) {
913 : /* LCOV_EXCL_START */
914 : log_fatal("Internal inconsistency in task state\n");
915 : os_abort();
916 : /* LCOV_EXCL_STOP */
917 : }
918 :
- 919 596572 : countsize += read_size;
+ 919 596008 : countsize += read_size;
920 :
921 : /* now compute the hash */
- 922 596572 : if (rehash) {
+ 922 596008 : if (rehash) {
923 27243 : memhash(state->prevhash, state->prevhashseed, hash, buffer[diskcur], read_size);
924 :
925 : /* compute the new hash, and store it */
926 27243 : rehandle[diskcur].block = block;
927 27243 : memhash(state->hash, state->hashseed, rehandle[diskcur].hash, buffer[diskcur], read_size);
928 : } else {
- 929 569329 : memhash(state->hash, state->hashseed, hash, buffer[diskcur], read_size);
+ 929 568765 : memhash(state->hash, state->hashseed, hash, buffer[diskcur], read_size);
930 : }
931 :
932 : /* until now is hash */
- 933 596572 : state_usage_hash(state);
+ 933 596008 : state_usage_hash(state);
934 :
- 935 596572 : if (block_has_updated_hash(block)) {
+ 935 596008 : if (block_has_updated_hash(block)) {
936 : /* compare the hash */
- 937 501913 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
+ 937 501479 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
938 : /* if the file has invalid parity, it's a REP changed during the sync */
939 853 : if (block_has_invalid_parity(block)) {
940 1 : log_tag("error:%u:%s:%s: Unexpected data change\n", blockcur, disk->name, esc_tag(file->sub, esc_buffer));
@@ -1039,28 +1039,28 @@
977 : }
978 : } else {
979 : /* if until now the parity doesn't need to be updated */
- 980 94659 : if (!parity_needs_to_be_updated) {
+ 980 94529 : if (!parity_needs_to_be_updated) {
981 : /* for sure it's a CHG block, because EMPTY are processed before with "continue" */
982 : /* and BLK and REP have "block_has_updated_hash()" as 1, and all the others */
983 : /* have "parity_needs_to_be_updated" already at 1 */
- 984 35282 : assert(block_state_get(block) == BLOCK_STATE_CHG);
+ 984 35175 : assert(block_state_get(block) == BLOCK_STATE_CHG);
985 :
986 : /* if the hash represents the data unequivocally */
- 987 35282 : if (hash_is_unique(block->hash)) {
+ 987 35175 : if (hash_is_unique(block->hash)) {
988 : /* check if the hash is changed */
- 989 8608 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
+ 989 8502 : if (memcmp(hash, block->hash, BLOCK_HASH_SIZE) != 0) {
990 : /* the block is different, and we must update parity */
- 991 6067 : parity_needs_to_be_updated = 1;
+ 991 6003 : parity_needs_to_be_updated = 1;
992 : }
993 : } else {
994 : /* if the hash is already invalid, we update parity */
- 995 26674 : parity_needs_to_be_updated = 1;
+ 995 26673 : parity_needs_to_be_updated = 1;
996 : }
997 : }
998 :
999 : /* copy the hash in the block, but doesn't mark the block as hashed */
1000 : /* this allow in case of skipped block to do not save the failed computation */
- 1001 94659 : memcpy(block->hash, hash, BLOCK_HASH_SIZE);
+ 1001 94529 : memcpy(block->hash, hash, BLOCK_HASH_SIZE);
1002 :
1003 : /* note that in case of rehash, this is the wrong hash, */
1004 : /* but it will be overwritten later */
@@ -1070,7 +1070,7 @@
1008 : /* if we have only silent errors we can try to fix them on-the-fly */
1009 : /* note the the fix is not written to disk, but used only to */
1010 : /* compute the new parity */
- 1011 114801 : if (!error_on_this_block && !io_error_on_this_block && silent_error_on_this_block) {
+ 1011 114702 : if (!error_on_this_block && !io_error_on_this_block && silent_error_on_this_block) {
1012 : unsigned failed_mac;
1013 852 : int something_to_recover = 0;
1014 :
@@ -1190,7 +1190,7 @@
1128 :
1129 : /* pad with 0 if needed */
1130 852 : if (size < state->block_size)
- 1131 342 : memset(block_buffer + size, 0, state->block_size - size);
+ 1131 349 : memset(block_buffer + size, 0, state->block_size - size);
1132 : } else {
1133 : /* otherwise restore the content */
1134 : /* because we are not interested in the old state */
@@ -1207,44 +1207,44 @@
1145 : }
1146 :
1147 : /* if we have read all the data required and it's correct, proceed with the parity */
- 1148 114801 : if (!error_on_this_block && !io_error_on_this_block
- 1149 114782 : && (!silent_error_on_this_block || fixed_error_on_this_block)
+ 1148 114702 : if (!error_on_this_block && !io_error_on_this_block
+ 1149 114683 : && (!silent_error_on_this_block || fixed_error_on_this_block)
1150 : ) {
1151 : /* update the parity only if really needed */
- 1152 114782 : if (parity_needs_to_be_updated) {
+ 1152 114683 : if (parity_needs_to_be_updated) {
1153 : /* compute the parity */
- 1154 112466 : raid_gen(diskmax, state->level, state->block_size, buffer);
+ 1154 112401 : raid_gen(diskmax, state->level, state->block_size, buffer);
1155 :
1156 : /* until now is raid */
- 1157 112466 : state_usage_raid(state);
+ 1157 112401 : state_usage_raid(state);
1158 :
1159 : /* mark that the parity is going to be written */
- 1160 112466 : parity_going_to_be_updated = 1;
+ 1160 112401 : parity_going_to_be_updated = 1;
1161 : }
1162 :
1163 : /* for each disk, mark the blocks as processed */
- 1164 803474 : for (j = 0; j < diskmax; ++j) {
+ 1164 802781 : for (j = 0; j < diskmax; ++j) {
1165 : struct snapraid_block* block;
1166 :
- 1167 688692 : if (!handle[j].disk)
+ 1167 688098 : if (!handle[j].disk)
1168 0 : continue;
1169 :
- 1170 688692 : block = fs_par2block_find(handle[j].disk, blockcur);
+ 1170 688098 : block = fs_par2block_find(handle[j].disk, blockcur);
1171 :
- 1172 688692 : if (block == BLOCK_NULL) {
+ 1172 688098 : if (block == BLOCK_NULL) {
1173 : /* nothing to do */
- 1174 81261 : continue;
+ 1174 81231 : continue;
1175 : }
1176 :
1177 : /* if it's a deleted block */
- 1178 607431 : if (block_state_get(block) == BLOCK_STATE_DELETED) {
+ 1178 606867 : if (block_state_get(block) == BLOCK_STATE_DELETED) {
1179 : /* the parity is now updated without this block, so it's now empty */
1180 10953 : fs_deallocate(handle[j].disk, blockcur);
1181 10953 : continue;
1182 : }
1183 :
1184 : /* now all the blocks have the hash and the parity computed */
- 1185 596478 : block_state_set(block, BLOCK_STATE_BLK);
+ 1185 595914 : block_state_set(block, BLOCK_STATE_BLK);
1186 : }
1187 :
1188 : /* we update the info block only if we really have updated the parity */
@@ -1252,11 +1252,11 @@
1190 : /* wrote the parity at this time */
1191 : /* we also update the info block only if no silent error was found */
1192 : /* because has no sense to refresh the time for data that we know bad */
- 1193 114782 : if (parity_needs_to_be_updated
- 1194 112466 : && !silent_error_on_this_block
+ 1193 114683 : if (parity_needs_to_be_updated
+ 1194 112401 : && !silent_error_on_this_block
1195 : ) {
1196 : /* if rehash is needed */
- 1197 112125 : if (rehash) {
+ 1197 112055 : if (rehash) {
1198 : /* store all the new hash already computed */
1199 32249 : for (j = 0; j < diskmax; ++j) {
1200 27642 : if (rehandle[j].block)
@@ -1266,14 +1266,14 @@
1204 :
1205 : /* update the time info of the block */
1206 : /* we are also clearing any previous bad and rehash flag */
- 1207 112125 : info_set(&state->infoarr, blockcur, info_make(now, 0, 0, 1));
+ 1207 112055 : info_set(&state->infoarr, blockcur, info_make(now, 0, 0, 1));
1208 : }
1209 : }
1210 :
1211 : /* if a silent (even if corrected) or input/output error was found */
1212 : /* mark the block as bad to have check/fix to handle it */
1213 : /* because our correction is in memory only and not yet written */
- 1214 114801 : if (silent_error_on_this_block || io_error_on_this_block) {
+ 1214 114702 : if (silent_error_on_this_block || io_error_on_this_block) {
1215 : /* set the error status keeping the other info */
1216 852 : info_set(&state->infoarr, blockcur, info_set_bad(info));
1217 : }
@@ -1282,27 +1282,27 @@
1220 : /* Note that the calls to io_parity_write() are mandatory */
1221 : /* even if the parity doesn't need to be updated */
1222 : /* This because we want to keep track of the time usage */
- 1223 114801 : state_usage_misc(state);
+ 1223 114702 : state_usage_misc(state);
1224 :
1225 : /* write start */
- 1226 114801 : io_write_preset(&io, blockcur, !parity_going_to_be_updated);
+ 1226 114702 : io_write_preset(&io, blockcur, !parity_going_to_be_updated);
1227 :
1228 : /* write the parity */
- 1229 673502 : for (l = 0; l < state->level; ++l) {
+ 1229 672809 : for (l = 0; l < state->level; ++l) {
1230 : unsigned levcur;
1231 :
- 1232 558701 : io_parity_write(&io, &levcur, waiting_map, &waiting_mac);
+ 1232 558107 : io_parity_write(&io, &levcur, waiting_map, &waiting_mac);
1233 :
1234 : /* until now is parity */
- 1235 558701 : state_usage_parity(state, waiting_map, waiting_mac);
+ 1235 558107 : state_usage_parity(state, waiting_map, waiting_mac);
1236 : }
1237 :
1238 : /* write finished */
- 1239 114801 : io_write_next(&io, blockcur, !parity_going_to_be_updated, writer_error);
+ 1239 114702 : io_write_next(&io, blockcur, !parity_going_to_be_updated, writer_error);
1240 :
1241 : /* handle errors reported */
- 1242 574005 : for (j = 0; j < IO_WRITER_ERROR_MAX; ++j) {
- 1243 459204 : if (writer_error[j]) {
+ 1242 573510 : for (j = 0; j < IO_WRITER_ERROR_MAX; ++j) {
+ 1243 458808 : if (writer_error[j]) {
1244 0 : switch (j + IO_WRITER_ERROR_BASE) {
1245 : case TASK_STATE_IOERROR_CONTINUE :
1246 0 : ++io_error;
@@ -1326,24 +1326,24 @@
1264 : }
1265 :
1266 : /* mark the state as needing write */
- 1267 114801 : state->need_write = 1;
+ 1267 114702 : state->need_write = 1;
1268 :
1269 : /* count the number of processed block */
- 1270 114801 : ++countpos;
+ 1270 114702 : ++countpos;
1271 :
1272 : /* progress */
- 1273 114801 : if (state_progress(state, &io, blockcur, countpos, countmax, countsize)) {
+ 1273 114702 : if (state_progress(state, &io, blockcur, countpos, countmax, countsize)) {
1274 : /* LCOV_EXCL_START */
1275 : break;
1276 : /* LCOV_EXCL_STOP */
1277 : }
1278 :
1279 : /* autosave */
- 1280 114801 : if ((state->autosave != 0
+ 1280 114702 : if ((state->autosave != 0
1281 26021 : && autosavedone >= autosavelimit /* if we have reached the limit */
1282 0 : && autosavemissing >= autosavelimit) /* if we have at least a full step to do */
1283 : /* or if we have a forced autosave at the specified block */
- 1284 114801 : || (state->opt.force_autosave_at != 0 && state->opt.force_autosave_at == blockcur)
+ 1284 114702 : || (state->opt.force_autosave_at != 0 && state->opt.force_autosave_at == blockcur)
1285 : ) {
1286 1 : autosavedone = 0; /* restart the counter */
1287 :
@@ -1378,7 +1378,7 @@
1316 : /* drop until now */
1317 1 : state_usage_waste(state);
1318 : }
- 1319 114801 : }
+ 1319 114702 : }
1320 :
1321 : end:
1322 83 : state_progress_end(state, countpos, countmax, countsize);
diff --git a/cov/cmdline/unix.c.func-sort-c.html b/cov/cmdline/unix.c.func-sort-c.html
index e3388572..9a1a9433 100644
--- a/cov/cmdline/unix.c.func-sort-c.html
+++ b/cov/cmdline/unix.c.func-sort-c.html
@@ -61,11 +61,11 @@
| tick |
- 3819422 |
+ 3816813 |
| open_noatime |
- 1719600 |
+ 1719371 |
| filephy |
@@ -89,23 +89,23 @@
| os_init |
- 266 |
+ 269 |
| os_done |
- 244 |
+ 247 |
| tagread |
191 |
- | devresolve_sys |
+ devresolve |
191 |
- | devresolve |
- 177 |
+ devresolve_sys |
+ 191 |
| devread |
@@ -120,12 +120,12 @@
65 |
- | devsmart |
+ thread_smart |
43 |
- | thread_smart |
- 42 |
+ devsmart |
+ 43 |
| devup |
diff --git a/cov/cmdline/unix.c.func.html b/cov/cmdline/unix.c.func.html
index df9e0b1b..0abc1827 100644
--- a/cov/cmdline/unix.c.func.html
+++ b/cov/cmdline/unix.c.func.html
@@ -81,7 +81,7 @@
| devresolve |
- 177 |
+ 191 |
| devresolve_proc |
@@ -137,7 +137,7 @@
| open_noatime |
- 1719600 |
+ 1719371 |
| os_clear |
@@ -145,11 +145,11 @@
| os_done |
- 244 |
+ 247 |
| os_init |
- 266 |
+ 269 |
| randomize |
@@ -165,7 +165,7 @@
| thread_smart |
- 42 |
+ 43 |
| thread_spindown |
@@ -177,7 +177,7 @@
| tick |
- 3819422 |
+ 3816813 |
| tick_ms |
diff --git a/cov/cmdline/unix.c.gcov.html b/cov/cmdline/unix.c.gcov.html
index 6b7f47d7..4f7defe9 100644
--- a/cov/cmdline/unix.c.gcov.html
+++ b/cov/cmdline/unix.c.gcov.html
@@ -90,15 +90,15 @@
28 : int exit_failure = 1;
29 : int exit_sync_needed = 2;
30 :
- 31 1719600 : int open_noatime(const char* file, int flags)
+ 31 1719371 : int open_noatime(const char* file, int flags)
32 : {
33 : #ifdef O_NOATIME
- 34 1719600 : int f = open(file, flags | O_NOATIME);
+ 34 1719371 : int f = open(file, flags | O_NOATIME);
35 :
36 : /* only root is allowed to use O_NOATIME, in case retry without it */
- 37 1719647 : if (f == -1 && errno == EPERM)
+ 37 1719426 : if (f == -1 && errno == EPERM)
38 0 : f = open(file, flags);
- 39 1719648 : return f;
+ 39 1719420 : return f;
40 : #else
41 : return open(file, flags);
42 : #endif
@@ -324,23 +324,23 @@
262 : }
263 :
264 191 : ret = close(f);
- 265 191 : if (ret != 0) {
+ 265 190 : if (ret != 0) {
266 : /* LCOV_EXCL_START */
267 : log_fatal("Failed to close '%s'.\n", path);
268 : return -1;
269 : /* LCOV_EXCL_STOP */
270 : }
271 :
- 272 191 : buf[len] = 0;
- 273 191 : tag_len = strlen(tag);
+ 272 190 : buf[len] = 0;
+ 273 190 : tag_len = strlen(tag);
274 :
- 275 3324 : for (i = buf; *i; ++i) {
- 276 3324 : char* p = i;
+ 275 3321 : for (i = buf; *i; ++i) {
+ 276 3321 : char* p = i;
277 :
278 : /* start with a space */
- 279 3324 : if (p != buf) {
- 280 3133 : if (!isspace(*p))
- 281 2751 : continue;
+ 279 3321 : if (p != buf) {
+ 280 3130 : if (!isspace(*p))
+ 281 2749 : continue;
282 382 : ++p;
283 : }
284 :
@@ -368,18 +368,18 @@
306 191 : e = i;
307 1020 : while (*e != 0 && !isspace(*e))
308 638 : ++e;
- 309 191 : *e = 0;
+ 309 190 : *e = 0;
310 :
- 311 191 : if (!*i) {
+ 311 190 : if (!*i) {
312 : /* LCOV_EXCL_START */
313 : log_fatal("Empty tag '%s' for '%s'.\n", tag, path);
314 : return -1;
315 : /* LCOV_EXCL_STOP */
316 : }
317 :
- 318 191 : pathprint(value, value_size, "%s", i);
+ 318 190 : pathprint(value, value_size, "%s", i);
319 :
- 320 191 : return 0;
+ 320 190 : return 0;
321 : }
322 : #endif
323 :
@@ -407,7 +407,7 @@
345 : }
346 :
347 : /* set the real device path */
- 348 191 : pathprint(path, path_size, "/dev/%s", buf);
+ 348 190 : pathprint(path, path_size, "/dev/%s", buf);
349 :
350 : /* check the device */
351 191 : if (stat(path, &st) != 0) {
@@ -416,14 +416,14 @@
354 : return -1;
355 : /* LCOV_EXCL_STOP */
356 : }
- 357 191 : if (st.st_rdev != device) {
+ 357 190 : if (st.st_rdev != device) {
358 : /* LCOV_EXCL_START */
359 : log_tag("resolve:sys:%u:%u: unexpected device '%u:%u' for '%s'.\n", major(device), minor(device), major(st.st_rdev), minor(st.st_rdev), path);
360 : return -1;
361 : /* LCOV_EXCL_STOP */
362 : }
363 :
- 364 191 : log_tag("resolve:sys:%u:%u:%s: found\n", major(device), minor(device), path);
+ 364 190 : log_tag("resolve:sys:%u:%u:%s: found\n", major(device), minor(device), path);
365 :
366 191 : return 0;
367 : }
@@ -433,9 +433,9 @@
371 : * Get the device file from the device number.
372 : */
373 : #if HAVE_LINUX_DEVICE
- 374 177 : static int devresolve(uint64_t device, char* path, size_t path_size)
+ 374 191 : static int devresolve(uint64_t device, char* path, size_t path_size)
375 : {
- 376 177 : if (devresolve_sys(device, path, path_size) == 0)
+ 376 191 : if (devresolve_sys(device, path, path_size) == 0)
377 191 : return 0;
378 :
379 0 : return -1;
@@ -791,7 +791,7 @@
729 5477 : return 0;
730 : }
731 :
- 732 3819422 : uint64_t tick(void)
+ 732 3816813 : uint64_t tick(void)
733 : {
734 : #if HAVE_MACH_ABSOLUTE_TIME
735 : /* for Mac OS X */
@@ -802,14 +802,14 @@
740 :
741 : /* nanosecond precision with clock_gettime() */
742 : #if defined(CLOCK_MONOTONIC_RAW)
- 743 3819422 : if (clock_gettime(CLOCK_MONOTONIC_RAW, &tv) != 0) {
+ 743 3816813 : if (clock_gettime(CLOCK_MONOTONIC_RAW, &tv) != 0) {
744 : #else
745 : if (clock_gettime(CLOCK_MONOTONIC, &tv) != 0) {
746 : #endif
747 0 : return 0;
748 : }
749 :
- 750 3819422 : return tv.tv_sec * 1000000000ULL + tv.tv_nsec;
+ 750 3816813 : return tv.tv_sec * 1000000000ULL + tv.tv_nsec;
751 : #else
752 : /* other platforms */
753 : struct timeval tv;
@@ -1135,7 +1135,7 @@
1073 : /* LCOV_EXCL_STOP */
1074 : }
1075 :
- 1076 42 : ret = pclose(f);
+ 1076 43 : ret = pclose(f);
1077 :
1078 43 : log_tag("smartctl:%s:%s:ret: %x\n", file, name, ret);
1079 :
@@ -1325,12 +1325,12 @@
1263 : /**
1264 : * Thread for getting smart info.
1265 : */
- 1266 42 : static void* thread_smart(void* arg)
+ 1266 43 : static void* thread_smart(void* arg)
1267 : {
1268 : #if HAVE_LINUX_DEVICE
- 1269 42 : devinfo_t* devinfo = arg;
+ 1269 43 : devinfo_t* devinfo = arg;
1270 :
- 1271 42 : if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->smart_serial, devinfo->smart_vendor, devinfo->smart_model) != 0) {
+ 1271 43 : if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->smart_serial, devinfo->smart_vendor, devinfo->smart_model) != 0) {
1272 : /* LCOV_EXCL_START */
1273 : return (void*)-1;
1274 : /* LCOV_EXCL_STOP */
@@ -1477,12 +1477,12 @@
1415 3 : return device_thread(low, func);
1416 : }
1417 :
- 1418 266 : void os_init(int opt)
+ 1418 269 : void os_init(int opt)
1419 : {
1420 : #if HAVE_BLKID
1421 : int ret;
- 1422 266 : ret = blkid_get_cache(&cache, NULL);
- 1423 266 : if (ret != 0) {
+ 1422 269 : ret = blkid_get_cache(&cache, NULL);
+ 1423 269 : if (ret != 0) {
1424 : /* LCOV_EXCL_START */
1425 : log_fatal("WARNING Failed to get blkid cache\n");
1426 : /* LCOV_EXCL_STOP */
@@ -1490,15 +1490,15 @@
1428 : #endif
1429 :
1430 : (void)opt;
- 1431 266 : }
+ 1431 269 : }
1432 :
- 1433 244 : void os_done(void)
+ 1433 247 : void os_done(void)
1434 : {
1435 : #if HAVE_BLKID
- 1436 244 : if (cache != 0)
- 1437 244 : blkid_put_cache(cache);
+ 1436 247 : if (cache != 0)
+ 1437 247 : blkid_put_cache(cache);
1438 : #endif
- 1439 244 : }
+ 1439 247 : }
1440 :
1441 : /* LCOV_EXCL_START */
1442 : void os_abort(void)
diff --git a/cov/cmdline/util.c.func-sort-c.html b/cov/cmdline/util.c.func-sort-c.html
index 5de83cd7..54bd9b21 100644
--- a/cov/cmdline/util.c.func-sort-c.html
+++ b/cov/cmdline/util.c.func-sort-c.html
@@ -61,27 +61,27 @@
| util_rotl32 |
- 845729469 |
+ 854114224 |
| util_rotl64 |
- 507650352 |
+ 512217108 |
| memhash |
- 5938819 |
+ 5937808 |
| crc32c_x86 |
- 646398 |
+ 646614 |
| memdiff |
- 93443 |
+ 93184 |
| malloc_nofail_vector_align |
- 12490 |
+ 12366 |
| mtest_vector |
@@ -95,9 +95,13 @@
fast_mtest_vector |
1951 |
+
+ | crc32c_gen |
+ 361 |
+
| crc32c_init |
- 282 |
+ 285 |
| lock_lock |
@@ -111,10 +115,6 @@
malloc_nofail_align |
179 |
-
- | crc32c_gen |
- 105 |
-
| hash_config_name |
42 |
diff --git a/cov/cmdline/util.c.func.html b/cov/cmdline/util.c.func.html
index 05081b2c..d471f99a 100644
--- a/cov/cmdline/util.c.func.html
+++ b/cov/cmdline/util.c.func.html
@@ -61,15 +61,15 @@
| crc32c_gen |
- 105 |
+ 361 |
| crc32c_init |
- 282 |
+ 285 |
| crc32c_x86 |
- 646398 |
+ 646614 |
| fast_mtest_vector |
@@ -101,7 +101,7 @@
| malloc_nofail_vector_align |
- 12490 |
+ 12366 |
| malloc_nofail_vector_direct |
@@ -109,11 +109,11 @@
| memdiff |
- 93443 |
+ 93184 |
| memhash |
- 5938819 |
+ 5937808 |
| mtest_vector |
@@ -121,11 +121,11 @@
| util_rotl32 |
- 845729469 |
+ 854114224 |
| util_rotl64 |
- 507650352 |
+ 512217108 |
diff --git a/cov/cmdline/util.c.gcov.html b/cov/cmdline/util.c.gcov.html
index d1ebfec5..050d6610 100644
--- a/cov/cmdline/util.c.gcov.html
+++ b/cov/cmdline/util.c.gcov.html
@@ -119,20 +119,20 @@
57 7 : return ptr;
58 : }
59 :
- 60 12490 : void** malloc_nofail_vector_align(int nd, int n, size_t size, void** freeptr)
+ 60 12366 : void** malloc_nofail_vector_align(int nd, int n, size_t size, void** freeptr)
61 : {
62 : void* ptr;
63 :
- 64 12490 : ptr = raid_malloc_vector(nd, n, size, freeptr);
+ 64 12366 : ptr = raid_malloc_vector(nd, n, size, freeptr);
65 :
- 66 12490 : if (!ptr) {
+ 66 12366 : if (!ptr) {
67 : /* LCOV_EXCL_START */
68 : malloc_fail(n * size);
69 : exit(EXIT_FAILURE);
70 : /* LCOV_EXCL_STOP */
71 : }
72 :
- 73 12490 : return ptr;
+ 73 12366 : return ptr;
74 : }
75 :
76 0 : void** malloc_nofail_vector_direct(int nd, int n, size_t size, void** freeptr)
@@ -478,42 +478,42 @@
416 : int crc_x86;
417 : #endif
418 :
- 419 105 : uint32_t crc32c_gen(uint32_t crc, const unsigned char* ptr, unsigned size)
+ 419 361 : uint32_t crc32c_gen(uint32_t crc, const unsigned char* ptr, unsigned size)
420 : {
- 421 105 : crc ^= CRC_IV;
+ 421 361 : crc ^= CRC_IV;
422 :
- 423 105 : crc = crc32c_gen_plain(crc, ptr, size);
+ 423 361 : crc = crc32c_gen_plain(crc, ptr, size);
424 :
- 425 105 : crc ^= CRC_IV;
+ 425 361 : crc ^= CRC_IV;
426 :
- 427 105 : return crc;
+ 427 361 : return crc;
428 : }
429 :
430 : #if HAVE_SSE42
- 431 646398 : uint32_t crc32c_x86(uint32_t crc, const unsigned char* ptr, unsigned size)
+ 431 646614 : uint32_t crc32c_x86(uint32_t crc, const unsigned char* ptr, unsigned size)
432 : {
- 433 646398 : crc ^= CRC_IV;
+ 433 646614 : crc ^= CRC_IV;
434 :
- 435 646398 : crc = crc32c_x86_plain(crc, ptr, size);
+ 435 646614 : crc = crc32c_x86_plain(crc, ptr, size);
436 :
- 437 646395 : crc ^= CRC_IV;
+ 437 646610 : crc ^= CRC_IV;
438 :
- 439 646395 : return crc;
+ 439 646610 : return crc;
440 : }
441 : #endif
442 :
443 : uint32_t (*crc32c)(uint32_t crc, const unsigned char* ptr, unsigned size);
444 :
- 445 282 : void crc32c_init(void)
+ 445 285 : void crc32c_init(void)
446 : {
- 447 282 : crc32c = crc32c_gen;
+ 447 285 : crc32c = crc32c_gen;
448 : #if HAVE_SSE42
- 449 282 : if (raid_cpu_has_crc32()) {
- 450 282 : crc_x86 = 1;
- 451 282 : crc32c = crc32c_x86;
+ 449 285 : if (raid_cpu_has_crc32()) {
+ 450 283 : crc_x86 = 1;
+ 451 283 : crc32c = crc32c_x86;
452 : }
453 : #endif
- 454 282 : }
+ 454 285 : }
455 :
456 : /****************************************************************************/
457 : /* byte operations */
@@ -522,14 +522,14 @@
460 : * Rotate left.
461 : * In x86/x64 they are optimized with a single assembler instruction.
462 : */
- 463 845729469 : static inline uint32_t util_rotl32(uint32_t x, int8_t r)
+ 463 854114224 : static inline uint32_t util_rotl32(uint32_t x, int8_t r)
464 : {
- 465 845729469 : return (x << r) | (x >> (32 - r));
+ 465 854114224 : return (x << r) | (x >> (32 - r));
466 : }
467 :
- 468 507650352 : static inline uint64_t util_rotl64(uint64_t x, int8_t r)
+ 468 512217108 : static inline uint64_t util_rotl64(uint64_t x, int8_t r)
469 : {
- 470 507650352 : return (x << r) | (x >> (64 - r));
+ 470 512217108 : return (x << r) | (x >> (64 - r));
471 : }
472 :
473 : /**
@@ -570,15 +570,15 @@
508 : #include "murmur3.c"
509 : #include "spooky2.c"
510 :
- 511 5938819 : void memhash(unsigned kind, const unsigned char* seed, void* digest, const void* src, size_t size)
+ 511 5937808 : void memhash(unsigned kind, const unsigned char* seed, void* digest, const void* src, size_t size)
512 : {
- 513 5938819 : switch (kind) {
+ 513 5937808 : switch (kind) {
514 : case HASH_MURMUR3 :
- 515 2076783 : MurmurHash3_x86_128(src, size, seed, digest);
- 516 2076783 : break;
+ 515 2076827 : MurmurHash3_x86_128(src, size, seed, digest);
+ 516 2076827 : break;
517 : case HASH_SPOOKY2 :
- 518 3862036 : SpookyHash128(src, size, seed, digest);
- 519 3862036 : break;
+ 518 3860981 : SpookyHash128(src, size, seed, digest);
+ 519 3860981 : break;
520 : default :
521 : /* LCOV_EXCL_START */
522 : log_fatal("Internal inconsistency in hash function %u\n", kind);
@@ -586,7 +586,7 @@
524 : break;
525 : /* LCOV_EXCL_STOP */
526 : }
- 527 5938819 : }
+ 527 5937808 : }
528 :
529 42 : const char* hash_config_name(unsigned kind)
530 : {
@@ -601,23 +601,23 @@
539 : }
540 : }
541 :
- 542 93443 : unsigned memdiff(const unsigned char* data1, const unsigned char* data2, size_t size)
+ 542 93184 : unsigned memdiff(const unsigned char* data1, const unsigned char* data2, size_t size)
543 : {
544 : size_t i;
545 : unsigned count;
546 :
- 547 93443 : count = 0;
- 548 80900995 : for (i = 0; i < size; ++i) {
+ 547 93184 : count = 0;
+ 548 80903648 : for (i = 0; i < size; ++i) {
549 : unsigned j;
- 550 80807552 : unsigned char diff = data1[i] ^ data2[i];
- 551 727267968 : for (j = 0; j < 8; ++j) {
- 552 646460416 : if ((diff & 1) != 0)
- 553 311440935 : ++count;
- 554 646460416 : diff >>= 1;
+ 550 80810464 : unsigned char diff = data1[i] ^ data2[i];
+ 551 727294176 : for (j = 0; j < 8; ++j) {
+ 552 646483712 : if ((diff & 1) != 0)
+ 553 311410983 : ++count;
+ 554 646483712 : diff >>= 1;
555 : }
556 : }
557 :
- 558 93443 : return count;
+ 558 93184 : return count;
559 : }
560 :
561 : /****************************************************************************/
diff --git a/cov/cmdline/util.h.func-sort-c.html b/cov/cmdline/util.h.func-sort-c.html
index 636b2c75..5f32bb8e 100644
--- a/cov/cmdline/util.h.func-sort-c.html
+++ b/cov/cmdline/util.h.func-sort-c.html
@@ -61,19 +61,19 @@
| crc32c_x86_plain |
- 21351829 |
+ 21365714 |
| crc32c_plain |
- 20705435 |
+ 20719102 |
| crc32c_plain_char |
- 3807708 |
+ 3808841 |
| crc32c_gen_plain |
- 105 |
+ 361 |
diff --git a/cov/cmdline/util.h.func.html b/cov/cmdline/util.h.func.html
index 64489dec..bbede01b 100644
--- a/cov/cmdline/util.h.func.html
+++ b/cov/cmdline/util.h.func.html
@@ -61,19 +61,19 @@
| crc32c_gen_plain |
- 105 |
+ 361 |
| crc32c_plain |
- 20705435 |
+ 20719102 |
| crc32c_plain_char |
- 3807708 |
+ 3808841 |
| crc32c_x86_plain |
- 21351829 |
+ 21365714 |
diff --git a/cov/cmdline/util.h.gcov.html b/cov/cmdline/util.h.gcov.html
index e6f45c83..89321798 100644
--- a/cov/cmdline/util.h.gcov.html
+++ b/cov/cmdline/util.h.gcov.html
@@ -144,12 +144,12 @@
82 : /**
83 : * Compute CRC-32 (Castagnoli) for a single byte without the IV.
84 : */
- 85 3807708 : static inline uint32_t crc32c_plain_char(uint32_t crc, unsigned char c)
+ 85 3808841 : static inline uint32_t crc32c_plain_char(uint32_t crc, unsigned char c)
86 : {
87 : #if HAVE_SSE42
- 88 3807708 : if (tommy_likely(crc_x86)) {
- 89 3807708 : asm("crc32b %1, %0\n" : "+r" (crc) : "m" (c));
- 90 3807708 : return crc;
+ 88 3808841 : if (tommy_likely(crc_x86)) {
+ 89 3808841 : asm("crc32b %1, %0\n" : "+r" (crc) : "m" (c));
+ 90 3808841 : return crc;
91 : }
92 : #endif
93 0 : return CRC32C_0[(crc ^ c) & 0xff] ^ (crc >> 8);
@@ -158,29 +158,29 @@
96 : /**
97 : * Compute the CRC-32 (Castagnoli) without the IV.
98 : */
- 99 105 : static inline uint32_t crc32c_gen_plain(uint32_t crc, const unsigned char* ptr, unsigned size)
+ 99 361 : static inline uint32_t crc32c_gen_plain(uint32_t crc, const unsigned char* ptr, unsigned size)
100 : {
- 101 5767545 : while (size >= 4) {
- 102 5767335 : crc ^= ptr[0] | (uint32_t)ptr[1] << 8 | (uint32_t)ptr[2] << 16 | (uint32_t)ptr[3] << 24;
- 103 5767335 : crc = CRC32C_3[crc & 0xff] ^ CRC32C_2[(crc >> 8) & 0xff] ^ CRC32C_1[(crc >> 16) & 0xff] ^ CRC32C_0[crc >> 24];
- 104 5767335 : ptr += 4;
- 105 5767335 : size -= 4;
+ 101 22545273 : while (size >= 4) {
+ 102 22544551 : crc ^= ptr[0] | (uint32_t)ptr[1] << 8 | (uint32_t)ptr[2] << 16 | (uint32_t)ptr[3] << 24;
+ 103 22544551 : crc = CRC32C_3[crc & 0xff] ^ CRC32C_2[(crc >> 8) & 0xff] ^ CRC32C_1[(crc >> 16) & 0xff] ^ CRC32C_0[crc >> 24];
+ 104 22544551 : ptr += 4;
+ 105 22544551 : size -= 4;
106 : }
107 :
- 108 219 : while (size) {
+ 108 731 : while (size) {
109 9 : crc = CRC32C_0[(crc ^ *ptr) & 0xff] ^ (crc >> 8);
110 9 : ++ptr;
111 9 : --size;
112 : }
113 :
- 114 105 : return crc;
+ 114 361 : return crc;
115 : }
116 :
117 : /**
118 : * Compute the CRC-32 (Castagnoli) without the IV.
119 : */
120 : #if HAVE_SSE42
- 121 21351829 : static inline uint32_t crc32c_x86_plain(uint32_t crc, const unsigned char* ptr, unsigned size)
+ 121 21365714 : static inline uint32_t crc32c_x86_plain(uint32_t crc, const unsigned char* ptr, unsigned size)
122 : {
123 : #ifdef CONFIG_X86_64
124 : uint64_t crc64 = crc;
@@ -191,30 +191,30 @@
129 : }
130 : crc = crc64;
131 : #else
- 132 368064476 : while (size >= 4) {
- 133 325360818 : asm("crc32l %1, %0\n" : "+r" (crc) : "m" (*(const uint32_t*)ptr));
- 134 325360818 : ptr += 4;
- 135 325360818 : size -= 4;
+ 132 387175791 : while (size >= 4) {
+ 133 344444363 : asm("crc32l %1, %0\n" : "+r" (crc) : "m" (*(const uint32_t*)ptr));
+ 134 344444363 : ptr += 4;
+ 135 344444363 : size -= 4;
136 : }
137 : #endif
- 138 62023542 : while (size) {
- 139 19319884 : asm("crc32b %1, %0\n" : "+r" (crc) : "m" (*ptr));
- 140 19319884 : ++ptr;
- 141 19319884 : --size;
+ 138 62479703 : while (size) {
+ 139 19748275 : asm("crc32b %1, %0\n" : "+r" (crc) : "m" (*ptr));
+ 140 19748275 : ++ptr;
+ 141 19748275 : --size;
142 : }
143 :
- 144 21351829 : return crc;
+ 144 21365714 : return crc;
145 : }
146 : #endif
147 :
148 : /**
149 : * Compute CRC-32 (Castagnoli) without the IV.
150 : */
- 151 20705435 : static inline uint32_t crc32c_plain(uint32_t crc, const unsigned char* ptr, unsigned size)
+ 151 20719102 : static inline uint32_t crc32c_plain(uint32_t crc, const unsigned char* ptr, unsigned size)
152 : {
153 : #if HAVE_SSE42
- 154 20705435 : if (tommy_likely(crc_x86)) {
- 155 20705435 : return crc32c_x86_plain(crc, ptr, size);
+ 154 20719102 : if (tommy_likely(crc_x86)) {
+ 155 20719102 : return crc32c_x86_plain(crc, ptr, size);
156 : }
157 : #endif
158 0 : return crc32c_gen_plain(crc, ptr, size);
diff --git a/cov/index-sort-f.html b/cov/index-sort-f.html
index 9d68c826..369519f1 100644
--- a/cov/index-sort-f.html
+++ b/cov/index-sort-f.html
@@ -31,18 +31,18 @@
|
-
-
-
+
+
+
|
-
+
-
+
 |
@@ -69,36 +69,36 @@
Line Coverage  |
Functions  |
-
- | raid |
-
-
- |
- 88.3 % |
- 1555 / 1762 |
- 92.9 % |
- 79 / 85 |
-
| cmdline |
-
+
|
- 88.6 % |
- 8491 / 9587 |
- 95.0 % |
- 474 / 499 |
+ 89.7 % |
+ 8598 / 9589 |
+ 96.6 % |
+ 482 / 499 |
| tommyds |
-
+
|
- 99.8 % |
- 580 / 581 |
+ 100.0 % |
+ 581 / 581 |
100.0 % |
76 / 76 |
+
+ | raid |
+
+
+ |
+ 99.3 % |
+ 1750 / 1762 |
+ 100.0 % |
+ 85 / 85 |
+
diff --git a/cov/index-sort-l.html b/cov/index-sort-l.html
index f02e2379..8df6ac86 100644
--- a/cov/index-sort-l.html
+++ b/cov/index-sort-l.html
@@ -31,18 +31,18 @@
|
-
-
-
+
+
+
|
-
+
-
+
 |
@@ -69,33 +69,33 @@
Line Coverage  |
Functions  |
-
- | raid |
-
-
- |
- 88.3 % |
- 1555 / 1762 |
- 92.9 % |
- 79 / 85 |
-
| cmdline |
-
+
|
- 88.6 % |
- 8491 / 9587 |
- 95.0 % |
- 474 / 499 |
+ 89.7 % |
+ 8598 / 9589 |
+ 96.6 % |
+ 482 / 499 |
+
+
+ | raid |
+
+
+ |
+ 99.3 % |
+ 1750 / 1762 |
+ 100.0 % |
+ 85 / 85 |
| tommyds |
-
+
|
- 99.8 % |
- 580 / 581 |
+ 100.0 % |
+ 581 / 581 |
100.0 % |
76 / 76 |
diff --git a/cov/index.html b/cov/index.html
index a90b3cdc..aa99f509 100644
--- a/cov/index.html
+++ b/cov/index.html
@@ -31,18 +31,18 @@
|
-
-
-
+
+
+
|
-
+
-
+
 |
@@ -72,30 +72,30 @@
| cmdline |
-
+
|
- 88.6 % |
- 8491 / 9587 |
- 95.0 % |
- 474 / 499 |
+ 89.7 % |
+ 8598 / 9589 |
+ 96.6 % |
+ 482 / 499 |
| raid |
-
+
|
- 88.3 % |
- 1555 / 1762 |
- 92.9 % |
- 79 / 85 |
+ 99.3 % |
+ 1750 / 1762 |
+ 100.0 % |
+ 85 / 85 |
| tommyds |
-
+
|
- 99.8 % |
- 580 / 581 |
+ 100.0 % |
+ 581 / 581 |
100.0 % |
76 / 76 |
diff --git a/cov/raid/combo.h.gcov.html b/cov/raid/combo.h.gcov.html
index cbd339e5..8e4fbb08 100644
--- a/cov/raid/combo.h.gcov.html
+++ b/cov/raid/combo.h.gcov.html
@@ -170,10 +170,10 @@
108 : int i;
109 :
110 : (void)n; /* unused, but kept for clarity */
- 111 207339 : assert(0 < r && r <= n);
+ 111 207805 : assert(0 < r && r <= n);
112 :
- 113 688129 : for (i = 0; i < r; ++i)
- 114 480790 : c[i] = i;
+ 113 689192 : for (i = 0; i < r; ++i)
+ 114 481387 : c[i] = i;
115 : }
116 :
117 : /**
@@ -182,19 +182,19 @@
120 : */
121 : static __always_inline int combination_next(int r, int n, int *c)
122 : {
- 123 52204 : int i = r - 1; /* present position */
- 124 52204 : int h = n; /* high limit for this position */
+ 123 52183 : int i = r - 1; /* present position */
+ 124 52183 : int h = n; /* high limit for this position */
125 :
126 : recurse:
127 : /* next element at position i */
- 128 85077 : ++c[i];
+ 128 85056 : ++c[i];
129 :
130 : /* if the position has reached the max */
- 131 85077 : if (c[i] >= h) {
+ 131 85056 : if (c[i] >= h) {
132 :
133 : /* if we are at the first level, we have finished */
- 134 45035 : if (i == 0)
- 135 12162 : return 0;
+ 134 45028 : if (i == 0)
+ 135 12155 : return 0;
136 :
137 : /* increase the previous position */
138 32873 : --i;
@@ -202,16 +202,16 @@
140 : goto recurse;
141 : }
142 :
- 143 40042 : ++i;
+ 143 40028 : ++i;
144 :
145 : /* initialize all the next positions, if any */
- 146 62587 : while (i < r) {
+ 146 62573 : while (i < r) {
147 : /* each position start at the next value of the previous one */
148 22545 : c[i] = c[i - 1] + 1;
149 22545 : ++i;
150 : }
151 :
- 152 40042 : return 1;
+ 152 40028 : return 1;
153 : }
154 : #endif
155 :
diff --git a/cov/raid/cpu.h.func-sort-c.html b/cov/raid/cpu.h.func-sort-c.html
index d63889cd..de749704 100644
--- a/cov/raid/cpu.h.func-sort-c.html
+++ b/cov/raid/cpu.h.func-sort-c.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
-
+
+
 |
@@ -61,51 +61,51 @@
| raid_cpuid |
- 1930 |
+ 2079 |
| raid_cpu_match_sse |
- 1113 |
+ 1185 |
| raid_cpu_has_ssse3 |
- 551 |
+ 587 |
| raid_cpu_match_avx |
- 287 |
+ 317 |
| raid_cpu_has_avx2 |
- 287 |
-
-
- | raid_cpu_has_crc32 |
- 284 |
+ 317 |
| raid_cpu_has_sse2 |
- 278 |
+ 305 |
+
+
+ | raid_cpu_has_crc32 |
+ 293 |
| raid_cpu_info |
- 265 |
+ 277 |
| raid_cpu_is_atom |
- 264 |
+ 273 |
| raid_cpu_has_slowmult |
- 263 |
-
-
- | raid_cpu_has_slowextendedreg |
- 1 |
+ 269 |
| raid_xgetbv |
- 0 |
+ 23 |
+
+
+ | raid_cpu_has_slowextendedreg |
+ 4 |
diff --git a/cov/raid/cpu.h.func.html b/cov/raid/cpu.h.func.html
index 38d8a6e3..f6f349fc 100644
--- a/cov/raid/cpu.h.func.html
+++ b/cov/raid/cpu.h.func.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
-
+
+
 |
@@ -61,51 +61,51 @@
| raid_cpu_has_avx2 |
- 287 |
+ 317 |
| raid_cpu_has_crc32 |
- 284 |
+ 293 |
| raid_cpu_has_slowextendedreg |
- 1 |
+ 4 |
| raid_cpu_has_slowmult |
- 263 |
+ 269 |
| raid_cpu_has_sse2 |
- 278 |
+ 305 |
| raid_cpu_has_ssse3 |
- 551 |
+ 587 |
| raid_cpu_info |
- 265 |
+ 277 |
| raid_cpu_is_atom |
- 264 |
+ 273 |
| raid_cpu_match_avx |
- 287 |
+ 317 |
| raid_cpu_match_sse |
- 1113 |
+ 1185 |
| raid_cpuid |
- 1930 |
+ 2079 |
| raid_xgetbv |
- 0 |
+ 23 |
diff --git a/cov/raid/cpu.h.gcov.html b/cov/raid/cpu.h.gcov.html
index 4f97492f..b0e1b857 100644
--- a/cov/raid/cpu.h.gcov.html
+++ b/cov/raid/cpu.h.gcov.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
-
+
+
 |
@@ -79,9 +79,9 @@
17 :
18 : #ifdef CONFIG_X86
19 :
- 20 1930 : static inline void raid_cpuid(uint32_t func_eax, uint32_t sub_ecx, uint32_t *reg)
+ 20 2079 : static inline void raid_cpuid(uint32_t func_eax, uint32_t sub_ecx, uint32_t *reg)
21 : {
- 22 1930 : asm volatile (
+ 22 2079 : asm volatile (
23 : #if defined(__i386__) && defined(__PIC__)
24 : /* allow compilation in PIC mode saving ebx */
25 : "xchgl %%ebx, %1\n"
@@ -91,47 +91,47 @@
29 : : "0" (func_eax), "2" (sub_ecx)
30 : #else
31 : "cpuid\n"
- 32 1930 : : "=a" (reg[0]), "=b" (reg[1]), "=c" (reg[2]), "=d" (reg[3])
+ 32 2079 : : "=a" (reg[0]), "=b" (reg[1]), "=c" (reg[2]), "=d" (reg[3])
33 : : "0" (func_eax), "2" (sub_ecx)
34 : #endif
35 : );
- 36 1930 : }
+ 36 2079 : }
37 :
- 38 0 : static inline void raid_xgetbv(uint32_t* reg)
+ 38 23 : static inline void raid_xgetbv(uint32_t* reg)
39 : {
40 : /* get the value of the Extended Control Register ecx=0 */
- 41 0 : asm volatile (
+ 41 23 : asm volatile (
42 : /* uses a direct encoding of the XGETBV instruction as only recent */
43 : /* assemblers support it. */
44 : /* the next line is equivalent at: "xgetbv\n" */
45 : ".byte 0x0f, 0x01, 0xd0\n"
- 46 0 : : "=a" (reg[0]), "=d" (reg[3])
+ 46 23 : : "=a" (reg[0]), "=d" (reg[3])
47 : : "c" (0)
48 : );
- 49 0 : }
+ 49 23 : }
50 :
51 : #define CPU_VENDOR_MAX 13
52 :
- 53 265 : static inline void raid_cpu_info(char *vendor, unsigned *family, unsigned *model)
+ 53 277 : static inline void raid_cpu_info(char *vendor, unsigned *family, unsigned *model)
54 : {
55 : uint32_t reg[4];
56 : unsigned f, ef, m, em;
57 :
- 58 265 : raid_cpuid(0, 0, reg);
+ 58 277 : raid_cpuid(0, 0, reg);
59 :
- 60 265 : ((uint32_t*)vendor)[0] = reg[1];
- 61 265 : ((uint32_t*)vendor)[1] = reg[3];
- 62 265 : ((uint32_t*)vendor)[2] = reg[2];
- 63 265 : vendor[12] = 0;
+ 60 277 : ((uint32_t*)vendor)[0] = reg[1];
+ 61 277 : ((uint32_t*)vendor)[1] = reg[3];
+ 62 277 : ((uint32_t*)vendor)[2] = reg[2];
+ 63 277 : vendor[12] = 0;
64 :
- 65 265 : raid_cpuid(1, 0, reg);
+ 65 277 : raid_cpuid(1, 0, reg);
66 :
- 67 265 : f = (reg[0] >> 8) & 0xF;
- 68 265 : ef = (reg[0] >> 20) & 0xFF;
- 69 265 : m = (reg[0] >> 4) & 0xF;
- 70 265 : em = (reg[0] >> 16) & 0xF;
+ 67 277 : f = (reg[0] >> 8) & 0xF;
+ 68 277 : ef = (reg[0] >> 20) & 0xFF;
+ 69 277 : m = (reg[0] >> 4) & 0xF;
+ 70 277 : em = (reg[0] >> 16) & 0xF;
71 :
- 72 265 : if (strcmp(vendor, "AuthenticAMD") == 0) {
+ 72 277 : if (strcmp(vendor, "AuthenticAMD") == 0) {
73 0 : if (f < 15) {
74 0 : *family = f;
75 0 : *model = m;
@@ -140,44 +140,44 @@
78 0 : *model = m + (em << 4);
79 : }
80 : } else {
- 81 265 : *family = f + ef;
- 82 265 : *model = m + (em << 4);
+ 81 277 : *family = f + ef;
+ 82 277 : *model = m + (em << 4);
83 : }
- 84 265 : }
+ 84 277 : }
85 :
- 86 1113 : static inline int raid_cpu_match_sse(uint32_t cpuid_1_ecx, uint32_t cpuid_1_edx)
+ 86 1185 : static inline int raid_cpu_match_sse(uint32_t cpuid_1_ecx, uint32_t cpuid_1_edx)
87 : {
88 : uint32_t reg[4];
89 :
- 90 1113 : raid_cpuid(1, 0, reg);
- 91 1113 : if ((reg[2] & cpuid_1_ecx) != cpuid_1_ecx)
- 92 0 : return 0;
- 93 1113 : if ((reg[3] & cpuid_1_edx) != cpuid_1_edx)
+ 90 1185 : raid_cpuid(1, 0, reg);
+ 91 1185 : if ((reg[2] & cpuid_1_ecx) != cpuid_1_ecx)
+ 92 18 : return 0;
+ 93 1167 : if ((reg[3] & cpuid_1_edx) != cpuid_1_edx)
94 0 : return 0;
95 :
- 96 1113 : return 1;
+ 96 1167 : return 1;
97 : }
98 :
- 99 287 : static inline int raid_cpu_match_avx(uint32_t cpuid_1_ecx, uint32_t cpuid_7_ebx, uint32_t xcr0)
+ 99 317 : static inline int raid_cpu_match_avx(uint32_t cpuid_1_ecx, uint32_t cpuid_7_ebx, uint32_t xcr0)
100 : {
101 : uint32_t reg[4];
102 :
- 103 287 : raid_cpuid(1, 0, reg);
- 104 287 : if ((reg[2] & cpuid_1_ecx) != cpuid_1_ecx)
- 105 287 : return 0;
+ 103 317 : raid_cpuid(1, 0, reg);
+ 104 317 : if ((reg[2] & cpuid_1_ecx) != cpuid_1_ecx)
+ 105 294 : return 0;
106 :
- 107 0 : raid_xgetbv(reg);
- 108 0 : if ((reg[0] & xcr0) != xcr0)
+ 107 23 : raid_xgetbv(reg);
+ 108 23 : if ((reg[0] & xcr0) != xcr0)
109 0 : return 0;
110 :
- 111 0 : raid_cpuid(7, 0, reg);
- 112 0 : if ((reg[1] & cpuid_7_ebx) != cpuid_7_ebx)
+ 111 23 : raid_cpuid(7, 0, reg);
+ 112 23 : if ((reg[1] & cpuid_7_ebx) != cpuid_7_ebx)
113 0 : return 0;
114 :
- 115 0 : return 1;
+ 115 23 : return 1;
116 : }
117 :
- 118 278 : static inline int raid_cpu_has_sse2(void)
+ 118 305 : static inline int raid_cpu_has_sse2(void)
119 : {
120 : /*
121 : * Intel® 64 and IA-32 Architectures Software Developer's Manual
@@ -191,12 +191,12 @@
129 : * 2. Check that the processor supports the SSE and/or SSE2 extensions (true if
130 : * CPUID.01H:EDX.SSE[bit 25] = 1 and/or CPUID.01H:EDX.SSE2[bit 26] = 1).
131 : */
- 132 278 : return raid_cpu_match_sse(
+ 132 305 : return raid_cpu_match_sse(
133 : 0,
134 : 1 << 26); /* SSE2 */
135 : }
136 :
- 137 551 : static inline int raid_cpu_has_ssse3(void)
+ 137 587 : static inline int raid_cpu_has_ssse3(void)
138 : {
139 : /*
140 : * Intel® 64 and IA-32 Architectures Software Developer's Manual
@@ -208,12 +208,12 @@
146 : * Next, use the additional step provided below:
147 : * Check that the processor supports SSSE3 (if CPUID.01H:ECX.SSSE3[bit 9] = 1).
148 : */
- 149 551 : return raid_cpu_match_sse(
+ 149 587 : return raid_cpu_match_sse(
150 : 1 << 9, /* SSSE3 */
151 : 1 << 26); /* SSE2 */
152 : }
153 :
- 154 284 : static inline int raid_cpu_has_crc32(void)
+ 154 293 : static inline int raid_cpu_has_crc32(void)
155 : {
156 : /*
157 : * Intel® 64 and IA-32 Architectures Software Developer's Manual
@@ -224,12 +224,12 @@
162 : * Before an application attempts to use the CRC32 instruction, it must check
163 : * that the processor supports SSE4.2 (if CPUID.01H:ECX.SSE4_2[bit 20] = 1).
164 : */
- 165 284 : return raid_cpu_match_sse(
+ 165 293 : return raid_cpu_match_sse(
166 : 1 << 20, /* CRC32 */
167 : 0);
168 : }
169 :
- 170 287 : static inline int raid_cpu_has_avx2(void)
+ 170 317 : static inline int raid_cpu_has_avx2(void)
171 : {
172 : /*
173 : * Intel Architecture Instruction Set Extensions Programming Reference
@@ -246,7 +246,7 @@
184 : * Application Software must identify that hardware supports AVX, after that it must
185 : * also detect support for AVX2 by checking CPUID.(EAX=07H, ECX=0H):EBX.AVX2[bit 5].
186 : */
- 187 287 : return raid_cpu_match_avx(
+ 187 317 : return raid_cpu_match_avx(
188 : (1 << 27) | (1 << 28), /* OSXSAVE and AVX */
189 : 1 << 5, /* AVX2 */
190 : 3 << 1); /* OS saves XMM and YMM registers */
@@ -277,10 +277,10 @@
215 : /**
216 : * Check if it's an Intel Atom CPU.
217 : */
- 218 264 : static inline int raid_cpu_is_atom(unsigned family, unsigned model)
+ 218 273 : static inline int raid_cpu_is_atom(unsigned family, unsigned model)
219 : {
- 220 264 : if (family != 6)
- 221 0 : return 0;
+ 220 273 : if (family != 6)
+ 221 3 : return 0;
222 :
223 : /*
224 : * x86 Architecture CPUID
@@ -300,17 +300,17 @@
238 : * 4D (77) Atom 8C (22 nm) 4 MB L2 (AVN)
239 : * ?? Atom ?C (14 nm) ? MB L2 (DVN)
240 : */
- 241 528 : return model == 28 || model == 38 || model == 54
- 242 264 : || model == 39 || model == 53 || model == 74
- 243 264 : || model == 90 || model == 55 || model == 76
- 244 528 : || model == 93 || model == 77;
+ 241 540 : return model == 28 || model == 38 || model == 54
+ 242 270 : || model == 39 || model == 53 || model == 74
+ 243 270 : || model == 90 || model == 55 || model == 76
+ 244 540 : || model == 93 || model == 77;
245 : }
246 :
247 : /**
248 : * Check if the processor has a slow MULT implementation.
249 : * If yes, it's better to use a hash not based on multiplication.
250 : */
- 251 263 : static inline int raid_cpu_has_slowmult(void)
+ 251 269 : static inline int raid_cpu_has_slowmult(void)
252 : {
253 : char vendor[CPU_VENDOR_MAX];
254 : unsigned family;
@@ -320,9 +320,9 @@
258 : * In some cases Murmur3 based on MUL instruction,
259 : * is a LOT slower than Spooky2 based on SHIFTs.
260 : */
- 261 263 : raid_cpu_info(vendor, &family, &model);
+ 261 269 : raid_cpu_info(vendor, &family, &model);
262 :
- 263 263 : if (strcmp(vendor, "GenuineIntel") == 0) {
+ 263 269 : if (strcmp(vendor, "GenuineIntel") == 0) {
264 : /*
265 : * Intel Atom (Model 28)
266 : * murmur3:378 MB/s, spooky2:3413 MB/s (x86)
@@ -330,18 +330,18 @@
268 : * Intel Atom (Model 77)
269 : * murmur3:1311 MB/s, spooky2:4056 MB/s (x64)
270 : */
- 271 263 : if (raid_cpu_is_atom(family, model))
+ 271 269 : if (raid_cpu_is_atom(family, model))
272 0 : return 1;
273 : }
274 :
- 275 263 : return 0;
+ 275 269 : return 0;
276 : }
277 :
278 : /**
279 : * Check if the processor has a slow extended set of SSE registers.
280 : * If yes, it's better to limit the unroll to the firsrt 8 registers.
281 : */
- 282 1 : static inline int raid_cpu_has_slowextendedreg(void)
+ 282 4 : static inline int raid_cpu_has_slowextendedreg(void)
283 : {
284 : char vendor[CPU_VENDOR_MAX];
285 : unsigned family;
@@ -352,9 +352,9 @@
290 : * is a LITTLE slower than the one using only the first 8 registers.
291 : * This doesn't happen for PARZ.
292 : */
- 293 1 : raid_cpu_info(vendor, &family, &model);
+ 293 4 : raid_cpu_info(vendor, &family, &model);
294 :
- 295 1 : if (strcmp(vendor, "AuthenticAMD") == 0) {
+ 295 4 : if (strcmp(vendor, "AuthenticAMD") == 0) {
296 : /*
297 : * AMD Bulldozer
298 : * par2_sse2:4922 MB/s, par2_sse2e:4465 MB/s
@@ -363,7 +363,7 @@
301 0 : return 1;
302 : }
303 :
- 304 1 : if (strcmp(vendor, "GenuineIntel") == 0) {
+ 304 4 : if (strcmp(vendor, "GenuineIntel") == 0) {
305 : /*
306 : * Intel Atom (Model 77)
307 : * par2_sse2:5686 MB/s, par2_sse2e:5250 MB/s
@@ -381,11 +381,11 @@
319 : * par5_sse3:910 MB/s, par5_sse3e:675 MB/s
320 : * par6_sse3:720 MB/s, par6_sse3e:534 MB/s
321 : */
- 322 1 : if (raid_cpu_is_atom(family, model))
+ 322 4 : if (raid_cpu_is_atom(family, model))
323 0 : return 1;
324 : }
325 :
- 326 1 : return 0;
+ 326 4 : return 0;
327 : }
328 : #endif
329 :
diff --git a/cov/raid/gf.h.gcov.html b/cov/raid/gf.h.gcov.html
index 9f8b54a0..7e9160c7 100644
--- a/cov/raid/gf.h.gcov.html
+++ b/cov/raid/gf.h.gcov.html
@@ -88,7 +88,7 @@
26 : */
27 : static __always_inline uint8_t mul(uint8_t a, uint8_t b)
28 : {
- 29 20945506 : return gfmul[a][b];
+ 29 23795594 : return gfmul[a][b];
30 : }
31 :
32 : /*
@@ -97,9 +97,9 @@
35 : */
36 : static __always_inline uint8_t inv(uint8_t v)
37 : {
- 38 559286 : BUG_ON(v == 0); /* division by zero */
+ 38 635882 : BUG_ON(v == 0); /* division by zero */
39 :
- 40 559286 : return gfinv[v];
+ 40 635882 : return gfinv[v];
41 : }
42 :
43 : /*
@@ -117,7 +117,7 @@
55 : */
56 : static __always_inline const uint8_t *table(uint8_t v)
57 : {
- 58 407657 : return gfmul[v];
+ 58 409825 : return gfmul[v];
59 : }
60 :
61 : /*
@@ -125,7 +125,7 @@
63 : */
64 : static __always_inline uint8_t A(int p, int d)
65 : {
- 66 2283216 : return gfgen[p][d];
+ 66 2605358 : return gfgen[p][d];
67 : }
68 :
69 : /*
@@ -148,12 +148,12 @@
86 : */
87 : static __always_inline uint32_t x2_32(uint32_t v)
88 : {
- 89 9180992 : uint32_t mask = v & 0x80808080U;
+ 89 33036096 : uint32_t mask = v & 0x80808080U;
90 :
- 91 9180992 : mask = (mask << 1) - (mask >> 7);
- 92 9180992 : v = (v << 1) & 0xfefefefeU;
- 93 9180992 : v ^= mask & 0x1d1d1d1dU;
- 94 9180992 : return v;
+ 91 33036096 : mask = (mask << 1) - (mask >> 7);
+ 92 33036096 : v = (v << 1) & 0xfefefefeU;
+ 93 33036096 : v ^= mask & 0x1d1d1d1dU;
+ 94 33036096 : return v;
95 : }
96 :
97 : /*
@@ -161,12 +161,12 @@
99 : */
100 : static __always_inline uint64_t x2_64(uint64_t v)
101 : {
- 102 5278624 : uint64_t mask = v & 0x8080808080808080ULL;
+ 102 16518048 : uint64_t mask = v & 0x8080808080808080ULL;
103 :
- 104 5278624 : mask = (mask << 1) - (mask >> 7);
- 105 5278624 : v = (v << 1) & 0xfefefefefefefefeULL;
- 106 5278624 : v ^= mask & 0x1d1d1d1d1d1d1d1dULL;
- 107 5278624 : return v;
+ 104 16518048 : mask = (mask << 1) - (mask >> 7);
+ 105 16518048 : v = (v << 1) & 0xfefefefefefefefeULL;
+ 106 16518048 : v ^= mask & 0x1d1d1d1d1d1d1d1dULL;
+ 107 16518048 : return v;
108 : }
109 :
110 : /*
@@ -174,12 +174,12 @@
112 : */
113 : static __always_inline uint32_t d2_32(uint32_t v)
114 : {
- 115 3672000 : uint32_t mask = v & 0x01010101U;
+ 115 12847040 : uint32_t mask = v & 0x01010101U;
116 :
- 117 3672000 : mask = (mask << 8) - mask;
- 118 3672000 : v = (v >> 1) & 0x7f7f7f7fU;
- 119 3672000 : v ^= mask & 0x8e8e8e8eU;
- 120 3672000 : return v;
+ 117 12847040 : mask = (mask << 8) - mask;
+ 118 12847040 : v = (v >> 1) & 0x7f7f7f7fU;
+ 119 12847040 : v ^= mask & 0x8e8e8e8eU;
+ 120 12847040 : return v;
121 : }
122 :
123 : /*
@@ -187,12 +187,12 @@
125 : */
126 : static __always_inline uint64_t d2_64(uint64_t v)
127 : {
- 128 2065376 : uint64_t mask = v & 0x0101010101010101ULL;
+ 128 6423520 : uint64_t mask = v & 0x0101010101010101ULL;
129 :
- 130 2065376 : mask = (mask << 8) - mask;
- 131 2065376 : v = (v >> 1) & 0x7f7f7f7f7f7f7f7fULL;
- 132 2065376 : v ^= mask & 0x8e8e8e8e8e8e8e8eULL;
- 133 2065376 : return v;
+ 130 6423520 : mask = (mask << 8) - mask;
+ 131 6423520 : v = (v >> 1) & 0x7f7f7f7f7f7f7f7fULL;
+ 132 6423520 : v ^= mask & 0x8e8e8e8e8e8e8e8eULL;
+ 133 6423520 : return v;
134 : }
135 :
136 : #endif
diff --git a/cov/raid/index-sort-f.html b/cov/raid/index-sort-f.html
index 2b5ed72e..414d4725 100644
--- a/cov/raid/index-sort-f.html
+++ b/cov/raid/index-sort-f.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
-
+
+
 |
@@ -69,33 +69,13 @@
Line Coverage  |
Functions  |
-
- | x86.c |
-
-
- |
- 75.1 % |
- 514 / 684 |
- 64.3 % |
- 9 / 14 |
-
-
- | cpu.h |
-
-
- |
- 69.7 % |
- 53 / 76 |
- 91.7 % |
- 11 / 12 |
-
| internal.h |
-
+
|
- 80.0 % |
- 4 / 5 |
+ 100.0 % |
+ 5 / 5 |
- |
0 / 0 |
@@ -172,20 +152,20 @@
| module.c |
-
+
|
- 95.0 % |
- 151 / 159 |
+ 100.0 % |
+ 159 / 159 |
100.0 % |
7 / 7 |
| test.c |
-
+
|
- 96.4 % |
- 135 / 140 |
+ 100.0 % |
+ 140 / 140 |
100.0 % |
7 / 7 |
@@ -219,6 +199,26 @@
100.0 % |
11 / 11 |
+
+ | cpu.h |
+
+
+ |
+ 84.2 % |
+ 64 / 76 |
+ 100.0 % |
+ 12 / 12 |
+
+
+ | x86.c |
+
+
+ |
+ 100.0 % |
+ 684 / 684 |
+ 100.0 % |
+ 14 / 14 |
+
diff --git a/cov/raid/index-sort-l.html b/cov/raid/index-sort-l.html
index 443508fd..20edac5d 100644
--- a/cov/raid/index-sort-l.html
+++ b/cov/raid/index-sort-l.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
-
+
+
 |
@@ -72,53 +72,23 @@
| cpu.h |
-
+
|
- 69.7 % |
- 53 / 76 |
- 91.7 % |
- 11 / 12 |
-
-
- | x86.c |
-
-
- |
- 75.1 % |
- 514 / 684 |
- 64.3 % |
- 9 / 14 |
+ 84.2 % |
+ 64 / 76 |
+ 100.0 % |
+ 12 / 12 |
| internal.h |
-
+
|
- 80.0 % |
- 4 / 5 |
+ 100.0 % |
+ 5 / 5 |
- |
0 / 0 |
-
- | module.c |
-
-
- |
- 95.0 % |
- 151 / 159 |
- 100.0 % |
- 7 / 7 |
-
-
- | test.c |
-
-
- |
- 96.4 % |
- 135 / 140 |
- 100.0 % |
- 7 / 7 |
-
| tag.c |
@@ -209,6 +179,26 @@
| 100.0 % |
9 / 9 |
+
+ | test.c |
+
+
+ |
+ 100.0 % |
+ 140 / 140 |
+ 100.0 % |
+ 7 / 7 |
+
+
+ | module.c |
+
+
+ |
+ 100.0 % |
+ 159 / 159 |
+ 100.0 % |
+ 7 / 7 |
+
| int.c |
@@ -219,6 +209,16 @@
| 100.0 % |
11 / 11 |
+
+ | x86.c |
+
+
+ |
+ 100.0 % |
+ 684 / 684 |
+ 100.0 % |
+ 14 / 14 |
+
diff --git a/cov/raid/index.html b/cov/raid/index.html
index 55e5d948..7b6cf792 100644
--- a/cov/raid/index.html
+++ b/cov/raid/index.html
@@ -31,18 +31,18 @@
|
-
+
-
+
|
-
-
+
+
 |
@@ -92,12 +92,12 @@
| cpu.h |
-
+
|
- 69.7 % |
- 53 / 76 |
- 91.7 % |
- 11 / 12 |
+ 84.2 % |
+ 64 / 76 |
+ 100.0 % |
+ 12 / 12 |
| gf.h |
@@ -132,10 +132,10 @@
| internal.h |
-
+
|
- 80.0 % |
- 4 / 5 |
+ 100.0 % |
+ 5 / 5 |
- |
0 / 0 |
@@ -162,10 +162,10 @@
| module.c |
-
+
|
- 95.0 % |
- 151 / 159 |
+ 100.0 % |
+ 159 / 159 |
100.0 % |
7 / 7 |
@@ -192,22 +192,22 @@
| test.c |
-
+
|
- 96.4 % |
- 135 / 140 |
+ 100.0 % |
+ 140 / 140 |
100.0 % |
7 / 7 |
| x86.c |
-
+
|
- 75.1 % |
- 514 / 684 |
- 64.3 % |
- 9 / 14 |
+ 100.0 % |
+ 684 / 684 |
+ 100.0 % |
+ 14 / 14 |
| x86z.c |
diff --git a/cov/raid/int.c.func-sort-c.html b/cov/raid/int.c.func-sort-c.html
index b687b929..47981ef9 100644
--- a/cov/raid/int.c.func-sort-c.html
+++ b/cov/raid/int.c.func-sort-c.html
@@ -61,47 +61,47 @@
| raid_recX_int8 |
- 17753 |
+ 17849 |
| raid_rec2_int8 |
- 1204 |
-
-
- | raid_rec1_int8 |
- 124 |
+ 1220 |
| raid_gen1_int64 |
- 54 |
+ 184 |
+
+
+ | raid_rec1_int8 |
+ 164 |
| raid_gen1_int32 |
- 34 |
+ 112 |
| raid_gen2_int64 |
- 17 |
+ 47 |
| raid_gen2_int32 |
- 15 |
+ 47 |
| raid_gen3_int8 |
- 5 |
+ 26 |
| raid_gen4_int8 |
- 5 |
+ 18 |
| raid_gen5_int8 |
- 4 |
+ 18 |
| raid_gen6_int8 |
- 4 |
+ 17 |
diff --git a/cov/raid/int.c.func.html b/cov/raid/int.c.func.html
index b89ebf25..e7929128 100644
--- a/cov/raid/int.c.func.html
+++ b/cov/raid/int.c.func.html
@@ -61,47 +61,47 @@
| raid_gen1_int32 |
- 34 |
+ 112 |
| raid_gen1_int64 |
- 54 |
+ 184 |
| raid_gen2_int32 |
- 15 |
+ 47 |
| raid_gen2_int64 |
- 17 |
+ 47 |
| raid_gen3_int8 |
- 5 |
+ 26 |
| raid_gen4_int8 |
- 5 |
+ 18 |
| raid_gen5_int8 |
- 4 |
+ 18 |
| raid_gen6_int8 |
- 4 |
+ 17 |
| raid_rec1_int8 |
- 124 |
+ 164 |
| raid_rec2_int8 |
- 1204 |
+ 1220 |
| raid_recX_int8 |
- 17753 |
+ 17849 |
diff --git a/cov/raid/int.c.gcov.html b/cov/raid/int.c.gcov.html
index 76f87c4c..268fab74 100644
--- a/cov/raid/int.c.gcov.html
+++ b/cov/raid/int.c.gcov.html
@@ -80,9 +80,9 @@
18 : /*
19 : * GEN1 (RAID5 with xor) 32bit C implementation
20 : */
- 21 34 : void raid_gen1_int32(int nd, size_t size, void **vv)
+ 21 112 : void raid_gen1_int32(int nd, size_t size, void **vv)
22 : {
- 23 34 : uint8_t **v = (uint8_t **)vv;
+ 23 112 : uint8_t **v = (uint8_t **)vv;
24 : uint8_t *p;
25 : int d, l;
26 : size_t i;
@@ -90,27 +90,27 @@
28 : uint32_t p0;
29 : uint32_t p1;
30 :
- 31 34 : l = nd - 1;
- 32 34 : p = v[nd];
+ 31 112 : l = nd - 1;
+ 32 112 : p = v[nd];
33 :
- 34 1015938 : for (i = 0; i < size; i += 8) {
- 35 1015904 : p0 = v_32(v[l][i]);
- 36 1015904 : p1 = v_32(v[l][i + 4]);
- 37 8128544 : for (d = l - 1; d >= 0; --d) {
- 38 7112640 : p0 ^= v_32(v[d][i]);
- 39 7112640 : p1 ^= v_32(v[d][i + 4]);
+ 34 3571920 : for (i = 0; i < size; i += 8) {
+ 35 3571808 : p0 = v_32(v[l][i]);
+ 36 3571808 : p1 = v_32(v[l][i + 4]);
+ 37 28575776 : for (d = l - 1; d >= 0; --d) {
+ 38 25003968 : p0 ^= v_32(v[d][i]);
+ 39 25003968 : p1 ^= v_32(v[d][i + 4]);
40 : }
- 41 1015904 : v_32(p[i]) = p0;
- 42 1015904 : v_32(p[i + 4]) = p1;
+ 41 3571808 : v_32(p[i]) = p0;
+ 42 3571808 : v_32(p[i + 4]) = p1;
43 : }
- 44 34 : }
+ 44 112 : }
45 :
46 : /*
47 : * GEN1 (RAID5 with xor) 64bit C implementation
48 : */
- 49 54 : void raid_gen1_int64(int nd, size_t size, void **vv)
+ 49 184 : void raid_gen1_int64(int nd, size_t size, void **vv)
50 : {
- 51 54 : uint8_t **v = (uint8_t **)vv;
+ 51 184 : uint8_t **v = (uint8_t **)vv;
52 : uint8_t *p;
53 : int d, l;
54 : size_t i;
@@ -118,27 +118,27 @@
56 : uint64_t p0;
57 : uint64_t p1;
58 :
- 59 54 : l = nd - 1;
- 60 54 : p = v[nd];
+ 59 184 : l = nd - 1;
+ 60 184 : p = v[nd];
61 :
- 62 835686 : for (i = 0; i < size; i += 16) {
- 63 835632 : p0 = v_64(v[l][i]);
- 64 835632 : p1 = v_64(v[l][i + 8]);
- 65 6685712 : for (d = l - 1; d >= 0; --d) {
- 66 5850080 : p0 ^= v_64(v[d][i]);
- 67 5850080 : p1 ^= v_64(v[d][i + 8]);
+ 62 2965736 : for (i = 0; i < size; i += 16) {
+ 63 2965552 : p0 = v_64(v[l][i]);
+ 64 2965552 : p1 = v_64(v[l][i + 8]);
+ 65 23725072 : for (d = l - 1; d >= 0; --d) {
+ 66 20759520 : p0 ^= v_64(v[d][i]);
+ 67 20759520 : p1 ^= v_64(v[d][i + 8]);
68 : }
- 69 835632 : v_64(p[i]) = p0;
- 70 835632 : v_64(p[i + 8]) = p1;
+ 69 2965552 : v_64(p[i]) = p0;
+ 70 2965552 : v_64(p[i + 8]) = p1;
71 : }
- 72 54 : }
+ 72 184 : }
73 :
74 : /*
75 : * GEN2 (RAID6 with powers of 2) 32bit C implementation
76 : */
- 77 15 : void raid_gen2_int32(int nd, size_t size, void **vv)
+ 77 47 : void raid_gen2_int32(int nd, size_t size, void **vv)
78 : {
- 79 15 : uint8_t **v = (uint8_t **)vv;
+ 79 47 : uint8_t **v = (uint8_t **)vv;
80 : uint8_t *p;
81 : uint8_t *q;
82 : int d, l;
@@ -147,39 +147,39 @@
85 : uint32_t d0, q0, p0;
86 : uint32_t d1, q1, p1;
87 :
- 88 15 : l = nd - 1;
- 89 15 : p = v[nd];
- 90 15 : q = v[nd + 1];
+ 88 47 : l = nd - 1;
+ 89 47 : p = v[nd];
+ 90 47 : q = v[nd + 1];
91 :
- 92 393327 : for (i = 0; i < size; i += 8) {
- 93 393312 : q0 = p0 = v_32(v[l][i]);
- 94 393312 : q1 = p1 = v_32(v[l][i + 4]);
- 95 3147808 : for (d = l - 1; d >= 0; --d) {
- 96 2754496 : d0 = v_32(v[d][i]);
- 97 2754496 : d1 = v_32(v[d][i + 4]);
+ 92 1441935 : for (i = 0; i < size; i += 8) {
+ 93 1441888 : q0 = p0 = v_32(v[l][i]);
+ 94 1441888 : q1 = p1 = v_32(v[l][i + 4]);
+ 95 11536416 : for (d = l - 1; d >= 0; --d) {
+ 96 10094528 : d0 = v_32(v[d][i]);
+ 97 10094528 : d1 = v_32(v[d][i + 4]);
98 :
- 99 2754496 : p0 ^= d0;
- 100 2754496 : p1 ^= d1;
+ 99 10094528 : p0 ^= d0;
+ 100 10094528 : p1 ^= d1;
101 :
- 102 2754496 : q0 = x2_32(q0);
- 103 2754496 : q1 = x2_32(q1);
+ 102 10094528 : q0 = x2_32(q0);
+ 103 10094528 : q1 = x2_32(q1);
104 :
- 105 2754496 : q0 ^= d0;
- 106 2754496 : q1 ^= d1;
+ 105 10094528 : q0 ^= d0;
+ 106 10094528 : q1 ^= d1;
107 : }
- 108 393312 : v_32(p[i]) = p0;
- 109 393312 : v_32(p[i + 4]) = p1;
- 110 393312 : v_32(q[i]) = q0;
- 111 393312 : v_32(q[i + 4]) = q1;
+ 108 1441888 : v_32(p[i]) = p0;
+ 109 1441888 : v_32(p[i + 4]) = p1;
+ 110 1441888 : v_32(q[i]) = q0;
+ 111 1441888 : v_32(q[i + 4]) = q1;
112 : }
- 113 15 : }
+ 113 47 : }
114 :
115 : /*
116 : * GEN2 (RAID6 with powers of 2) 64bit C implementation
117 : */
- 118 17 : void raid_gen2_int64(int nd, size_t size, void **vv)
+ 118 47 : void raid_gen2_int64(int nd, size_t size, void **vv)
119 : {
- 120 17 : uint8_t **v = (uint8_t **)vv;
+ 120 47 : uint8_t **v = (uint8_t **)vv;
121 : uint8_t *p;
122 : uint8_t *q;
123 : int d, l;
@@ -188,32 +188,32 @@
126 : uint64_t d0, q0, p0;
127 : uint64_t d1, q1, p1;
128 :
- 129 17 : l = nd - 1;
- 130 17 : p = v[nd];
- 131 17 : q = v[nd + 1];
+ 129 47 : l = nd - 1;
+ 130 47 : p = v[nd];
+ 131 47 : q = v[nd + 1];
132 :
- 133 229441 : for (i = 0; i < size; i += 16) {
- 134 229424 : q0 = p0 = v_64(v[l][i]);
- 135 229424 : q1 = p1 = v_64(v[l][i + 8]);
- 136 1836048 : for (d = l - 1; d >= 0; --d) {
- 137 1606624 : d0 = v_64(v[d][i]);
- 138 1606624 : d1 = v_64(v[d][i + 8]);
+ 133 720991 : for (i = 0; i < size; i += 16) {
+ 134 720944 : q0 = p0 = v_64(v[l][i]);
+ 135 720944 : q1 = p1 = v_64(v[l][i + 8]);
+ 136 5768208 : for (d = l - 1; d >= 0; --d) {
+ 137 5047264 : d0 = v_64(v[d][i]);
+ 138 5047264 : d1 = v_64(v[d][i + 8]);
139 :
- 140 1606624 : p0 ^= d0;
- 141 1606624 : p1 ^= d1;
+ 140 5047264 : p0 ^= d0;
+ 141 5047264 : p1 ^= d1;
142 :
- 143 1606624 : q0 = x2_64(q0);
- 144 1606624 : q1 = x2_64(q1);
+ 143 5047264 : q0 = x2_64(q0);
+ 144 5047264 : q1 = x2_64(q1);
145 :
- 146 1606624 : q0 ^= d0;
- 147 1606624 : q1 ^= d1;
+ 146 5047264 : q0 ^= d0;
+ 147 5047264 : q1 ^= d1;
148 : }
- 149 229424 : v_64(p[i]) = p0;
- 150 229424 : v_64(p[i + 8]) = p1;
- 151 229424 : v_64(q[i]) = q0;
- 152 229424 : v_64(q[i + 8]) = q1;
+ 149 720944 : v_64(p[i]) = p0;
+ 150 720944 : v_64(p[i + 8]) = p1;
+ 151 720944 : v_64(q[i]) = q0;
+ 152 720944 : v_64(q[i + 8]) = q1;
153 : }
- 154 17 : }
+ 154 47 : }
155 :
156 : /*
157 : * GEN3 (triple parity with Cauchy matrix) 8bit C implementation
@@ -223,9 +223,9 @@
161 : * But this is only a kind of reference function, and we are not really
162 : * interested in speed.
163 : */
- 164 5 : void raid_gen3_int8(int nd, size_t size, void **vv)
+ 164 26 : void raid_gen3_int8(int nd, size_t size, void **vv)
165 : {
- 166 5 : uint8_t **v = (uint8_t **)vv;
+ 166 26 : uint8_t **v = (uint8_t **)vv;
167 : uint8_t *p;
168 : uint8_t *q;
169 : uint8_t *r;
@@ -234,33 +234,33 @@
172 :
173 : uint8_t d0, r0, q0, p0;
174 :
- 175 5 : l = nd - 1;
- 176 5 : p = v[nd];
- 177 5 : q = v[nd + 1];
- 178 5 : r = v[nd + 2];
+ 175 26 : l = nd - 1;
+ 176 26 : p = v[nd];
+ 177 26 : q = v[nd + 1];
+ 178 26 : r = v[nd + 2];
179 :
- 180 786949 : for (i = 0; i < size; i += 1) {
- 181 786944 : p0 = q0 = r0 = 0;
- 182 6299904 : for (d = l; d > 0; --d) {
- 183 5512960 : d0 = v_8(v[d][i]);
+ 180 6291994 : for (i = 0; i < size; i += 1) {
+ 181 6291968 : p0 = q0 = r0 = 0;
+ 182 50340096 : for (d = l; d > 0; --d) {
+ 183 44048128 : d0 = v_8(v[d][i]);
184 :
- 185 5512960 : p0 ^= d0;
- 186 5512960 : q0 ^= gfmul[d0][gfgen[1][d]];
- 187 5512960 : r0 ^= gfmul[d0][gfgen[2][d]];
+ 185 44048128 : p0 ^= d0;
+ 186 44048128 : q0 ^= gfmul[d0][gfgen[1][d]];
+ 187 44048128 : r0 ^= gfmul[d0][gfgen[2][d]];
188 : }
189 :
190 : /* first disk with all coefficients at 1 */
- 191 786944 : d0 = v_8(v[0][i]);
+ 191 6291968 : d0 = v_8(v[0][i]);
192 :
- 193 786944 : p0 ^= d0;
- 194 786944 : q0 ^= d0;
- 195 786944 : r0 ^= d0;
+ 193 6291968 : p0 ^= d0;
+ 194 6291968 : q0 ^= d0;
+ 195 6291968 : r0 ^= d0;
196 :
- 197 786944 : v_8(p[i]) = p0;
- 198 786944 : v_8(q[i]) = q0;
- 199 786944 : v_8(r[i]) = r0;
+ 197 6291968 : v_8(p[i]) = p0;
+ 198 6291968 : v_8(q[i]) = q0;
+ 199 6291968 : v_8(r[i]) = r0;
200 : }
- 201 5 : }
+ 201 26 : }
202 :
203 : /*
204 : * GEN4 (quad parity with Cauchy matrix) 8bit C implementation
@@ -270,9 +270,9 @@
208 : * But this is only a kind of reference function, and we are not really
209 : * interested in speed.
210 : */
- 211 5 : void raid_gen4_int8(int nd, size_t size, void **vv)
+ 211 18 : void raid_gen4_int8(int nd, size_t size, void **vv)
212 : {
- 213 5 : uint8_t **v = (uint8_t **)vv;
+ 213 18 : uint8_t **v = (uint8_t **)vv;
214 : uint8_t *p;
215 : uint8_t *q;
216 : uint8_t *r;
@@ -282,37 +282,37 @@
220 :
221 : uint8_t d0, s0, r0, q0, p0;
222 :
- 223 5 : l = nd - 1;
- 224 5 : p = v[nd];
- 225 5 : q = v[nd + 1];
- 226 5 : r = v[nd + 2];
- 227 5 : s = v[nd + 3];
+ 223 18 : l = nd - 1;
+ 224 18 : p = v[nd];
+ 225 18 : q = v[nd + 1];
+ 226 18 : r = v[nd + 2];
+ 227 18 : s = v[nd + 3];
228 :
- 229 786949 : for (i = 0; i < size; i += 1) {
- 230 786944 : p0 = q0 = r0 = s0 = 0;
- 231 6299904 : for (d = l; d > 0; --d) {
- 232 5512960 : d0 = v_8(v[d][i]);
+ 229 4194834 : for (i = 0; i < size; i += 1) {
+ 230 4194816 : p0 = q0 = r0 = s0 = 0;
+ 231 33562880 : for (d = l; d > 0; --d) {
+ 232 29368064 : d0 = v_8(v[d][i]);
233 :
- 234 5512960 : p0 ^= d0;
- 235 5512960 : q0 ^= gfmul[d0][gfgen[1][d]];
- 236 5512960 : r0 ^= gfmul[d0][gfgen[2][d]];
- 237 5512960 : s0 ^= gfmul[d0][gfgen[3][d]];
+ 234 29368064 : p0 ^= d0;
+ 235 29368064 : q0 ^= gfmul[d0][gfgen[1][d]];
+ 236 29368064 : r0 ^= gfmul[d0][gfgen[2][d]];
+ 237 29368064 : s0 ^= gfmul[d0][gfgen[3][d]];
238 : }
239 :
240 : /* first disk with all coefficients at 1 */
- 241 786944 : d0 = v_8(v[0][i]);
+ 241 4194816 : d0 = v_8(v[0][i]);
242 :
- 243 786944 : p0 ^= d0;
- 244 786944 : q0 ^= d0;
- 245 786944 : r0 ^= d0;
- 246 786944 : s0 ^= d0;
+ 243 4194816 : p0 ^= d0;
+ 244 4194816 : q0 ^= d0;
+ 245 4194816 : r0 ^= d0;
+ 246 4194816 : s0 ^= d0;
247 :
- 248 786944 : v_8(p[i]) = p0;
- 249 786944 : v_8(q[i]) = q0;
- 250 786944 : v_8(r[i]) = r0;
- 251 786944 : v_8(s[i]) = s0;
+ 248 4194816 : v_8(p[i]) = p0;
+ 249 4194816 : v_8(q[i]) = q0;
+ 250 4194816 : v_8(r[i]) = r0;
+ 251 4194816 : v_8(s[i]) = s0;
252 : }
- 253 5 : }
+ 253 18 : }
254 :
255 : /*
256 : * GEN5 (penta parity with Cauchy matrix) 8bit C implementation
@@ -322,9 +322,9 @@
260 : * But this is only a kind of reference function, and we are not really
261 : * interested in speed.
262 : */
- 263 4 : void raid_gen5_int8(int nd, size_t size, void **vv)
+ 263 18 : void raid_gen5_int8(int nd, size_t size, void **vv)
264 : {
- 265 4 : uint8_t **v = (uint8_t **)vv;
+ 265 18 : uint8_t **v = (uint8_t **)vv;
266 : uint8_t *p;
267 : uint8_t *q;
268 : uint8_t *r;
@@ -335,41 +335,41 @@
273 :
274 : uint8_t d0, t0, s0, r0, q0, p0;
275 :
- 276 4 : l = nd - 1;
- 277 4 : p = v[nd];
- 278 4 : q = v[nd + 1];
- 279 4 : r = v[nd + 2];
- 280 4 : s = v[nd + 3];
- 281 4 : t = v[nd + 4];
+ 276 18 : l = nd - 1;
+ 277 18 : p = v[nd];
+ 278 18 : q = v[nd + 1];
+ 279 18 : r = v[nd + 2];
+ 280 18 : s = v[nd + 3];
+ 281 18 : t = v[nd + 4];
282 :
- 283 524804 : for (i = 0; i < size; i += 1) {
- 284 524800 : p0 = q0 = r0 = s0 = t0 = 0;
- 285 4202752 : for (d = l; d > 0; --d) {
- 286 3677952 : d0 = v_8(v[d][i]);
+ 283 4194834 : for (i = 0; i < size; i += 1) {
+ 284 4194816 : p0 = q0 = r0 = s0 = t0 = 0;
+ 285 33562880 : for (d = l; d > 0; --d) {
+ 286 29368064 : d0 = v_8(v[d][i]);
287 :
- 288 3677952 : p0 ^= d0;
- 289 3677952 : q0 ^= gfmul[d0][gfgen[1][d]];
- 290 3677952 : r0 ^= gfmul[d0][gfgen[2][d]];
- 291 3677952 : s0 ^= gfmul[d0][gfgen[3][d]];
- 292 3677952 : t0 ^= gfmul[d0][gfgen[4][d]];
+ 288 29368064 : p0 ^= d0;
+ 289 29368064 : q0 ^= gfmul[d0][gfgen[1][d]];
+ 290 29368064 : r0 ^= gfmul[d0][gfgen[2][d]];
+ 291 29368064 : s0 ^= gfmul[d0][gfgen[3][d]];
+ 292 29368064 : t0 ^= gfmul[d0][gfgen[4][d]];
293 : }
294 :
295 : /* first disk with all coefficients at 1 */
- 296 524800 : d0 = v_8(v[0][i]);
+ 296 4194816 : d0 = v_8(v[0][i]);
297 :
- 298 524800 : p0 ^= d0;
- 299 524800 : q0 ^= d0;
- 300 524800 : r0 ^= d0;
- 301 524800 : s0 ^= d0;
- 302 524800 : t0 ^= d0;
+ 298 4194816 : p0 ^= d0;
+ 299 4194816 : q0 ^= d0;
+ 300 4194816 : r0 ^= d0;
+ 301 4194816 : s0 ^= d0;
+ 302 4194816 : t0 ^= d0;
303 :
- 304 524800 : v_8(p[i]) = p0;
- 305 524800 : v_8(q[i]) = q0;
- 306 524800 : v_8(r[i]) = r0;
- 307 524800 : v_8(s[i]) = s0;
- 308 524800 : v_8(t[i]) = t0;
+ 304 4194816 : v_8(p[i]) = p0;
+ 305 4194816 : v_8(q[i]) = q0;
+ 306 4194816 : v_8(r[i]) = r0;
+ 307 4194816 : v_8(s[i]) = s0;
+ 308 4194816 : v_8(t[i]) = t0;
309 : }
- 310 4 : }
+ 310 18 : }
311 :
312 : /*
313 : * GEN6 (hexa parity with Cauchy matrix) 8bit C implementation
@@ -379,9 +379,9 @@
317 : * But this is only a kind of reference function, and we are not really
318 : * interested in speed.
319 : */
- 320 4 : void raid_gen6_int8(int nd, size_t size, void **vv)
+ 320 17 : void raid_gen6_int8(int nd, size_t size, void **vv)
321 : {
- 322 4 : uint8_t **v = (uint8_t **)vv;
+ 322 17 : uint8_t **v = (uint8_t **)vv;
323 : uint8_t *p;
324 : uint8_t *q;
325 : uint8_t *r;
@@ -393,45 +393,45 @@
331 :
332 : uint8_t d0, u0, t0, s0, r0, q0, p0;
333 :
- 334 4 : l = nd - 1;
- 335 4 : p = v[nd];
- 336 4 : q = v[nd + 1];
- 337 4 : r = v[nd + 2];
- 338 4 : s = v[nd + 3];
- 339 4 : t = v[nd + 4];
- 340 4 : u = v[nd + 5];
+ 334 17 : l = nd - 1;
+ 335 17 : p = v[nd];
+ 336 17 : q = v[nd + 1];
+ 337 17 : r = v[nd + 2];
+ 338 17 : s = v[nd + 3];
+ 339 17 : t = v[nd + 4];
+ 340 17 : u = v[nd + 5];
341 :
- 342 524804 : for (i = 0; i < size; i += 1) {
- 343 524800 : p0 = q0 = r0 = s0 = t0 = u0 = 0;
- 344 4202752 : for (d = l; d > 0; --d) {
- 345 3677952 : d0 = v_8(v[d][i]);
+ 342 3932689 : for (i = 0; i < size; i += 1) {
+ 343 3932672 : p0 = q0 = r0 = s0 = t0 = u0 = 0;
+ 344 31465728 : for (d = l; d > 0; --d) {
+ 345 27533056 : d0 = v_8(v[d][i]);
346 :
- 347 3677952 : p0 ^= d0;
- 348 3677952 : q0 ^= gfmul[d0][gfgen[1][d]];
- 349 3677952 : r0 ^= gfmul[d0][gfgen[2][d]];
- 350 3677952 : s0 ^= gfmul[d0][gfgen[3][d]];
- 351 3677952 : t0 ^= gfmul[d0][gfgen[4][d]];
- 352 3677952 : u0 ^= gfmul[d0][gfgen[5][d]];
+ 347 27533056 : p0 ^= d0;
+ 348 27533056 : q0 ^= gfmul[d0][gfgen[1][d]];
+ 349 27533056 : r0 ^= gfmul[d0][gfgen[2][d]];
+ 350 27533056 : s0 ^= gfmul[d0][gfgen[3][d]];
+ 351 27533056 : t0 ^= gfmul[d0][gfgen[4][d]];
+ 352 27533056 : u0 ^= gfmul[d0][gfgen[5][d]];
353 : }
354 :
355 : /* first disk with all coefficients at 1 */
- 356 524800 : d0 = v_8(v[0][i]);
+ 356 3932672 : d0 = v_8(v[0][i]);
357 :
- 358 524800 : p0 ^= d0;
- 359 524800 : q0 ^= d0;
- 360 524800 : r0 ^= d0;
- 361 524800 : s0 ^= d0;
- 362 524800 : t0 ^= d0;
- 363 524800 : u0 ^= d0;
+ 358 3932672 : p0 ^= d0;
+ 359 3932672 : q0 ^= d0;
+ 360 3932672 : r0 ^= d0;
+ 361 3932672 : s0 ^= d0;
+ 362 3932672 : t0 ^= d0;
+ 363 3932672 : u0 ^= d0;
364 :
- 365 524800 : v_8(p[i]) = p0;
- 366 524800 : v_8(q[i]) = q0;
- 367 524800 : v_8(r[i]) = r0;
- 368 524800 : v_8(s[i]) = s0;
- 369 524800 : v_8(t[i]) = t0;
- 370 524800 : v_8(u[i]) = u0;
+ 365 3932672 : v_8(p[i]) = p0;
+ 366 3932672 : v_8(q[i]) = q0;
+ 367 3932672 : v_8(r[i]) = r0;
+ 368 3932672 : v_8(s[i]) = s0;
+ 369 3932672 : v_8(t[i]) = t0;
+ 370 3932672 : v_8(u[i]) = u0;
371 : }
- 372 4 : }
+ 372 17 : }
373 :
374 : /*
375 : * Recover failure of one data block at index id[0] using parity at index
@@ -445,9 +445,9 @@
383 : *
384 : * Dx = A[ip[0],id[0]]^-1 * Pd
385 : */
- 386 124 : void raid_rec1_int8(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 386 164 : void raid_rec1_int8(int nr, int *id, int *ip, int nd, size_t size, void **vv)
387 : {
- 388 124 : uint8_t **v = (uint8_t **)vv;
+ 388 164 : uint8_t **v = (uint8_t **)vv;
389 : uint8_t *p;
390 : uint8_t *pa;
391 : const uint8_t *T;
@@ -458,32 +458,32 @@
396 : (void)nr; /* unused, it's always 1 */
397 :
398 : /* if it's RAID5 uses the faster function */
- 399 124 : if (ip[0] == 0) {
+ 399 164 : if (ip[0] == 0) {
400 24 : raid_rec1of1(id, nd, size, vv);
- 401 148 : return;
+ 401 188 : return;
402 : }
403 :
404 : /* setup the coefficients matrix */
- 405 200 : G = A(ip[0], id[0]);
+ 405 280 : G = A(ip[0], id[0]);
406 :
407 : /* invert it to solve the system of linear equations */
- 408 200 : V = inv(G);
+ 408 280 : V = inv(G);
409 :
410 : /* get multiplication tables */
- 411 200 : T = table(V);
+ 411 280 : T = table(V);
412 :
413 : /* compute delta parity */
- 414 100 : raid_delta_gen(1, id, ip, nd, size, vv);
+ 414 140 : raid_delta_gen(1, id, ip, nd, size, vv);
415 :
- 416 100 : p = v[nd + ip[0]];
- 417 100 : pa = v[id[0]];
+ 416 140 : p = v[nd + ip[0]];
+ 417 140 : pa = v[id[0]];
418 :
- 419 4215908 : for (i = 0; i < size; ++i) {
+ 419 14701708 : for (i = 0; i < size; ++i) {
420 : /* delta */
- 421 4215808 : uint8_t Pd = p[i] ^ pa[i];
+ 421 14701568 : uint8_t Pd = p[i] ^ pa[i];
422 :
423 : /* reconstruct */
- 424 4215808 : pa[i] = T[Pd];
+ 424 14701568 : pa[i] = T[Pd];
425 : }
426 : }
427 :
@@ -498,57 +498,57 @@
436 : *
437 : * we solve inverting the coefficients matrix.
438 : */
- 439 1204 : void raid_rec2_int8(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 439 1220 : void raid_rec2_int8(int nr, int *id, int *ip, int nd, size_t size, void **vv)
440 : {
- 441 1204 : uint8_t **v = (uint8_t **)vv;
+ 441 1220 : uint8_t **v = (uint8_t **)vv;
442 : uint8_t *p;
443 : uint8_t *pa;
444 : uint8_t *q;
445 : uint8_t *qa;
- 446 1204 : const int N = 2;
- 447 1204 : const uint8_t *T[N][N];
- 448 1204 : uint8_t G[N * N];
- 449 1204 : uint8_t V[N * N];
+ 446 1220 : const int N = 2;
+ 447 1220 : const uint8_t *T[N][N];
+ 448 1220 : uint8_t G[N * N];
+ 449 1220 : uint8_t V[N * N];
450 : size_t i;
451 : int j, k;
452 :
453 : (void)nr; /* unused, it's always 2 */
454 :
455 : /* if it's RAID6 recovering with P and Q uses the faster function */
- 456 1204 : if (ip[0] == 0 && ip[1] == 1) {
+ 456 1220 : if (ip[0] == 0 && ip[1] == 1) {
457 132 : raid_rec2of2_int8(id, ip, nd, size, vv);
- 458 1336 : return;
+ 458 1352 : return;
459 : }
460 :
461 : /* setup the coefficients matrix */
- 462 3216 : for (j = 0; j < N; ++j)
- 463 6432 : for (k = 0; k < N; ++k)
- 464 8576 : G[j * N + k] = A(ip[j], id[k]);
+ 462 3264 : for (j = 0; j < N; ++j)
+ 463 6528 : for (k = 0; k < N; ++k)
+ 464 8704 : G[j * N + k] = A(ip[j], id[k]);
465 :
466 : /* invert it to solve the system of linear equations */
- 467 1072 : raid_invert(G, V, N);
+ 467 1088 : raid_invert(G, V, N);
468 :
469 : /* get multiplication tables */
- 470 3216 : for (j = 0; j < N; ++j)
- 471 6432 : for (k = 0; k < N; ++k)
- 472 8576 : T[j][k] = table(V[j * N + k]);
+ 470 3264 : for (j = 0; j < N; ++j)
+ 471 6528 : for (k = 0; k < N; ++k)
+ 472 8704 : T[j][k] = table(V[j * N + k]);
473 :
474 : /* compute delta parity */
- 475 1072 : raid_delta_gen(2, id, ip, nd, size, vv);
+ 475 1088 : raid_delta_gen(2, id, ip, nd, size, vv);
476 :
- 477 1072 : p = v[nd + ip[0]];
- 478 1072 : q = v[nd + ip[1]];
- 479 1072 : pa = v[id[0]];
- 480 1072 : qa = v[id[1]];
+ 477 1088 : p = v[nd + ip[0]];
+ 478 1088 : q = v[nd + ip[1]];
+ 479 1088 : pa = v[id[0]];
+ 480 1088 : qa = v[id[1]];
481 :
- 482 4465712 : for (i = 0; i < size; ++i) {
+ 482 8660032 : for (i = 0; i < size; ++i) {
483 : /* delta */
- 484 4464640 : uint8_t Pd = p[i] ^ pa[i];
- 485 4464640 : uint8_t Qd = q[i] ^ qa[i];
+ 484 8658944 : uint8_t Pd = p[i] ^ pa[i];
+ 485 8658944 : uint8_t Qd = q[i] ^ qa[i];
486 :
487 : /* reconstruct */
- 488 4464640 : pa[i] = T[0][0][Pd] ^ T[0][1][Qd];
- 489 4464640 : qa[i] = T[1][0][Pd] ^ T[1][1][Qd];
+ 488 8658944 : pa[i] = T[0][0][Pd] ^ T[0][1][Qd];
+ 489 8658944 : qa[i] = T[1][0][Pd] ^ T[1][1][Qd];
490 : }
491 : }
492 :
@@ -566,9 +566,9 @@
504 : * PD[0] = Pd, PD[1] = Qd, PD[2] = Rd, ...
505 : * D[0] = Dx, D[1] = Dy, D[2] = Dz, ...
506 : */
- 507 17753 : void raid_recX_int8(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 507 17849 : void raid_recX_int8(int nr, int *id, int *ip, int nd, size_t size, void **vv)
508 : {
- 509 17753 : uint8_t **v = (uint8_t **)vv;
+ 509 17849 : uint8_t **v = (uint8_t **)vv;
510 : uint8_t *p[RAID_PARITY_MAX];
511 : uint8_t *pa[RAID_PARITY_MAX];
512 : const uint8_t *T[RAID_PARITY_MAX][RAID_PARITY_MAX];
@@ -578,43 +578,43 @@
516 : int j, k;
517 :
518 : /* setup the coefficients matrix */
- 519 90761 : for (j = 0; j < nr; ++j)
- 520 386140 : for (k = 0; k < nr; ++k)
- 521 626264 : G[j * nr + k] = A(ip[j], id[k]);
+ 519 91289 : for (j = 0; j < nr; ++j)
+ 520 388636 : for (k = 0; k < nr; ++k)
+ 521 630392 : G[j * nr + k] = A(ip[j], id[k]);
522 :
523 : /* invert it to solve the system of linear equations */
- 524 17753 : raid_invert(G, V, nr);
+ 524 17849 : raid_invert(G, V, nr);
525 :
526 : /* get multiplication tables */
- 527 90761 : for (j = 0; j < nr; ++j)
- 528 386140 : for (k = 0; k < nr; ++k)
- 529 626264 : T[j][k] = table(V[j * nr + k]);
+ 527 91289 : for (j = 0; j < nr; ++j)
+ 528 388636 : for (k = 0; k < nr; ++k)
+ 529 630392 : T[j][k] = table(V[j * nr + k]);
530 :
531 : /* compute delta parity */
- 532 17753 : raid_delta_gen(nr, id, ip, nd, size, vv);
+ 532 17849 : raid_delta_gen(nr, id, ip, nd, size, vv);
533 :
- 534 90761 : for (j = 0; j < nr; ++j) {
- 535 73008 : p[j] = v[nd + ip[j]];
- 536 73008 : pa[j] = v[id[j]];
+ 534 91289 : for (j = 0; j < nr; ++j) {
+ 535 73440 : p[j] = v[nd + ip[j]];
+ 536 73440 : pa[j] = v[id[j]];
537 : }
538 :
- 539 12942937 : for (i = 0; i < size; ++i) {
+ 539 38108857 : for (i = 0; i < size; ++i) {
540 : uint8_t PD[RAID_PARITY_MAX];
541 :
542 : /* delta */
- 543 69327104 : for (j = 0; j < nr; ++j)
- 544 56401920 : PD[j] = p[j][i] ^ pa[j][i];
+ 543 207739136 : for (j = 0; j < nr; ++j)
+ 544 169648128 : PD[j] = p[j][i] ^ pa[j][i];
545 :
546 : /* reconstruct */
- 547 69327104 : for (j = 0; j < nr; ++j) {
- 548 56401920 : uint8_t b = 0;
+ 547 207739136 : for (j = 0; j < nr; ++j) {
+ 548 169648128 : uint8_t b = 0;
549 :
- 550 316742656 : for (k = 0; k < nr; ++k)
- 551 260340736 : b ^= T[j][k][PD[k]];
- 552 56401920 : pa[j][i] = b;
+ 550 971054080 : for (k = 0; k < nr; ++k)
+ 551 801405952 : b ^= T[j][k][PD[k]];
+ 552 169648128 : pa[j][i] = b;
553 : }
554 : }
- 555 17753 : }
+ 555 17849 : }
556 :
diff --git a/cov/raid/internal.h.func-sort-c.html b/cov/raid/internal.h.func-sort-c.html
index 14300261..15b7beef 100644
--- a/cov/raid/internal.h.func-sort-c.html
+++ b/cov/raid/internal.h.func-sort-c.html
@@ -31,9 +31,9 @@
|
-
-
+
+
diff --git a/cov/raid/internal.h.func.html b/cov/raid/internal.h.func.html
index 2da416e7..9a7d4543 100644
--- a/cov/raid/internal.h.func.html
+++ b/cov/raid/internal.h.func.html
@@ -31,9 +31,9 @@
|
-
-
+
+
diff --git a/cov/raid/internal.h.gcov.html b/cov/raid/internal.h.gcov.html
index 8596c3bf..2810fbf1 100644
--- a/cov/raid/internal.h.gcov.html
+++ b/cov/raid/internal.h.gcov.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -169,11 +169,11 @@
107 : */
108 : static __always_inline void *__align_ptr(void *ptr, uintptr_t size)
109 : {
- 110 677265 : uintptr_t offset = (uintptr_t)ptr;
+ 110 711847 : uintptr_t offset = (uintptr_t)ptr;
111 :
- 112 677265 : offset = (offset + size - 1U) & ~(size - 1U);
+ 112 711847 : offset = (offset + size - 1U) & ~(size - 1U);
113 :
- 114 677265 : return (void *)offset;
+ 114 711847 : return (void *)offset;
115 : }
116 :
117 : /*
@@ -294,7 +294,7 @@
232 : /* that use a weak memory model. To ensure that other processors */
233 : /* see correctly the data written, we use a store-store memory */
234 : /* barrier at the end of the asm code */
- 235 1349449 : asm volatile ("sfence" : : : "memory");
+ 235 1388678 : asm volatile ("sfence" : : : "memory");
236 :
237 : /* clobbers registers used in the asm code */
238 : /* this is required because in the Windows ABI, */
@@ -327,7 +327,7 @@
265 : /* reset the upper part of the ymm registers */
266 : /* to avoid the 70 clocks penality on the next */
267 : /* xmm register use */
- 268 0 : asm volatile ("vzeroupper" : : : "memory");
+ 268 19675 : asm volatile ("vzeroupper" : : : "memory");
269 : }
270 : #endif
271 : #endif /* CONFIG_X86 */
diff --git a/cov/raid/intz.c.func-sort-c.html b/cov/raid/intz.c.func-sort-c.html
index 09f6bbdd..f0eebc82 100644
--- a/cov/raid/intz.c.func-sort-c.html
+++ b/cov/raid/intz.c.func-sort-c.html
@@ -61,11 +61,11 @@
| raid_genz_int64 |
- 10 |
+ 29 |
| raid_genz_int32 |
- 9 |
+ 29 |
diff --git a/cov/raid/intz.c.func.html b/cov/raid/intz.c.func.html
index 369297c1..d03542db 100644
--- a/cov/raid/intz.c.func.html
+++ b/cov/raid/intz.c.func.html
@@ -61,11 +61,11 @@
| raid_genz_int32 |
- 9 |
+ 29 |
| raid_genz_int64 |
- 10 |
+ 29 |
diff --git a/cov/raid/intz.c.gcov.html b/cov/raid/intz.c.gcov.html
index 008990d8..90778a8f 100644
--- a/cov/raid/intz.c.gcov.html
+++ b/cov/raid/intz.c.gcov.html
@@ -80,9 +80,9 @@
18 : /*
19 : * GENz (triple parity with powers of 2^-1) 32bit C implementation
20 : */
- 21 9 : void raid_genz_int32(int nd, size_t size, void **vv)
+ 21 29 : void raid_genz_int32(int nd, size_t size, void **vv)
22 : {
- 23 9 : uint8_t **v = (uint8_t**)vv;
+ 23 29 : uint8_t **v = (uint8_t**)vv;
24 : uint8_t *p;
25 : uint8_t *q;
26 : uint8_t *r;
@@ -92,48 +92,48 @@
30 : uint32_t d0, r0, q0, p0;
31 : uint32_t d1, r1, q1, p1;
32 :
- 33 9 : l = nd - 1;
- 34 9 : p = v[nd];
- 35 9 : q = v[nd + 1];
- 36 9 : r = v[nd + 2];
+ 33 29 : l = nd - 1;
+ 34 29 : p = v[nd];
+ 35 29 : q = v[nd + 1];
+ 36 29 : r = v[nd + 2];
37 :
- 38 262185 : for (i = 0; i < size; i += 8) {
- 39 262176 : r0 = q0 = p0 = v_32(v[l][i]);
- 40 262176 : r1 = q1 = p1 = v_32(v[l][i + 4]);
- 41 2098176 : for (d = l - 1; d >= 0; --d) {
- 42 1836000 : d0 = v_32(v[d][i]);
- 43 1836000 : d1 = v_32(v[d][i + 4]);
+ 38 917565 : for (i = 0; i < size; i += 8) {
+ 39 917536 : r0 = q0 = p0 = v_32(v[l][i]);
+ 40 917536 : r1 = q1 = p1 = v_32(v[l][i + 4]);
+ 41 7341056 : for (d = l - 1; d >= 0; --d) {
+ 42 6423520 : d0 = v_32(v[d][i]);
+ 43 6423520 : d1 = v_32(v[d][i + 4]);
44 :
- 45 1836000 : p0 ^= d0;
- 46 1836000 : p1 ^= d1;
+ 45 6423520 : p0 ^= d0;
+ 46 6423520 : p1 ^= d1;
47 :
- 48 1836000 : q0 = x2_32(q0);
- 49 1836000 : q1 = x2_32(q1);
+ 48 6423520 : q0 = x2_32(q0);
+ 49 6423520 : q1 = x2_32(q1);
50 :
- 51 1836000 : q0 ^= d0;
- 52 1836000 : q1 ^= d1;
+ 51 6423520 : q0 ^= d0;
+ 52 6423520 : q1 ^= d1;
53 :
- 54 1836000 : r0 = d2_32(r0);
- 55 1836000 : r1 = d2_32(r1);
+ 54 6423520 : r0 = d2_32(r0);
+ 55 6423520 : r1 = d2_32(r1);
56 :
- 57 1836000 : r0 ^= d0;
- 58 1836000 : r1 ^= d1;
+ 57 6423520 : r0 ^= d0;
+ 58 6423520 : r1 ^= d1;
59 : }
- 60 262176 : v_32(p[i]) = p0;
- 61 262176 : v_32(p[i + 4]) = p1;
- 62 262176 : v_32(q[i]) = q0;
- 63 262176 : v_32(q[i + 4]) = q1;
- 64 262176 : v_32(r[i]) = r0;
- 65 262176 : v_32(r[i + 4]) = r1;
+ 60 917536 : v_32(p[i]) = p0;
+ 61 917536 : v_32(p[i + 4]) = p1;
+ 62 917536 : v_32(q[i]) = q0;
+ 63 917536 : v_32(q[i + 4]) = q1;
+ 64 917536 : v_32(r[i]) = r0;
+ 65 917536 : v_32(r[i + 4]) = r1;
66 : }
- 67 9 : }
+ 67 29 : }
68 :
69 : /*
70 : * GENz (triple parity with powers of 2^-1) 64bit C implementation
71 : */
- 72 10 : void raid_genz_int64(int nd, size_t size, void **vv)
+ 72 29 : void raid_genz_int64(int nd, size_t size, void **vv)
73 : {
- 74 10 : uint8_t **v = (uint8_t**)vv;
+ 74 29 : uint8_t **v = (uint8_t**)vv;
75 : uint8_t *p;
76 : uint8_t *q;
77 : uint8_t *r;
@@ -143,41 +143,41 @@
81 : uint64_t d0, r0, q0, p0;
82 : uint64_t d1, r1, q1, p1;
83 :
- 84 10 : l = nd - 1;
- 85 10 : p = v[nd];
- 86 10 : q = v[nd + 1];
- 87 10 : r = v[nd + 2];
+ 84 29 : l = nd - 1;
+ 85 29 : p = v[nd];
+ 86 29 : q = v[nd + 1];
+ 87 29 : r = v[nd + 2];
88 :
- 89 147482 : for (i = 0; i < size; i += 16) {
- 90 147472 : r0 = q0 = p0 = v_64(v[l][i]);
- 91 147472 : r1 = q1 = p1 = v_64(v[l][i + 8]);
- 92 1180160 : for (d = l - 1; d >= 0; --d) {
- 93 1032688 : d0 = v_64(v[d][i]);
- 94 1032688 : d1 = v_64(v[d][i + 8]);
+ 89 458797 : for (i = 0; i < size; i += 16) {
+ 90 458768 : r0 = q0 = p0 = v_64(v[l][i]);
+ 91 458768 : r1 = q1 = p1 = v_64(v[l][i + 8]);
+ 92 3670528 : for (d = l - 1; d >= 0; --d) {
+ 93 3211760 : d0 = v_64(v[d][i]);
+ 94 3211760 : d1 = v_64(v[d][i + 8]);
95 :
- 96 1032688 : p0 ^= d0;
- 97 1032688 : p1 ^= d1;
+ 96 3211760 : p0 ^= d0;
+ 97 3211760 : p1 ^= d1;
98 :
- 99 1032688 : q0 = x2_64(q0);
- 100 1032688 : q1 = x2_64(q1);
+ 99 3211760 : q0 = x2_64(q0);
+ 100 3211760 : q1 = x2_64(q1);
101 :
- 102 1032688 : q0 ^= d0;
- 103 1032688 : q1 ^= d1;
+ 102 3211760 : q0 ^= d0;
+ 103 3211760 : q1 ^= d1;
104 :
- 105 1032688 : r0 = d2_64(r0);
- 106 1032688 : r1 = d2_64(r1);
+ 105 3211760 : r0 = d2_64(r0);
+ 106 3211760 : r1 = d2_64(r1);
107 :
- 108 1032688 : r0 ^= d0;
- 109 1032688 : r1 ^= d1;
+ 108 3211760 : r0 ^= d0;
+ 109 3211760 : r1 ^= d1;
110 : }
- 111 147472 : v_64(p[i]) = p0;
- 112 147472 : v_64(p[i + 8]) = p1;
- 113 147472 : v_64(q[i]) = q0;
- 114 147472 : v_64(q[i + 8]) = q1;
- 115 147472 : v_64(r[i]) = r0;
- 116 147472 : v_64(r[i + 8]) = r1;
+ 111 458768 : v_64(p[i]) = p0;
+ 112 458768 : v_64(p[i + 8]) = p1;
+ 113 458768 : v_64(q[i]) = q0;
+ 114 458768 : v_64(q[i + 8]) = q1;
+ 115 458768 : v_64(r[i]) = r0;
+ 116 458768 : v_64(r[i + 8]) = r1;
117 : }
- 118 10 : }
+ 118 29 : }
119 :
diff --git a/cov/raid/memory.c.func-sort-c.html b/cov/raid/memory.c.func-sort-c.html
index d83db3e5..400cab45 100644
--- a/cov/raid/memory.c.func-sort-c.html
+++ b/cov/raid/memory.c.func-sort-c.html
@@ -61,15 +61,15 @@
| raid_malloc_align |
- 12682 |
+ 12558 |
| raid_malloc_vector |
- 12496 |
+ 12372 |
| raid_malloc_vector_align |
- 12496 |
+ 12372 |
| raid_malloc |
diff --git a/cov/raid/memory.c.func.html b/cov/raid/memory.c.func.html
index add16e11..ed9cc46b 100644
--- a/cov/raid/memory.c.func.html
+++ b/cov/raid/memory.c.func.html
@@ -65,15 +65,15 @@
| raid_malloc_align |
- 12682 |
+ 12558 |
| raid_malloc_vector |
- 12496 |
+ 12372 |
| raid_malloc_vector_align |
- 12496 |
+ 12372 |
| raid_mrand_vector |
diff --git a/cov/raid/memory.c.gcov.html b/cov/raid/memory.c.gcov.html
index d156eb68..36942cce 100644
--- a/cov/raid/memory.c.gcov.html
+++ b/cov/raid/memory.c.gcov.html
@@ -77,26 +77,26 @@
15 : #include "internal.h"
16 : #include "memory.h"
17 :
- 18 12682 : void *raid_malloc_align(size_t size, size_t align_size, void **freeptr)
+ 18 12558 : void *raid_malloc_align(size_t size, size_t align_size, void **freeptr)
19 : {
20 : unsigned char *ptr;
21 : uintptr_t offset;
22 :
- 23 12682 : ptr = malloc(size + align_size);
- 24 12682 : if (!ptr) {
+ 23 12558 : ptr = malloc(size + align_size);
+ 24 12558 : if (!ptr) {
25 : /* LCOV_EXCL_START */
26 : return 0;
27 : /* LCOV_EXCL_STOP */
28 : }
29 :
- 30 12682 : *freeptr = ptr;
+ 30 12558 : *freeptr = ptr;
31 :
- 32 12682 : offset = ((uintptr_t)ptr) % align_size;
+ 32 12558 : offset = ((uintptr_t)ptr) % align_size;
33 :
- 34 12682 : if (offset != 0)
- 35 12292 : ptr += align_size - offset;
+ 34 12558 : if (offset != 0)
+ 35 12172 : ptr += align_size - offset;
36 :
- 37 12682 : return ptr;
+ 37 12558 : return ptr;
38 : }
39 :
40 179 : void *raid_malloc(size_t size, void **freeptr)
@@ -104,49 +104,49 @@
42 179 : return raid_malloc_align(size, RAID_MALLOC_ALIGN, freeptr);
43 : }
44 :
- 45 12496 : void **raid_malloc_vector_align(int nd, int n, size_t size, size_t align_size, size_t displacement_size, void **freeptr)
+ 45 12372 : void **raid_malloc_vector_align(int nd, int n, size_t size, size_t align_size, size_t displacement_size, void **freeptr)
46 : {
47 : void **v;
48 : unsigned char *va;
49 : int i;
50 :
- 51 12496 : BUG_ON(n <= 0 || nd < 0);
+ 51 12372 : BUG_ON(n <= 0 || nd < 0);
52 :
- 53 12496 : v = malloc(n * sizeof(void *));
- 54 12496 : if (!v) {
+ 53 12372 : v = malloc(n * sizeof(void *));
+ 54 12372 : if (!v) {
55 : /* LCOV_EXCL_START */
56 : return 0;
57 : /* LCOV_EXCL_STOP */
58 : }
59 :
- 60 12496 : va = raid_malloc_align(n * (size + displacement_size), align_size, freeptr);
- 61 12496 : if (!va) {
+ 60 12372 : va = raid_malloc_align(n * (size + displacement_size), align_size, freeptr);
+ 61 12372 : if (!va) {
62 : /* LCOV_EXCL_START */
63 : free(v);
64 : return 0;
65 : /* LCOV_EXCL_STOP */
66 : }
67 :
- 68 167903 : for (i = 0; i < n; ++i) {
- 69 155407 : v[i] = va;
- 70 155407 : va += size + displacement_size;
+ 68 166935 : for (i = 0; i < n; ++i) {
+ 69 154563 : v[i] = va;
+ 70 154563 : va += size + displacement_size;
71 : }
72 :
73 : /* reverse order of the data blocks */
74 : /* because they are usually accessed from the last one */
- 75 50019 : for (i = 0; i < nd / 2; ++i) {
- 76 37523 : void *ptr = v[i];
+ 75 49526 : for (i = 0; i < nd / 2; ++i) {
+ 76 37154 : void *ptr = v[i];
77 :
- 78 37523 : v[i] = v[nd - 1 - i];
- 79 37523 : v[nd - 1 - i] = ptr;
+ 78 37154 : v[i] = v[nd - 1 - i];
+ 79 37154 : v[nd - 1 - i] = ptr;
80 : }
81 :
- 82 12496 : return v;
+ 82 12372 : return v;
83 : }
84 :
- 85 12496 : void **raid_malloc_vector(int nd, int n, size_t size, void **freeptr)
+ 85 12372 : void **raid_malloc_vector(int nd, int n, size_t size, void **freeptr)
86 : {
- 87 12496 : return raid_malloc_vector_align(nd, n, size, RAID_MALLOC_ALIGN, RAID_MALLOC_DISPLACEMENT, freeptr);
+ 87 12372 : return raid_malloc_vector_align(nd, n, size, RAID_MALLOC_ALIGN, RAID_MALLOC_DISPLACEMENT, freeptr);
88 : }
89 :
90 5 : void raid_mrand_vector(unsigned seed, int n, size_t size, void **vv)
diff --git a/cov/raid/module.c.func-sort-c.html b/cov/raid/module.c.func-sort-c.html
index 304204a0..39519b44 100644
--- a/cov/raid/module.c.func-sort-c.html
+++ b/cov/raid/module.c.func-sort-c.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -61,7 +61,7 @@
| raid_init |
- 266 |
+ 269 |
| raid_test_rec |
diff --git a/cov/raid/module.c.func.html b/cov/raid/module.c.func.html
index 435691c6..ec058144 100644
--- a/cov/raid/module.c.func.html
+++ b/cov/raid/module.c.func.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -65,7 +65,7 @@
| raid_init |
- 266 |
+ 269 |
| raid_selftest |
diff --git a/cov/raid/module.c.gcov.html b/cov/raid/module.c.gcov.html
index 86b754e7..3264dd75 100644
--- a/cov/raid/module.c.gcov.html
+++ b/cov/raid/module.c.gcov.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -81,34 +81,34 @@
19 : /*
20 : * Initializes and selects the best algorithm.
21 : */
- 22 266 : void raid_init(void)
+ 22 269 : void raid_init(void)
23 : {
- 24 266 : raid_gen3_ptr = raid_gen3_int8;
- 25 266 : raid_gen_ptr[3] = raid_gen4_int8;
- 26 266 : raid_gen_ptr[4] = raid_gen5_int8;
- 27 266 : raid_gen_ptr[5] = raid_gen6_int8;
+ 24 269 : raid_gen3_ptr = raid_gen3_int8;
+ 25 269 : raid_gen_ptr[3] = raid_gen4_int8;
+ 26 269 : raid_gen_ptr[4] = raid_gen5_int8;
+ 27 269 : raid_gen_ptr[5] = raid_gen6_int8;
28 :
29 : if (sizeof(void *) == 4) {
- 30 266 : raid_gen_ptr[0] = raid_gen1_int32;
- 31 266 : raid_gen_ptr[1] = raid_gen2_int32;
- 32 266 : raid_genz_ptr = raid_genz_int32;
+ 30 269 : raid_gen_ptr[0] = raid_gen1_int32;
+ 31 269 : raid_gen_ptr[1] = raid_gen2_int32;
+ 32 269 : raid_genz_ptr = raid_genz_int32;
33 : } else {
34 : raid_gen_ptr[0] = raid_gen1_int64;
35 : raid_gen_ptr[1] = raid_gen2_int64;
36 : raid_genz_ptr = raid_genz_int64;
37 : }
38 :
- 39 266 : raid_rec_ptr[0] = raid_rec1_int8;
- 40 266 : raid_rec_ptr[1] = raid_rec2_int8;
- 41 266 : raid_rec_ptr[2] = raid_recX_int8;
- 42 266 : raid_rec_ptr[3] = raid_recX_int8;
- 43 266 : raid_rec_ptr[4] = raid_recX_int8;
- 44 266 : raid_rec_ptr[5] = raid_recX_int8;
+ 39 269 : raid_rec_ptr[0] = raid_rec1_int8;
+ 40 269 : raid_rec_ptr[1] = raid_rec2_int8;
+ 41 269 : raid_rec_ptr[2] = raid_recX_int8;
+ 42 269 : raid_rec_ptr[3] = raid_recX_int8;
+ 43 269 : raid_rec_ptr[4] = raid_recX_int8;
+ 44 269 : raid_rec_ptr[5] = raid_recX_int8;
45 :
46 : #ifdef CONFIG_X86
47 : #ifdef CONFIG_SSE2
- 48 266 : if (raid_cpu_has_sse2()) {
- 49 266 : raid_gen_ptr[0] = raid_gen1_sse2;
+ 48 269 : if (raid_cpu_has_sse2()) {
+ 49 269 : raid_gen_ptr[0] = raid_gen1_sse2;
50 : #ifdef CONFIG_X86_64
51 : if (raid_cpu_has_slowextendedreg()) {
52 : raid_gen_ptr[1] = raid_gen2_sse2;
@@ -118,14 +118,14 @@
56 : /* note that raid_cpu_has_slowextendedreg() doesn't affect parz */
57 : raid_genz_ptr = raid_genz_sse2ext;
58 : #else
- 59 266 : raid_gen_ptr[1] = raid_gen2_sse2;
- 60 266 : raid_genz_ptr = raid_genz_sse2;
+ 59 269 : raid_gen_ptr[1] = raid_gen2_sse2;
+ 60 269 : raid_genz_ptr = raid_genz_sse2;
61 : #endif
62 : }
63 : #endif
64 :
65 : #ifdef CONFIG_SSSE3
- 66 266 : if (raid_cpu_has_ssse3()) {
+ 66 269 : if (raid_cpu_has_ssse3()) {
67 : #ifdef CONFIG_X86_64
68 : if (raid_cpu_has_slowextendedreg()) {
69 : raid_gen3_ptr = raid_gen3_ssse3;
@@ -139,24 +139,24 @@
77 : raid_gen_ptr[5] = raid_gen6_ssse3ext;
78 : }
79 : #else
- 80 266 : raid_gen3_ptr = raid_gen3_ssse3;
- 81 266 : raid_gen_ptr[3] = raid_gen4_ssse3;
- 82 266 : raid_gen_ptr[4] = raid_gen5_ssse3;
- 83 266 : raid_gen_ptr[5] = raid_gen6_ssse3;
+ 80 268 : raid_gen3_ptr = raid_gen3_ssse3;
+ 81 268 : raid_gen_ptr[3] = raid_gen4_ssse3;
+ 82 268 : raid_gen_ptr[4] = raid_gen5_ssse3;
+ 83 268 : raid_gen_ptr[5] = raid_gen6_ssse3;
84 : #endif
- 85 266 : raid_rec_ptr[0] = raid_rec1_ssse3;
- 86 266 : raid_rec_ptr[1] = raid_rec2_ssse3;
- 87 266 : raid_rec_ptr[2] = raid_recX_ssse3;
- 88 266 : raid_rec_ptr[3] = raid_recX_ssse3;
- 89 266 : raid_rec_ptr[4] = raid_recX_ssse3;
- 90 266 : raid_rec_ptr[5] = raid_recX_ssse3;
+ 85 268 : raid_rec_ptr[0] = raid_rec1_ssse3;
+ 86 268 : raid_rec_ptr[1] = raid_rec2_ssse3;
+ 87 268 : raid_rec_ptr[2] = raid_recX_ssse3;
+ 88 268 : raid_rec_ptr[3] = raid_recX_ssse3;
+ 89 268 : raid_rec_ptr[4] = raid_recX_ssse3;
+ 90 268 : raid_rec_ptr[5] = raid_recX_ssse3;
91 : }
92 : #endif
93 :
94 : #ifdef CONFIG_AVX2
- 95 266 : if (raid_cpu_has_avx2()) {
- 96 0 : raid_gen_ptr[0] = raid_gen1_avx2;
- 97 0 : raid_gen_ptr[1] = raid_gen2_avx2;
+ 95 269 : if (raid_cpu_has_avx2()) {
+ 96 2 : raid_gen_ptr[0] = raid_gen1_avx2;
+ 97 2 : raid_gen_ptr[1] = raid_gen2_avx2;
98 : #ifdef CONFIG_X86_64
99 : raid_gen3_ptr = raid_gen3_avx2ext;
100 : raid_genz_ptr = raid_genz_avx2ext;
@@ -164,19 +164,19 @@
102 : raid_gen_ptr[4] = raid_gen5_avx2ext;
103 : raid_gen_ptr[5] = raid_gen6_avx2ext;
104 : #endif
- 105 0 : raid_rec_ptr[0] = raid_rec1_avx2;
- 106 0 : raid_rec_ptr[1] = raid_rec2_avx2;
- 107 0 : raid_rec_ptr[2] = raid_recX_avx2;
- 108 0 : raid_rec_ptr[3] = raid_recX_avx2;
- 109 0 : raid_rec_ptr[4] = raid_recX_avx2;
- 110 0 : raid_rec_ptr[5] = raid_recX_avx2;
+ 105 2 : raid_rec_ptr[0] = raid_rec1_avx2;
+ 106 2 : raid_rec_ptr[1] = raid_rec2_avx2;
+ 107 2 : raid_rec_ptr[2] = raid_recX_avx2;
+ 108 2 : raid_rec_ptr[3] = raid_recX_avx2;
+ 109 2 : raid_rec_ptr[4] = raid_recX_avx2;
+ 110 2 : raid_rec_ptr[5] = raid_recX_avx2;
111 : }
112 : #endif
113 : #endif /* CONFIG_X86 */
114 :
115 : /* set the default mode */
- 116 266 : raid_mode(RAID_MODE_CAUCHY);
- 117 266 : }
+ 116 269 : raid_mode(RAID_MODE_CAUCHY);
+ 117 269 : }
118 :
119 : /*
120 : * Reference parity computation.
diff --git a/cov/raid/raid.c.func-sort-c.html b/cov/raid/raid.c.func-sort-c.html
index 29f4be93..96d13cb1 100644
--- a/cov/raid/raid.c.func-sort-c.html
+++ b/cov/raid/raid.c.func-sort-c.html
@@ -61,23 +61,23 @@
| raid_gen |
- 1215931 |
+ 1235540 |
| raid_data |
- 214263 |
+ 214715 |
| raid_invert |
- 153448 |
+ 172728 |
| raid_delta_gen |
- 152288 |
+ 171710 |
| raid_rec1of1 |
- 101027 |
+ 101386 |
| raid_rec |
@@ -85,11 +85,11 @@
| raid_mode |
- 534 |
+ 537 |
| raid_zero |
- 205 |
+ 208 |
| raid_rec2of2_int8 |
diff --git a/cov/raid/raid.c.func.html b/cov/raid/raid.c.func.html
index b99c7832..90b2af40 100644
--- a/cov/raid/raid.c.func.html
+++ b/cov/raid/raid.c.func.html
@@ -61,23 +61,23 @@
| raid_data |
- 214263 |
+ 214715 |
| raid_delta_gen |
- 152288 |
+ 171710 |
| raid_gen |
- 1215931 |
+ 1235540 |
| raid_invert |
- 153448 |
+ 172728 |
| raid_mode |
- 534 |
+ 537 |
| raid_rec |
@@ -85,7 +85,7 @@
| raid_rec1of1 |
- 101027 |
+ 101386 |
| raid_rec2of2_int8 |
@@ -93,7 +93,7 @@
| raid_zero |
- 205 |
+ 208 |
diff --git a/cov/raid/raid.c.gcov.html b/cov/raid/raid.c.gcov.html
index c012ae9c..3319701e 100644
--- a/cov/raid/raid.c.gcov.html
+++ b/cov/raid/raid.c.gcov.html
@@ -235,26 +235,26 @@
173 : */
174 : const uint8_t (*raid_gfgen)[256];
175 :
- 176 534 : void raid_mode(int mode)
+ 176 537 : void raid_mode(int mode)
177 : {
- 178 534 : if (mode == RAID_MODE_VANDERMONDE) {
+ 178 537 : if (mode == RAID_MODE_VANDERMONDE) {
179 2 : raid_gen_ptr[2] = raid_genz_ptr;
180 2 : raid_gfgen = gfvandermonde;
181 : } else {
- 182 532 : raid_gen_ptr[2] = raid_gen3_ptr;
- 183 532 : raid_gfgen = gfcauchy;
+ 182 535 : raid_gen_ptr[2] = raid_gen3_ptr;
+ 183 535 : raid_gfgen = gfcauchy;
184 : }
- 185 534 : }
+ 185 537 : }
186 :
187 : /**
188 : * Buffer filled with 0 used in recovering.
189 : */
190 : static void *raid_zero_block;
191 :
- 192 205 : void raid_zero(void *zero)
+ 192 208 : void raid_zero(void *zero)
193 : {
- 194 205 : raid_zero_block = zero;
- 195 205 : }
+ 194 208 : raid_zero_block = zero;
+ 195 208 : }
196 :
197 : /*
198 : * Forwarders for parity computation.
@@ -282,17 +282,17 @@
220 : void (*raid_gen3_ptr)(int nd, size_t size, void **vv);
221 : void (*raid_genz_ptr)(int nd, size_t size, void **vv);
222 :
- 223 1215931 : void raid_gen(int nd, int np, size_t size, void **v)
+ 223 1235540 : void raid_gen(int nd, int np, size_t size, void **v)
224 : {
225 : /* enforce limit on size */
- 226 1215931 : BUG_ON(size % 64 != 0);
+ 226 1235540 : BUG_ON(size % 64 != 0);
227 :
228 : /* enforce limit on number of failures */
- 229 1215931 : BUG_ON(np < 1);
- 230 1215931 : BUG_ON(np > RAID_PARITY_MAX);
+ 229 1235540 : BUG_ON(np < 1);
+ 230 1235540 : BUG_ON(np > RAID_PARITY_MAX);
231 :
- 232 1215931 : raid_gen_ptr[np - 1](nd, size, v);
- 233 1215931 : }
+ 232 1235540 : raid_gen_ptr[np - 1](nd, size, v);
+ 233 1235540 : }
234 :
235 : /**
236 : * Inverts the square matrix M of size nxn into V.
@@ -305,44 +305,44 @@
243 : * @V Destination matrix where the result is put.
244 : * @n Number of rows and columns of the matrix.
245 : */
- 246 153448 : void raid_invert(uint8_t *M, uint8_t *V, int n)
+ 246 172728 : void raid_invert(uint8_t *M, uint8_t *V, int n)
247 : {
248 : int i, j, k;
249 :
250 : /* set the identity matrix in V */
- 251 702507 : for (i = 0; i < n; ++i)
- 252 2822312 : for (j = 0; j < n; ++j)
- 253 2273253 : V[i * n + j] = i == j;
+ 251 798241 : for (i = 0; i < n; ++i)
+ 252 3220766 : for (j = 0; j < n; ++j)
+ 253 2595253 : V[i * n + j] = i == j;
254 :
255 : /* for each element in the diagonal */
- 256 702507 : for (k = 0; k < n; ++k) {
+ 256 798241 : for (k = 0; k < n; ++k) {
257 : uint8_t f;
258 :
259 : /* the diagonal element cannot be 0 because */
260 : /* we are inverting matrices with all the square */
261 : /* submatrices not singular */
- 262 549059 : BUG_ON(M[k * n + k] == 0);
+ 262 625513 : BUG_ON(M[k * n + k] == 0);
263 :
264 : /* make the diagonal element to be 1 */
- 265 1098118 : f = inv(M[k * n + k]);
- 266 2822312 : for (j = 0; j < n; ++j) {
- 267 4546506 : M[k * n + j] = mul(f, M[k * n + j]);
- 268 4546506 : V[k * n + j] = mul(f, V[k * n + j]);
+ 265 1251026 : f = inv(M[k * n + k]);
+ 266 3220766 : for (j = 0; j < n; ++j) {
+ 267 5190506 : M[k * n + j] = mul(f, M[k * n + j]);
+ 268 5190506 : V[k * n + j] = mul(f, V[k * n + j]);
269 : }
270 :
271 : /* make all the elements over and under the diagonal */
272 : /* to be zero */
- 273 2822312 : for (i = 0; i < n; ++i) {
- 274 2273253 : if (i == k)
- 275 549059 : continue;
- 276 1724194 : f = M[i * n + k];
- 277 9923694 : for (j = 0; j < n; ++j) {
- 278 16399000 : M[i * n + j] ^= mul(f, M[k * n + j]);
- 279 16399000 : V[i * n + j] ^= mul(f, V[k * n + j]);
+ 273 3220766 : for (i = 0; i < n; ++i) {
+ 274 2595253 : if (i == k)
+ 275 625513 : continue;
+ 276 1969740 : f = M[i * n + k];
+ 277 11272284 : for (j = 0; j < n; ++j) {
+ 278 18605088 : M[i * n + j] ^= mul(f, M[k * n + j]);
+ 279 18605088 : V[i * n + j] ^= mul(f, V[k * n + j]);
280 : }
281 : }
282 : }
- 283 153448 : }
+ 283 172728 : }
284 :
285 : /**
286 : * Computes the parity without the missing data blocks
@@ -350,7 +350,7 @@
288 : *
289 : * This is the parity expressed as Pa,Qa,Ra,Sa,Ta,Ua in the equations.
290 : */
- 291 152288 : void raid_delta_gen(int nr, int *id, int *ip, int nd, size_t size, void **v)
+ 291 171710 : void raid_delta_gen(int nr, int *id, int *ip, int nd, size_t size, void **v)
292 : {
293 : void *p[RAID_PARITY_MAX];
294 : void *pa[RAID_PARITY_MAX];
@@ -360,17 +360,17 @@
298 :
299 : /* total number of parities we are going to process */
300 : /* they are both the used and the unused ones */
- 301 152288 : np = ip[nr - 1] + 1;
+ 301 171710 : np = ip[nr - 1] + 1;
302 :
303 : /* latest missing data block */
- 304 152288 : latest = v[id[nr - 1]];
+ 304 171710 : latest = v[id[nr - 1]];
305 :
306 : /* setup pointers for delta computation */
- 307 748814 : for (i = 0, j = 0; i < np; ++i) {
+ 307 873674 : for (i = 0, j = 0; i < np; ++i) {
308 : /* keep a copy of the original parity vector */
- 309 596526 : p[i] = v[nd + i];
+ 309 701964 : p[i] = v[nd + i];
310 :
- 311 596526 : if (ip[j] == i) {
+ 311 701964 : if (ip[j] == i) {
312 : /*
313 : * Set used parities to point to the missing
314 : * data blocks.
@@ -381,19 +381,19 @@
319 :
320 : /* the latest parity to use ends the for loop and */
321 : /* then it cannot happen to process more of them */
- 322 529225 : BUG_ON(j >= nr);
+ 322 605821 : BUG_ON(j >= nr);
323 :
324 : /* buffer for missing data blocks */
- 325 529225 : pa[j] = v[id[j]];
+ 325 605821 : pa[j] = v[id[j]];
326 :
327 : /* set at zero the missing data blocks */
- 328 529225 : v[id[j]] = raid_zero_block;
+ 328 605821 : v[id[j]] = raid_zero_block;
329 :
330 : /* compute the parity over the missing data blocks */
- 331 529225 : v[nd + i] = pa[j];
+ 331 605821 : v[nd + i] = pa[j];
332 :
333 : /* check for the next used entry */
- 334 529225 : ++j;
+ 334 605821 : ++j;
335 : } else {
336 : /*
337 : * Unused parities are going to be rewritten with
@@ -413,25 +413,25 @@
351 : * multiple times and only the latest write will
352 : * contain the correct data.
353 : */
- 354 67301 : v[nd + i] = latest;
+ 354 96143 : v[nd + i] = latest;
355 : }
356 : }
357 :
358 : /* all the parities have to be processed */
- 359 152288 : BUG_ON(j != nr);
+ 359 171710 : BUG_ON(j != nr);
360 :
361 : /* recompute the parity, note that np may be smaller than the */
362 : /* total number of parities available */
- 363 152288 : raid_gen(nd, np, size, v);
+ 363 171710 : raid_gen(nd, np, size, v);
364 :
365 : /* restore data buffers as before */
- 366 681513 : for (j = 0; j < nr; ++j)
- 367 529225 : v[id[j]] = pa[j];
+ 366 777531 : for (j = 0; j < nr; ++j)
+ 367 605821 : v[id[j]] = pa[j];
368 :
369 : /* restore parity buffers as before */
- 370 748814 : for (i = 0; i < np; ++i)
- 371 596526 : v[nd + i] = p[i];
- 372 152288 : }
+ 370 873674 : for (i = 0; i < np; ++i)
+ 371 701964 : v[nd + i] = p[i];
+ 372 171710 : }
373 :
374 : /**
375 : * Recover failure of one data block for PAR1.
@@ -444,29 +444,29 @@
382 : *
383 : * Dx = Pd
384 : */
- 385 101027 : void raid_rec1of1(int *id, int nd, size_t size, void **v)
+ 385 101386 : void raid_rec1of1(int *id, int nd, size_t size, void **v)
386 : {
387 : void *p;
388 : void *pa;
389 :
390 : /* for PAR1 we can directly compute the missing block */
391 : /* and we don't need to use the zero buffer */
- 392 101027 : p = v[nd];
- 393 101027 : pa = v[id[0]];
+ 392 101386 : p = v[nd];
+ 393 101386 : pa = v[id[0]];
394 :
395 : /* use the parity as missing data block */
- 396 101027 : v[id[0]] = p;
+ 396 101386 : v[id[0]] = p;
397 :
398 : /* compute the parity over the missing data block */
- 399 101027 : v[nd] = pa;
+ 399 101386 : v[nd] = pa;
400 :
401 : /* compute */
- 402 101027 : raid_gen(nd, 1, size, v);
+ 402 101386 : raid_gen(nd, 1, size, v);
403 :
404 : /* restore as before */
- 405 101027 : v[id[0]] = pa;
- 406 101027 : v[nd] = p;
- 407 101027 : }
+ 405 101386 : v[id[0]] = pa;
+ 406 101386 : v[nd] = p;
+ 407 101386 : }
408 :
409 : /**
410 : * Recover failure of two data blocks for PAR2.
@@ -615,36 +615,36 @@
553 12 : raid_gen(nd, ir[nr - 1] - nd + 1, size, v);
554 870 : }
555 :
- 556 214263 : void raid_data(int nr, int *id, int *ip, int nd, size_t size, void **v)
+ 556 214715 : void raid_data(int nr, int *id, int *ip, int nd, size_t size, void **v)
557 : {
558 : /* enforce limit on size */
- 559 214263 : BUG_ON(size % 64 != 0);
+ 559 214715 : BUG_ON(size % 64 != 0);
560 :
561 : /* enforce limit on number of failures */
- 562 214263 : BUG_ON(nr > nd);
- 563 214263 : BUG_ON(nr > RAID_PARITY_MAX);
+ 562 214715 : BUG_ON(nr > nd);
+ 563 214715 : BUG_ON(nr > RAID_PARITY_MAX);
564 :
565 : /* enforce order in index vector for data */
- 566 214263 : BUG_ON(nr >= 2 && id[0] >= id[1]);
- 567 214263 : BUG_ON(nr >= 3 && id[1] >= id[2]);
- 568 214263 : BUG_ON(nr >= 4 && id[2] >= id[3]);
- 569 214263 : BUG_ON(nr >= 5 && id[3] >= id[4]);
- 570 214263 : BUG_ON(nr >= 6 && id[4] >= id[5]);
+ 566 214715 : BUG_ON(nr >= 2 && id[0] >= id[1]);
+ 567 214715 : BUG_ON(nr >= 3 && id[1] >= id[2]);
+ 568 214715 : BUG_ON(nr >= 4 && id[2] >= id[3]);
+ 569 214715 : BUG_ON(nr >= 5 && id[3] >= id[4]);
+ 570 214715 : BUG_ON(nr >= 6 && id[4] >= id[5]);
571 :
572 : /* enforce limit on index vector for data */
- 573 214263 : BUG_ON(nr > 0 && id[nr-1] >= nd);
+ 573 214715 : BUG_ON(nr > 0 && id[nr-1] >= nd);
574 :
575 : /* enforce order in index vector for parity */
- 576 214263 : BUG_ON(nr >= 2 && ip[0] >= ip[1]);
- 577 214263 : BUG_ON(nr >= 3 && ip[1] >= ip[2]);
- 578 214263 : BUG_ON(nr >= 4 && ip[2] >= ip[3]);
- 579 214263 : BUG_ON(nr >= 5 && ip[3] >= ip[4]);
- 580 214263 : BUG_ON(nr >= 6 && ip[4] >= ip[5]);
+ 576 214715 : BUG_ON(nr >= 2 && ip[0] >= ip[1]);
+ 577 214715 : BUG_ON(nr >= 3 && ip[1] >= ip[2]);
+ 578 214715 : BUG_ON(nr >= 4 && ip[2] >= ip[3]);
+ 579 214715 : BUG_ON(nr >= 5 && ip[3] >= ip[4]);
+ 580 214715 : BUG_ON(nr >= 6 && ip[4] >= ip[5]);
581 :
582 : /* if failed data is present */
- 583 214263 : if (nr != 0)
- 584 214261 : raid_rec_ptr[nr - 1](nr, id, ip, nd, size, v);
- 585 214263 : }
+ 583 214715 : if (nr != 0)
+ 584 214713 : raid_rec_ptr[nr - 1](nr, id, ip, nd, size, v);
+ 585 214715 : }
586 :
diff --git a/cov/raid/tag.c.func-sort-c.html b/cov/raid/tag.c.func-sort-c.html
index 534a6470..5bae656b 100644
--- a/cov/raid/tag.c.func-sort-c.html
+++ b/cov/raid/tag.c.func-sort-c.html
@@ -61,47 +61,47 @@
| raid_tag |
- 13 |
+ 52 |
| raid_recX_tag |
- 4 |
+ 16 |
| raid_gen2_tag |
- 1 |
+ 4 |
| raid_gen4_tag |
- 1 |
+ 4 |
| raid_rec2_tag |
- 1 |
+ 4 |
| raid_genz_tag |
- 1 |
+ 4 |
| raid_rec1_tag |
- 1 |
+ 4 |
| raid_gen3_tag |
- 1 |
+ 4 |
| raid_gen1_tag |
- 1 |
+ 4 |
| raid_gen6_tag |
- 1 |
+ 4 |
| raid_gen5_tag |
- 1 |
+ 4 |
diff --git a/cov/raid/tag.c.func.html b/cov/raid/tag.c.func.html
index e5182739..3a6c7b23 100644
--- a/cov/raid/tag.c.func.html
+++ b/cov/raid/tag.c.func.html
@@ -61,47 +61,47 @@
| raid_gen1_tag |
- 1 |
-
-
- | raid_gen2_tag |
- 1 |
-
-
- | raid_gen3_tag |
- 1 |
-
-
- | raid_gen4_tag |
- 1 |
-
-
- | raid_gen5_tag |
- 1 |
-
-
- | raid_gen6_tag |
- 1 |
-
-
- | raid_genz_tag |
- 1 |
-
-
- | raid_rec1_tag |
- 1 |
-
-
- | raid_rec2_tag |
- 1 |
-
-
- | raid_recX_tag |
4 |
+
+ | raid_gen2_tag |
+ 4 |
+
+
+ | raid_gen3_tag |
+ 4 |
+
+
+ | raid_gen4_tag |
+ 4 |
+
+
+ | raid_gen5_tag |
+ 4 |
+
+
+ | raid_gen6_tag |
+ 4 |
+
+
+ | raid_genz_tag |
+ 4 |
+
+
+ | raid_rec1_tag |
+ 4 |
+
+
+ | raid_rec2_tag |
+ 4 |
+
+
+ | raid_recX_tag |
+ 16 |
+
| raid_tag |
- 13 |
+ 52 |
diff --git a/cov/raid/tag.c.gcov.html b/cov/raid/tag.c.gcov.html
index e048725b..9cc13623 100644
--- a/cov/raid/tag.c.gcov.html
+++ b/cov/raid/tag.c.gcov.html
@@ -140,14 +140,14 @@
78 : { 0, 0 }
79 : };
80 :
- 81 13 : static const char *raid_tag(void (*func)())
+ 81 52 : static const char *raid_tag(void (*func)())
82 : {
- 83 13 : struct raid_func *i = RAID_FUNC;
+ 83 52 : struct raid_func *i = RAID_FUNC;
84 :
- 85 267 : while (i->name != 0) {
- 86 254 : if (i->p == func)
- 87 13 : return i->name;
- 88 241 : ++i;
+ 85 994 : while (i->name != 0) {
+ 86 942 : if (i->p == func)
+ 87 52 : return i->name;
+ 88 890 : ++i;
89 : }
90 :
91 : /* LCOV_EXCL_START */
@@ -155,54 +155,54 @@
93 : /* LCOV_EXCL_STOP */
94 : }
95 :
- 96 1 : const char *raid_gen1_tag(void)
+ 96 4 : const char *raid_gen1_tag(void)
97 : {
- 98 1 : return raid_tag(raid_gen_ptr[0]);
+ 98 4 : return raid_tag(raid_gen_ptr[0]);
99 : }
100 :
- 101 1 : const char *raid_gen2_tag(void)
+ 101 4 : const char *raid_gen2_tag(void)
102 : {
- 103 1 : return raid_tag(raid_gen_ptr[1]);
+ 103 4 : return raid_tag(raid_gen_ptr[1]);
104 : }
105 :
- 106 1 : const char *raid_genz_tag(void)
+ 106 4 : const char *raid_genz_tag(void)
107 : {
- 108 1 : return raid_tag(raid_genz_ptr);
+ 108 4 : return raid_tag(raid_genz_ptr);
109 : }
110 :
- 111 1 : const char *raid_gen3_tag(void)
+ 111 4 : const char *raid_gen3_tag(void)
112 : {
- 113 1 : return raid_tag(raid_gen_ptr[2]);
+ 113 4 : return raid_tag(raid_gen_ptr[2]);
114 : }
115 :
- 116 1 : const char *raid_gen4_tag(void)
+ 116 4 : const char *raid_gen4_tag(void)
117 : {
- 118 1 : return raid_tag(raid_gen_ptr[3]);
+ 118 4 : return raid_tag(raid_gen_ptr[3]);
119 : }
120 :
- 121 1 : const char *raid_gen5_tag(void)
+ 121 4 : const char *raid_gen5_tag(void)
122 : {
- 123 1 : return raid_tag(raid_gen_ptr[4]);
+ 123 4 : return raid_tag(raid_gen_ptr[4]);
124 : }
125 :
- 126 1 : const char *raid_gen6_tag(void)
+ 126 4 : const char *raid_gen6_tag(void)
127 : {
- 128 1 : return raid_tag(raid_gen_ptr[5]);
+ 128 4 : return raid_tag(raid_gen_ptr[5]);
129 : }
130 :
- 131 1 : const char *raid_rec1_tag(void)
+ 131 4 : const char *raid_rec1_tag(void)
132 : {
- 133 1 : return raid_tag(raid_rec_ptr[0]);
+ 133 4 : return raid_tag(raid_rec_ptr[0]);
134 : }
135 :
- 136 1 : const char *raid_rec2_tag(void)
+ 136 4 : const char *raid_rec2_tag(void)
137 : {
- 138 1 : return raid_tag(raid_rec_ptr[1]);
+ 138 4 : return raid_tag(raid_rec_ptr[1]);
139 : }
140 :
- 141 4 : const char *raid_recX_tag(void)
+ 141 16 : const char *raid_recX_tag(void)
142 : {
- 143 4 : return raid_tag(raid_rec_ptr[2]);
+ 143 16 : return raid_tag(raid_rec_ptr[2]);
144 : }
145 :
diff --git a/cov/raid/test.c.func-sort-c.html b/cov/raid/test.c.func-sort-c.html
index ec770ade..9aae9b65 100644
--- a/cov/raid/test.c.func-sort-c.html
+++ b/cov/raid/test.c.func-sort-c.html
@@ -31,9 +31,9 @@
|
-
-
+
+
diff --git a/cov/raid/test.c.func.html b/cov/raid/test.c.func.html
index 67411386..211a3488 100644
--- a/cov/raid/test.c.func.html
+++ b/cov/raid/test.c.func.html
@@ -31,9 +31,9 @@
|
-
-
+
+
diff --git a/cov/raid/test.c.gcov.html b/cov/raid/test.c.gcov.html
index 1c0225c4..9f4fe803 100644
--- a/cov/raid/test.c.gcov.html
+++ b/cov/raid/test.c.gcov.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -268,7 +268,7 @@
206 : #endif
207 : #ifdef CONFIG_AVX2
208 2 : if (raid_cpu_has_avx2())
- 209 0 : f[i][nf[i]++] = raid_rec1_avx2;
+ 209 2 : f[i][nf[i]++] = raid_rec1_avx2;
210 : #endif
211 : #endif
212 7 : } else if (i == 1) {
@@ -280,7 +280,7 @@
218 : #endif
219 : #ifdef CONFIG_AVX2
220 2 : if (raid_cpu_has_avx2())
- 221 0 : f[i][nf[i]++] = raid_rec2_avx2;
+ 221 2 : f[i][nf[i]++] = raid_rec2_avx2;
222 : #endif
223 : #endif
224 : } else {
@@ -292,7 +292,7 @@
230 : #endif
231 : #ifdef CONFIG_AVX2
232 5 : if (raid_cpu_has_avx2())
- 233 0 : f[i][nf[i]++] = raid_recX_avx2;
+ 233 5 : f[i][nf[i]++] = raid_recX_avx2;
234 : #endif
235 : #endif
236 : }
@@ -314,22 +314,22 @@
252 : combination_first(nr, np, ip);
253 : do {
254 : /* for each recover function */
- 255 57051 : for (j = 0; j < nf[nr - 1]; ++j) {
+ 255 76068 : for (j = 0; j < nf[nr - 1]; ++j) {
256 : /* set */
- 257 188730 : for (i = 0; i < nr; ++i) {
+ 257 283095 : for (i = 0; i < nr; ++i) {
258 : /* remove the missing data */
- 259 150696 : data_save[i] = data[id[i]];
- 260 150696 : data[id[i]] = test[i];
+ 259 226044 : data_save[i] = data[id[i]];
+ 260 226044 : data[id[i]] = test[i];
261 : /* set the parity to use */
- 262 150696 : parity[ip[i]] = parity_save[ip[i]];
+ 262 226044 : parity[ip[i]] = parity_save[ip[i]];
263 : }
264 :
265 : /* recover */
- 266 38034 : f[nr - 1][j](nr, id, ip, nd, size, v);
+ 266 57051 : f[nr - 1][j](nr, id, ip, nd, size, v);
267 :
268 : /* check */
- 269 188730 : for (i = 0; i < nr; ++i) {
- 270 150696 : if (memcmp(test[i], data_save[i], size) != 0) {
+ 269 283095 : for (i = 0; i < nr; ++i) {
+ 270 226044 : if (memcmp(test[i], data_save[i], size) != 0) {
271 : /* LCOV_EXCL_START */
272 : goto bail;
273 : /* LCOV_EXCL_STOP */
@@ -337,11 +337,11 @@
275 : }
276 :
277 : /* restore */
- 278 188730 : for (i = 0; i < nr; ++i) {
+ 278 283095 : for (i = 0; i < nr; ++i) {
279 : /* restore the data */
- 280 150696 : data[id[i]] = data_save[i];
+ 280 226044 : data[id[i]] = data_save[i];
281 : /* restore the parity */
- 282 150696 : parity[ip[i]] = waste;
+ 282 226044 : parity[ip[i]] = waste;
283 : }
284 : }
285 19017 : } while (combination_next(nr, np, ip));
@@ -423,8 +423,8 @@
361 :
362 : #ifdef CONFIG_AVX2
363 3 : if (raid_cpu_has_avx2()) {
- 364 0 : f[nf++] = raid_gen1_avx2;
- 365 0 : f[nf++] = raid_gen2_avx2;
+ 364 3 : f[nf++] = raid_gen1_avx2;
+ 365 3 : f[nf++] = raid_gen2_avx2;
366 : }
367 : #endif
368 : #endif /* CONFIG_X86 */
@@ -486,13 +486,13 @@
424 : }
425 :
426 : /* check all the functions */
- 427 40 : for (j = 0; j < nf; ++j) {
+ 427 46 : for (j = 0; j < nf; ++j) {
428 : /* compute parity */
- 429 37 : f[j](nd, size, v);
+ 429 43 : f[j](nd, size, v);
430 :
431 : /* check it */
- 432 232 : for (i = 0; i < np; ++i) {
- 433 195 : if (memcmp(v[nd + np + i], v[nd + i], size) != 0) {
+ 432 268 : for (i = 0; i < np; ++i) {
+ 433 225 : if (memcmp(v[nd + np + i], v[nd + i], size) != 0) {
434 : /* LCOV_EXCL_START */
435 : goto bail;
436 : /* LCOV_EXCL_STOP */
diff --git a/cov/raid/x86.c.func-sort-c.html b/cov/raid/x86.c.func-sort-c.html
index 406c6de1..f981eaff 100644
--- a/cov/raid/x86.c.func-sort-c.html
+++ b/cov/raid/x86.c.func-sort-c.html
@@ -31,18 +31,18 @@
|
-
-
+
+
|
-
-
+
+
 |
@@ -61,59 +61,59 @@
| raid_gen6_ssse3 |
- 551783 |
+ 564140 |
| raid_gen1_sse2 |
- 288315 |
+ 288654 |
| raid_gen2_sse2 |
- 269005 |
+ 268936 |
| raid_rec1_ssse3 |
- 110866 |
+ 111201 |
| raid_recX_ssse3 |
- 79244 |
+ 79288 |
| raid_gen5_ssse3 |
- 46238 |
+ 50654 |
| raid_rec2_ssse3 |
- 44124 |
+ 44277 |
| raid_gen4_ssse3 |
- 31051 |
+ 32471 |
| raid_gen3_ssse3 |
- 29075 |
-
-
- | raid_rec2_avx2 |
- 0 |
-
-
- | raid_rec1_avx2 |
- 0 |
-
-
- | raid_gen1_avx2 |
- 0 |
-
-
- | raid_gen2_avx2 |
- 0 |
+ 29543 |
| raid_recX_avx2 |
- 0 |
+ 17765 |
+
+
+ | raid_rec2_avx2 |
+ 1206 |
+
+
+ | raid_gen2_avx2 |
+ 510 |
+
+
+ | raid_rec1_avx2 |
+ 126 |
+
+
+ | raid_gen1_avx2 |
+ 98 |
diff --git a/cov/raid/x86.c.func.html b/cov/raid/x86.c.func.html
index aae192eb..2309dbdc 100644
--- a/cov/raid/x86.c.func.html
+++ b/cov/raid/x86.c.func.html
@@ -31,18 +31,18 @@
|
-
-
+
+
|
-
-
+
+
 |
@@ -61,59 +61,59 @@
| raid_gen1_avx2 |
- 0 |
+ 98 |
| raid_gen1_sse2 |
- 288315 |
+ 288654 |
| raid_gen2_avx2 |
- 0 |
+ 510 |
| raid_gen2_sse2 |
- 269005 |
+ 268936 |
| raid_gen3_ssse3 |
- 29075 |
+ 29543 |
| raid_gen4_ssse3 |
- 31051 |
+ 32471 |
| raid_gen5_ssse3 |
- 46238 |
+ 50654 |
| raid_gen6_ssse3 |
- 551783 |
+ 564140 |
| raid_rec1_avx2 |
- 0 |
+ 126 |
| raid_rec1_ssse3 |
- 110866 |
+ 111201 |
| raid_rec2_avx2 |
- 0 |
+ 1206 |
| raid_rec2_ssse3 |
- 44124 |
+ 44277 |
| raid_recX_avx2 |
- 0 |
+ 17765 |
| raid_recX_ssse3 |
- 79244 |
+ 79288 |
diff --git a/cov/raid/x86.c.gcov.html b/cov/raid/x86.c.gcov.html
index ded0970c..0722716b 100644
--- a/cov/raid/x86.c.gcov.html
+++ b/cov/raid/x86.c.gcov.html
@@ -31,18 +31,18 @@
|
-
-
+
+
|
-
-
+
+
 |
@@ -95,37 +95,37 @@
33 : * cache block, and processing 128 bytes doesn't increase performance, and in
34 : * some cases it even decreases it.
35 : */
- 36 288315 : void raid_gen1_sse2(int nd, size_t size, void **vv)
+ 36 288654 : void raid_gen1_sse2(int nd, size_t size, void **vv)
37 : {
- 38 288315 : uint8_t **v = (uint8_t **)vv;
+ 38 288654 : uint8_t **v = (uint8_t **)vv;
39 : uint8_t *p;
40 : int d, l;
41 : size_t i;
42 :
- 43 288315 : l = nd - 1;
- 44 288315 : p = v[nd];
+ 43 288654 : l = nd - 1;
+ 44 288654 : p = v[nd];
45 :
46 : raid_sse_begin();
47 :
- 48 5431623 : for (i = 0; i < size; i += 64) {
- 49 5143308 : asm volatile ("movdqa %0,%%xmm0" : : "m" (v[l][i]));
- 50 5143308 : asm volatile ("movdqa %0,%%xmm1" : : "m" (v[l][i + 16]));
- 51 5143308 : asm volatile ("movdqa %0,%%xmm2" : : "m" (v[l][i + 32]));
- 52 5143308 : asm volatile ("movdqa %0,%%xmm3" : : "m" (v[l][i + 48]));
- 53 31932548 : for (d = l - 1; d >= 0; --d) {
- 54 26789240 : asm volatile ("pxor %0,%%xmm0" : : "m" (v[d][i]));
- 55 26789240 : asm volatile ("pxor %0,%%xmm1" : : "m" (v[d][i + 16]));
- 56 26789240 : asm volatile ("pxor %0,%%xmm2" : : "m" (v[d][i + 32]));
- 57 26789240 : asm volatile ("pxor %0,%%xmm3" : : "m" (v[d][i + 48]));
+ 48 6127002 : for (i = 0; i < size; i += 64) {
+ 49 5838348 : asm volatile ("movdqa %0,%%xmm0" : : "m" (v[l][i]));
+ 50 5838348 : asm volatile ("movdqa %0,%%xmm1" : : "m" (v[l][i + 16]));
+ 51 5838348 : asm volatile ("movdqa %0,%%xmm2" : : "m" (v[l][i + 32]));
+ 52 5838348 : asm volatile ("movdqa %0,%%xmm3" : : "m" (v[l][i + 48]));
+ 53 37479684 : for (d = l - 1; d >= 0; --d) {
+ 54 31641336 : asm volatile ("pxor %0,%%xmm0" : : "m" (v[d][i]));
+ 55 31641336 : asm volatile ("pxor %0,%%xmm1" : : "m" (v[d][i + 16]));
+ 56 31641336 : asm volatile ("pxor %0,%%xmm2" : : "m" (v[d][i + 32]));
+ 57 31641336 : asm volatile ("pxor %0,%%xmm3" : : "m" (v[d][i + 48]));
58 : }
- 59 5143308 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
- 60 5143308 : asm volatile ("movntdq %%xmm1,%0" : "=m" (p[i + 16]));
- 61 5143308 : asm volatile ("movntdq %%xmm2,%0" : "=m" (p[i + 32]));
- 62 5143308 : asm volatile ("movntdq %%xmm3,%0" : "=m" (p[i + 48]));
+ 59 5838348 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
+ 60 5838348 : asm volatile ("movntdq %%xmm1,%0" : "=m" (p[i + 16]));
+ 61 5838348 : asm volatile ("movntdq %%xmm2,%0" : "=m" (p[i + 32]));
+ 62 5838348 : asm volatile ("movntdq %%xmm3,%0" : "=m" (p[i + 48]));
63 : }
64 :
65 : raid_sse_end();
- 66 288315 : }
+ 66 288654 : }
67 : #endif
68 :
69 : #if defined(CONFIG_X86) && defined(CONFIG_AVX2)
@@ -136,31 +136,31 @@
74 : * cache block, and processing 128 bytes doesn't increase performance, and in
75 : * some cases it even decreases it.
76 : */
- 77 0 : void raid_gen1_avx2(int nd, size_t size, void **vv)
+ 77 98 : void raid_gen1_avx2(int nd, size_t size, void **vv)
78 : {
- 79 0 : uint8_t **v = (uint8_t **)vv;
+ 79 98 : uint8_t **v = (uint8_t **)vv;
80 : uint8_t *p;
81 : int d, l;
82 : size_t i;
83 :
- 84 0 : l = nd - 1;
- 85 0 : p = v[nd];
+ 84 98 : l = nd - 1;
+ 85 98 : p = v[nd];
86 :
87 : raid_avx_begin();
88 :
- 89 0 : for (i = 0; i < size; i += 64) {
- 90 0 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (v[l][i]));
- 91 0 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (v[l][i + 32]));
- 92 0 : for (d = l - 1; d >= 0; --d) {
- 93 0 : asm volatile ("vpxor %0,%%ymm0,%%ymm0" : : "m" (v[d][i]));
- 94 0 : asm volatile ("vpxor %0,%%ymm1,%%ymm1" : : "m" (v[d][i + 32]));
+ 89 54286 : for (i = 0; i < size; i += 64) {
+ 90 54188 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (v[l][i]));
+ 91 54188 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (v[l][i + 32]));
+ 92 439940 : for (d = l - 1; d >= 0; --d) {
+ 93 385752 : asm volatile ("vpxor %0,%%ymm0,%%ymm0" : : "m" (v[d][i]));
+ 94 385752 : asm volatile ("vpxor %0,%%ymm1,%%ymm1" : : "m" (v[d][i + 32]));
95 : }
- 96 0 : asm volatile ("vmovntdq %%ymm0,%0" : "=m" (p[i]));
- 97 0 : asm volatile ("vmovntdq %%ymm1,%0" : "=m" (p[i + 32]));
+ 96 54188 : asm volatile ("vmovntdq %%ymm0,%0" : "=m" (p[i]));
+ 97 54188 : asm volatile ("vmovntdq %%ymm1,%0" : "=m" (p[i + 32]));
98 : }
99 :
100 : raid_avx_end();
- 101 0 : }
+ 101 98 : }
102 : #endif
103 :
104 : #if defined(CONFIG_X86) && defined(CONFIG_SSE2)
@@ -183,107 +183,107 @@
121 : /*
122 : * GEN2 (RAID6 with powers of 2) SSE2 implementation
123 : */
- 124 269005 : void raid_gen2_sse2(int nd, size_t size, void **vv)
+ 124 268936 : void raid_gen2_sse2(int nd, size_t size, void **vv)
125 : {
- 126 269005 : uint8_t **v = (uint8_t **)vv;
+ 126 268936 : uint8_t **v = (uint8_t **)vv;
127 : uint8_t *p;
128 : uint8_t *q;
129 : int d, l;
130 : size_t i;
131 :
- 132 269005 : l = nd - 1;
- 133 269005 : p = v[nd];
- 134 269005 : q = v[nd + 1];
+ 132 268936 : l = nd - 1;
+ 133 268936 : p = v[nd];
+ 134 268936 : q = v[nd + 1];
135 :
136 : raid_sse_begin();
137 :
- 138 269005 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
+ 138 268936 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
139 :
- 140 9670437 : for (i = 0; i < size; i += 32) {
- 141 9401432 : asm volatile ("movdqa %0,%%xmm0" : : "m" (v[l][i]));
- 142 9401432 : asm volatile ("movdqa %0,%%xmm1" : : "m" (v[l][i + 16]));
- 143 9401432 : asm volatile ("movdqa %xmm0,%xmm2");
- 144 9401432 : asm volatile ("movdqa %xmm1,%xmm3");
- 145 58044936 : for (d = l - 1; d >= 0; --d) {
- 146 48643504 : asm volatile ("pxor %xmm4,%xmm4");
- 147 48643504 : asm volatile ("pxor %xmm5,%xmm5");
- 148 48643504 : asm volatile ("pcmpgtb %xmm2,%xmm4");
- 149 48643504 : asm volatile ("pcmpgtb %xmm3,%xmm5");
- 150 48643504 : asm volatile ("paddb %xmm2,%xmm2");
- 151 48643504 : asm volatile ("paddb %xmm3,%xmm3");
- 152 48643504 : asm volatile ("pand %xmm7,%xmm4");
- 153 48643504 : asm volatile ("pand %xmm7,%xmm5");
- 154 48643504 : asm volatile ("pxor %xmm4,%xmm2");
- 155 48643504 : asm volatile ("pxor %xmm5,%xmm3");
+ 140 10800576 : for (i = 0; i < size; i += 32) {
+ 141 10531640 : asm volatile ("movdqa %0,%%xmm0" : : "m" (v[l][i]));
+ 142 10531640 : asm volatile ("movdqa %0,%%xmm1" : : "m" (v[l][i + 16]));
+ 143 10531640 : asm volatile ("movdqa %xmm0,%xmm2");
+ 144 10531640 : asm volatile ("movdqa %xmm1,%xmm3");
+ 145 67056840 : for (d = l - 1; d >= 0; --d) {
+ 146 56525200 : asm volatile ("pxor %xmm4,%xmm4");
+ 147 56525200 : asm volatile ("pxor %xmm5,%xmm5");
+ 148 56525200 : asm volatile ("pcmpgtb %xmm2,%xmm4");
+ 149 56525200 : asm volatile ("pcmpgtb %xmm3,%xmm5");
+ 150 56525200 : asm volatile ("paddb %xmm2,%xmm2");
+ 151 56525200 : asm volatile ("paddb %xmm3,%xmm3");
+ 152 56525200 : asm volatile ("pand %xmm7,%xmm4");
+ 153 56525200 : asm volatile ("pand %xmm7,%xmm5");
+ 154 56525200 : asm volatile ("pxor %xmm4,%xmm2");
+ 155 56525200 : asm volatile ("pxor %xmm5,%xmm3");
156 :
- 157 48643504 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
- 158 48643504 : asm volatile ("movdqa %0,%%xmm5" : : "m" (v[d][i + 16]));
- 159 48643504 : asm volatile ("pxor %xmm4,%xmm0");
- 160 48643504 : asm volatile ("pxor %xmm5,%xmm1");
- 161 48643504 : asm volatile ("pxor %xmm4,%xmm2");
- 162 48643504 : asm volatile ("pxor %xmm5,%xmm3");
+ 157 56525200 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
+ 158 56525200 : asm volatile ("movdqa %0,%%xmm5" : : "m" (v[d][i + 16]));
+ 159 56525200 : asm volatile ("pxor %xmm4,%xmm0");
+ 160 56525200 : asm volatile ("pxor %xmm5,%xmm1");
+ 161 56525200 : asm volatile ("pxor %xmm4,%xmm2");
+ 162 56525200 : asm volatile ("pxor %xmm5,%xmm3");
163 : }
- 164 9401432 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
- 165 9401432 : asm volatile ("movntdq %%xmm1,%0" : "=m" (p[i + 16]));
- 166 9401432 : asm volatile ("movntdq %%xmm2,%0" : "=m" (q[i]));
- 167 9401432 : asm volatile ("movntdq %%xmm3,%0" : "=m" (q[i + 16]));
+ 164 10531640 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
+ 165 10531640 : asm volatile ("movntdq %%xmm1,%0" : "=m" (p[i + 16]));
+ 166 10531640 : asm volatile ("movntdq %%xmm2,%0" : "=m" (q[i]));
+ 167 10531640 : asm volatile ("movntdq %%xmm3,%0" : "=m" (q[i + 16]));
168 : }
169 :
170 : raid_sse_end();
- 171 269005 : }
+ 171 268936 : }
172 : #endif
173 :
174 : #if defined(CONFIG_X86) && defined(CONFIG_AVX2)
175 : /*
176 : * GEN2 (RAID6 with powers of 2) AVX2 implementation
177 : */
- 178 0 : void raid_gen2_avx2(int nd, size_t size, void **vv)
+ 178 510 : void raid_gen2_avx2(int nd, size_t size, void **vv)
179 : {
- 180 0 : uint8_t **v = (uint8_t **)vv;
+ 180 510 : uint8_t **v = (uint8_t **)vv;
181 : uint8_t *p;
182 : uint8_t *q;
183 : int d, l;
184 : size_t i;
185 :
- 186 0 : l = nd - 1;
- 187 0 : p = v[nd];
- 188 0 : q = v[nd + 1];
+ 186 510 : l = nd - 1;
+ 187 510 : p = v[nd];
+ 188 510 : q = v[nd + 1];
189 :
190 : raid_avx_begin();
191 :
- 192 0 : asm volatile ("vbroadcasti128 %0, %%ymm7" : : "m" (gfconst16.poly[0]));
- 193 0 : asm volatile ("vpxor %ymm6,%ymm6,%ymm6");
+ 192 510 : asm volatile ("vbroadcasti128 %0, %%ymm7" : : "m" (gfconst16.poly[0]));
+ 193 510 : asm volatile ("vpxor %ymm6,%ymm6,%ymm6");
194 :
- 195 0 : for (i = 0; i < size; i += 64) {
- 196 0 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (v[l][i]));
- 197 0 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (v[l][i + 32]));
- 198 0 : asm volatile ("vmovdqa %ymm0,%ymm2");
- 199 0 : asm volatile ("vmovdqa %ymm1,%ymm3");
- 200 0 : for (d = l - 1; d >= 0; --d) {
- 201 0 : asm volatile ("vpcmpgtb %ymm2,%ymm6,%ymm4");
- 202 0 : asm volatile ("vpcmpgtb %ymm3,%ymm6,%ymm5");
- 203 0 : asm volatile ("vpaddb %ymm2,%ymm2,%ymm2");
- 204 0 : asm volatile ("vpaddb %ymm3,%ymm3,%ymm3");
- 205 0 : asm volatile ("vpand %ymm7,%ymm4,%ymm4");
- 206 0 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
- 207 0 : asm volatile ("vpxor %ymm4,%ymm2,%ymm2");
- 208 0 : asm volatile ("vpxor %ymm5,%ymm3,%ymm3");
+ 195 113754 : for (i = 0; i < size; i += 64) {
+ 196 113244 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (v[l][i]));
+ 197 113244 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (v[l][i + 32]));
+ 198 113244 : asm volatile ("vmovdqa %ymm0,%ymm2");
+ 199 113244 : asm volatile ("vmovdqa %ymm1,%ymm3");
+ 200 919748 : for (d = l - 1; d >= 0; --d) {
+ 201 806504 : asm volatile ("vpcmpgtb %ymm2,%ymm6,%ymm4");
+ 202 806504 : asm volatile ("vpcmpgtb %ymm3,%ymm6,%ymm5");
+ 203 806504 : asm volatile ("vpaddb %ymm2,%ymm2,%ymm2");
+ 204 806504 : asm volatile ("vpaddb %ymm3,%ymm3,%ymm3");
+ 205 806504 : asm volatile ("vpand %ymm7,%ymm4,%ymm4");
+ 206 806504 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
+ 207 806504 : asm volatile ("vpxor %ymm4,%ymm2,%ymm2");
+ 208 806504 : asm volatile ("vpxor %ymm5,%ymm3,%ymm3");
209 :
- 210 0 : asm volatile ("vmovdqa %0,%%ymm4" : : "m" (v[d][i]));
- 211 0 : asm volatile ("vmovdqa %0,%%ymm5" : : "m" (v[d][i + 32]));
- 212 0 : asm volatile ("vpxor %ymm4,%ymm0,%ymm0");
- 213 0 : asm volatile ("vpxor %ymm5,%ymm1,%ymm1");
- 214 0 : asm volatile ("vpxor %ymm4,%ymm2,%ymm2");
- 215 0 : asm volatile ("vpxor %ymm5,%ymm3,%ymm3");
+ 210 806504 : asm volatile ("vmovdqa %0,%%ymm4" : : "m" (v[d][i]));
+ 211 806504 : asm volatile ("vmovdqa %0,%%ymm5" : : "m" (v[d][i + 32]));
+ 212 806504 : asm volatile ("vpxor %ymm4,%ymm0,%ymm0");
+ 213 806504 : asm volatile ("vpxor %ymm5,%ymm1,%ymm1");
+ 214 806504 : asm volatile ("vpxor %ymm4,%ymm2,%ymm2");
+ 215 806504 : asm volatile ("vpxor %ymm5,%ymm3,%ymm3");
216 : }
- 217 0 : asm volatile ("vmovntdq %%ymm0,%0" : "=m" (p[i]));
- 218 0 : asm volatile ("vmovntdq %%ymm1,%0" : "=m" (p[i + 32]));
- 219 0 : asm volatile ("vmovntdq %%ymm2,%0" : "=m" (q[i]));
- 220 0 : asm volatile ("vmovntdq %%ymm3,%0" : "=m" (q[i + 32]));
+ 217 113244 : asm volatile ("vmovntdq %%ymm0,%0" : "=m" (p[i]));
+ 218 113244 : asm volatile ("vmovntdq %%ymm1,%0" : "=m" (p[i + 32]));
+ 219 113244 : asm volatile ("vmovntdq %%ymm2,%0" : "=m" (q[i]));
+ 220 113244 : asm volatile ("vmovntdq %%ymm3,%0" : "=m" (q[i + 32]));
221 : }
222 :
223 : raid_avx_end();
- 224 0 : }
+ 224 510 : }
225 : #endif
226 :
227 : #if defined(CONFIG_X86_64) && defined(CONFIG_SSE2)
@@ -370,93 +370,93 @@
308 : /*
309 : * GEN3 (triple parity with Cauchy matrix) SSSE3 implementation
310 : */
- 311 29075 : void raid_gen3_ssse3(int nd, size_t size, void **vv)
+ 311 29543 : void raid_gen3_ssse3(int nd, size_t size, void **vv)
312 : {
- 313 29075 : uint8_t **v = (uint8_t **)vv;
+ 313 29543 : uint8_t **v = (uint8_t **)vv;
314 : uint8_t *p;
315 : uint8_t *q;
316 : uint8_t *r;
317 : int d, l;
318 : size_t i;
319 :
- 320 29075 : l = nd - 1;
- 321 29075 : p = v[nd];
- 322 29075 : q = v[nd + 1];
- 323 29075 : r = v[nd + 2];
+ 320 29543 : l = nd - 1;
+ 321 29543 : p = v[nd];
+ 322 29543 : q = v[nd + 1];
+ 323 29543 : r = v[nd + 2];
324 :
325 : /* special case with only one data disk */
- 326 29075 : if (l == 0) {
+ 326 29543 : if (l == 0) {
327 4 : for (i = 0; i < 3; ++i)
328 3 : memcpy(v[1 + i], v[0], size);
- 329 29076 : return;
+ 329 29544 : return;
330 : }
331 :
332 : raid_sse_begin();
333 :
334 : /* generic case with at least two data disks */
- 335 29074 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfconst16.poly[0]));
- 336 29074 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 335 29542 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfconst16.poly[0]));
+ 336 29542 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
337 :
- 338 3194978 : for (i = 0; i < size; i += 16) {
+ 338 4905206 : for (i = 0; i < size; i += 16) {
339 : /* last disk without the by two multiplication */
- 340 3165904 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
+ 340 4875664 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
341 :
- 342 3165904 : asm volatile ("movdqa %xmm4,%xmm0");
- 343 3165904 : asm volatile ("movdqa %xmm4,%xmm1");
+ 342 4875664 : asm volatile ("movdqa %xmm4,%xmm0");
+ 343 4875664 : asm volatile ("movdqa %xmm4,%xmm1");
344 :
- 345 3165904 : asm volatile ("movdqa %xmm4,%xmm5");
- 346 3165904 : asm volatile ("psrlw $4,%xmm5");
- 347 3165904 : asm volatile ("pand %xmm7,%xmm4");
- 348 3165904 : asm volatile ("pand %xmm7,%xmm5");
+ 345 4875664 : asm volatile ("movdqa %xmm4,%xmm5");
+ 346 4875664 : asm volatile ("psrlw $4,%xmm5");
+ 347 4875664 : asm volatile ("pand %xmm7,%xmm4");
+ 348 4875664 : asm volatile ("pand %xmm7,%xmm5");
349 :
- 350 3165904 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][0][0][0]));
- 351 3165904 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[l][0][1][0]));
- 352 3165904 : asm volatile ("pshufb %xmm4,%xmm2");
- 353 3165904 : asm volatile ("pshufb %xmm5,%xmm6");
- 354 3165904 : asm volatile ("pxor %xmm6,%xmm2");
+ 350 4875664 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][0][0][0]));
+ 351 4875664 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[l][0][1][0]));
+ 352 4875664 : asm volatile ("pshufb %xmm4,%xmm2");
+ 353 4875664 : asm volatile ("pshufb %xmm5,%xmm6");
+ 354 4875664 : asm volatile ("pxor %xmm6,%xmm2");
355 :
356 : /* intermediate disks */
- 357 18612400 : for (d = l - 1; d > 0; --d) {
- 358 15446496 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
+ 357 30604016 : for (d = l - 1; d > 0; --d) {
+ 358 25728352 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
359 :
- 360 15446496 : asm volatile ("pxor %xmm5,%xmm5");
- 361 15446496 : asm volatile ("pcmpgtb %xmm1,%xmm5");
- 362 15446496 : asm volatile ("paddb %xmm1,%xmm1");
- 363 15446496 : asm volatile ("pand %xmm3,%xmm5");
- 364 15446496 : asm volatile ("pxor %xmm5,%xmm1");
+ 360 25728352 : asm volatile ("pxor %xmm5,%xmm5");
+ 361 25728352 : asm volatile ("pcmpgtb %xmm1,%xmm5");
+ 362 25728352 : asm volatile ("paddb %xmm1,%xmm1");
+ 363 25728352 : asm volatile ("pand %xmm3,%xmm5");
+ 364 25728352 : asm volatile ("pxor %xmm5,%xmm1");
365 :
- 366 15446496 : asm volatile ("pxor %xmm4,%xmm0");
- 367 15446496 : asm volatile ("pxor %xmm4,%xmm1");
+ 366 25728352 : asm volatile ("pxor %xmm4,%xmm0");
+ 367 25728352 : asm volatile ("pxor %xmm4,%xmm1");
368 :
- 369 15446496 : asm volatile ("movdqa %xmm4,%xmm5");
- 370 15446496 : asm volatile ("psrlw $4,%xmm5");
- 371 15446496 : asm volatile ("pand %xmm7,%xmm4");
- 372 15446496 : asm volatile ("pand %xmm7,%xmm5");
+ 369 25728352 : asm volatile ("movdqa %xmm4,%xmm5");
+ 370 25728352 : asm volatile ("psrlw $4,%xmm5");
+ 371 25728352 : asm volatile ("pand %xmm7,%xmm4");
+ 372 25728352 : asm volatile ("pand %xmm7,%xmm5");
373 :
- 374 15446496 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
- 375 15446496 : asm volatile ("pshufb %xmm4,%xmm6");
- 376 15446496 : asm volatile ("pxor %xmm6,%xmm2");
- 377 15446496 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][1][0]));
- 378 15446496 : asm volatile ("pshufb %xmm5,%xmm6");
- 379 15446496 : asm volatile ("pxor %xmm6,%xmm2");
+ 374 25728352 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
+ 375 25728352 : asm volatile ("pshufb %xmm4,%xmm6");
+ 376 25728352 : asm volatile ("pxor %xmm6,%xmm2");
+ 377 25728352 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][1][0]));
+ 378 25728352 : asm volatile ("pshufb %xmm5,%xmm6");
+ 379 25728352 : asm volatile ("pxor %xmm6,%xmm2");
380 : }
381 :
382 : /* first disk with all coefficients at 1 */
- 383 3165904 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
+ 383 4875664 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
384 :
- 385 3165904 : asm volatile ("pxor %xmm5,%xmm5");
- 386 3165904 : asm volatile ("pcmpgtb %xmm1,%xmm5");
- 387 3165904 : asm volatile ("paddb %xmm1,%xmm1");
- 388 3165904 : asm volatile ("pand %xmm3,%xmm5");
- 389 3165904 : asm volatile ("pxor %xmm5,%xmm1");
+ 385 4875664 : asm volatile ("pxor %xmm5,%xmm5");
+ 386 4875664 : asm volatile ("pcmpgtb %xmm1,%xmm5");
+ 387 4875664 : asm volatile ("paddb %xmm1,%xmm1");
+ 388 4875664 : asm volatile ("pand %xmm3,%xmm5");
+ 389 4875664 : asm volatile ("pxor %xmm5,%xmm1");
390 :
- 391 3165904 : asm volatile ("pxor %xmm4,%xmm0");
- 392 3165904 : asm volatile ("pxor %xmm4,%xmm1");
- 393 3165904 : asm volatile ("pxor %xmm4,%xmm2");
+ 391 4875664 : asm volatile ("pxor %xmm4,%xmm0");
+ 392 4875664 : asm volatile ("pxor %xmm4,%xmm1");
+ 393 4875664 : asm volatile ("pxor %xmm4,%xmm2");
394 :
- 395 3165904 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
- 396 3165904 : asm volatile ("movntdq %%xmm1,%0" : "=m" (q[i]));
- 397 3165904 : asm volatile ("movntdq %%xmm2,%0" : "=m" (r[i]));
+ 395 4875664 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
+ 396 4875664 : asm volatile ("movntdq %%xmm1,%0" : "=m" (q[i]));
+ 397 4875664 : asm volatile ("movntdq %%xmm2,%0" : "=m" (r[i]));
398 : }
399 :
400 : raid_sse_end();
@@ -741,9 +741,9 @@
679 : /*
680 : * GEN4 (quad parity with Cauchy matrix) SSSE3 implementation
681 : */
- 682 31051 : void raid_gen4_ssse3(int nd, size_t size, void **vv)
+ 682 32471 : void raid_gen4_ssse3(int nd, size_t size, void **vv)
683 : {
- 684 31051 : uint8_t **v = (uint8_t **)vv;
+ 684 32471 : uint8_t **v = (uint8_t **)vv;
685 : uint8_t *p;
686 : uint8_t *q;
687 : uint8_t *r;
@@ -751,102 +751,102 @@
689 : int d, l;
690 : size_t i;
691 :
- 692 31051 : l = nd - 1;
- 693 31051 : p = v[nd];
- 694 31051 : q = v[nd + 1];
- 695 31051 : r = v[nd + 2];
- 696 31051 : s = v[nd + 3];
+ 692 32471 : l = nd - 1;
+ 693 32471 : p = v[nd];
+ 694 32471 : q = v[nd + 1];
+ 695 32471 : r = v[nd + 2];
+ 696 32471 : s = v[nd + 3];
697 :
698 : /* special case with only one data disk */
- 699 31051 : if (l == 0) {
+ 699 32471 : if (l == 0) {
700 5 : for (i = 0; i < 4; ++i)
701 4 : memcpy(v[1 + i], v[0], size);
- 702 31052 : return;
+ 702 32472 : return;
703 : }
704 :
705 : raid_sse_begin();
706 :
707 : /* generic case with at least two data disks */
- 708 2443194 : for (i = 0; i < size; i += 16) {
+ 708 3367574 : for (i = 0; i < size; i += 16) {
709 : /* last disk without the by two multiplication */
- 710 2412144 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
- 711 2412144 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
+ 710 3335104 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 711 3335104 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
712 :
- 713 2412144 : asm volatile ("movdqa %xmm4,%xmm0");
- 714 2412144 : asm volatile ("movdqa %xmm4,%xmm1");
+ 713 3335104 : asm volatile ("movdqa %xmm4,%xmm0");
+ 714 3335104 : asm volatile ("movdqa %xmm4,%xmm1");
715 :
- 716 2412144 : asm volatile ("movdqa %xmm4,%xmm5");
- 717 2412144 : asm volatile ("psrlw $4,%xmm5");
- 718 2412144 : asm volatile ("pand %xmm7,%xmm4");
- 719 2412144 : asm volatile ("pand %xmm7,%xmm5");
+ 716 3335104 : asm volatile ("movdqa %xmm4,%xmm5");
+ 717 3335104 : asm volatile ("psrlw $4,%xmm5");
+ 718 3335104 : asm volatile ("pand %xmm7,%xmm4");
+ 719 3335104 : asm volatile ("pand %xmm7,%xmm5");
720 :
- 721 2412144 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][0][0][0]));
- 722 2412144 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][0][1][0]));
- 723 2412144 : asm volatile ("pshufb %xmm4,%xmm2");
- 724 2412144 : asm volatile ("pshufb %xmm5,%xmm7");
- 725 2412144 : asm volatile ("pxor %xmm7,%xmm2");
+ 721 3335104 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][0][0][0]));
+ 722 3335104 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][0][1][0]));
+ 723 3335104 : asm volatile ("pshufb %xmm4,%xmm2");
+ 724 3335104 : asm volatile ("pshufb %xmm5,%xmm7");
+ 725 3335104 : asm volatile ("pxor %xmm7,%xmm2");
726 :
- 727 2412144 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfgenpshufb[l][1][0][0]));
- 728 2412144 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][1][1][0]));
- 729 2412144 : asm volatile ("pshufb %xmm4,%xmm3");
- 730 2412144 : asm volatile ("pshufb %xmm5,%xmm7");
- 731 2412144 : asm volatile ("pxor %xmm7,%xmm3");
+ 727 3335104 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfgenpshufb[l][1][0][0]));
+ 728 3335104 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][1][1][0]));
+ 729 3335104 : asm volatile ("pshufb %xmm4,%xmm3");
+ 730 3335104 : asm volatile ("pshufb %xmm5,%xmm7");
+ 731 3335104 : asm volatile ("pxor %xmm7,%xmm3");
732 :
733 : /* intermediate disks */
- 734 13452688 : for (d = l - 1; d > 0; --d) {
- 735 11040544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
- 736 11040544 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
+ 734 20000768 : for (d = l - 1; d > 0; --d) {
+ 735 16665664 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
+ 736 16665664 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
737 :
- 738 11040544 : asm volatile ("pxor %xmm5,%xmm5");
- 739 11040544 : asm volatile ("pcmpgtb %xmm1,%xmm5");
- 740 11040544 : asm volatile ("paddb %xmm1,%xmm1");
- 741 11040544 : asm volatile ("pand %xmm7,%xmm5");
- 742 11040544 : asm volatile ("pxor %xmm5,%xmm1");
+ 738 16665664 : asm volatile ("pxor %xmm5,%xmm5");
+ 739 16665664 : asm volatile ("pcmpgtb %xmm1,%xmm5");
+ 740 16665664 : asm volatile ("paddb %xmm1,%xmm1");
+ 741 16665664 : asm volatile ("pand %xmm7,%xmm5");
+ 742 16665664 : asm volatile ("pxor %xmm5,%xmm1");
743 :
- 744 11040544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 744 16665664 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
745 :
- 746 11040544 : asm volatile ("pxor %xmm4,%xmm0");
- 747 11040544 : asm volatile ("pxor %xmm4,%xmm1");
+ 746 16665664 : asm volatile ("pxor %xmm4,%xmm0");
+ 747 16665664 : asm volatile ("pxor %xmm4,%xmm1");
748 :
- 749 11040544 : asm volatile ("movdqa %xmm4,%xmm5");
- 750 11040544 : asm volatile ("psrlw $4,%xmm5");
- 751 11040544 : asm volatile ("pand %xmm7,%xmm4");
- 752 11040544 : asm volatile ("pand %xmm7,%xmm5");
+ 749 16665664 : asm volatile ("movdqa %xmm4,%xmm5");
+ 750 16665664 : asm volatile ("psrlw $4,%xmm5");
+ 751 16665664 : asm volatile ("pand %xmm7,%xmm4");
+ 752 16665664 : asm volatile ("pand %xmm7,%xmm5");
753 :
- 754 11040544 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
- 755 11040544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][0][1][0]));
- 756 11040544 : asm volatile ("pshufb %xmm4,%xmm6");
- 757 11040544 : asm volatile ("pshufb %xmm5,%xmm7");
- 758 11040544 : asm volatile ("pxor %xmm6,%xmm2");
- 759 11040544 : asm volatile ("pxor %xmm7,%xmm2");
+ 754 16665664 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
+ 755 16665664 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][0][1][0]));
+ 756 16665664 : asm volatile ("pshufb %xmm4,%xmm6");
+ 757 16665664 : asm volatile ("pshufb %xmm5,%xmm7");
+ 758 16665664 : asm volatile ("pxor %xmm6,%xmm2");
+ 759 16665664 : asm volatile ("pxor %xmm7,%xmm2");
760 :
- 761 11040544 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][1][0][0]));
- 762 11040544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][1][1][0]));
- 763 11040544 : asm volatile ("pshufb %xmm4,%xmm6");
- 764 11040544 : asm volatile ("pshufb %xmm5,%xmm7");
- 765 11040544 : asm volatile ("pxor %xmm6,%xmm3");
- 766 11040544 : asm volatile ("pxor %xmm7,%xmm3");
+ 761 16665664 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][1][0][0]));
+ 762 16665664 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][1][1][0]));
+ 763 16665664 : asm volatile ("pshufb %xmm4,%xmm6");
+ 764 16665664 : asm volatile ("pshufb %xmm5,%xmm7");
+ 765 16665664 : asm volatile ("pxor %xmm6,%xmm3");
+ 766 16665664 : asm volatile ("pxor %xmm7,%xmm3");
767 : }
768 :
769 : /* first disk with all coefficients at 1 */
- 770 2412144 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
- 771 2412144 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
+ 770 3335104 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
+ 771 3335104 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
772 :
- 773 2412144 : asm volatile ("pxor %xmm5,%xmm5");
- 774 2412144 : asm volatile ("pcmpgtb %xmm1,%xmm5");
- 775 2412144 : asm volatile ("paddb %xmm1,%xmm1");
- 776 2412144 : asm volatile ("pand %xmm7,%xmm5");
- 777 2412144 : asm volatile ("pxor %xmm5,%xmm1");
+ 773 3335104 : asm volatile ("pxor %xmm5,%xmm5");
+ 774 3335104 : asm volatile ("pcmpgtb %xmm1,%xmm5");
+ 775 3335104 : asm volatile ("paddb %xmm1,%xmm1");
+ 776 3335104 : asm volatile ("pand %xmm7,%xmm5");
+ 777 3335104 : asm volatile ("pxor %xmm5,%xmm1");
778 :
- 779 2412144 : asm volatile ("pxor %xmm4,%xmm0");
- 780 2412144 : asm volatile ("pxor %xmm4,%xmm1");
- 781 2412144 : asm volatile ("pxor %xmm4,%xmm2");
- 782 2412144 : asm volatile ("pxor %xmm4,%xmm3");
+ 779 3335104 : asm volatile ("pxor %xmm4,%xmm0");
+ 780 3335104 : asm volatile ("pxor %xmm4,%xmm1");
+ 781 3335104 : asm volatile ("pxor %xmm4,%xmm2");
+ 782 3335104 : asm volatile ("pxor %xmm4,%xmm3");
783 :
- 784 2412144 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
- 785 2412144 : asm volatile ("movntdq %%xmm1,%0" : "=m" (q[i]));
- 786 2412144 : asm volatile ("movntdq %%xmm2,%0" : "=m" (r[i]));
- 787 2412144 : asm volatile ("movntdq %%xmm3,%0" : "=m" (s[i]));
+ 784 3335104 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
+ 785 3335104 : asm volatile ("movntdq %%xmm1,%0" : "=m" (q[i]));
+ 786 3335104 : asm volatile ("movntdq %%xmm2,%0" : "=m" (r[i]));
+ 787 3335104 : asm volatile ("movntdq %%xmm3,%0" : "=m" (s[i]));
788 : }
789 :
790 : raid_sse_end();
@@ -1191,9 +1191,9 @@
1129 : /*
1130 : * GEN5 (penta parity with Cauchy matrix) SSSE3 implementation
1131 : */
- 1132 46238 : void raid_gen5_ssse3(int nd, size_t size, void **vv)
+ 1132 50654 : void raid_gen5_ssse3(int nd, size_t size, void **vv)
1133 : {
- 1134 46238 : uint8_t **v = (uint8_t **)vv;
+ 1134 50654 : uint8_t **v = (uint8_t **)vv;
1135 : uint8_t *p;
1136 : uint8_t *q;
1137 : uint8_t *r;
@@ -1202,122 +1202,122 @@
1140 : int d, l;
1141 : size_t i;
1142 : uint8_t buffer[16+16];
- 1143 46238 : uint8_t *pd = __align_ptr(buffer, 16);
+ 1143 50654 : uint8_t *pd = __align_ptr(buffer, 16);
1144 :
- 1145 46238 : l = nd - 1;
- 1146 46238 : p = v[nd];
- 1147 46238 : q = v[nd + 1];
- 1148 46238 : r = v[nd + 2];
- 1149 46238 : s = v[nd + 3];
- 1150 46238 : t = v[nd + 4];
+ 1145 50654 : l = nd - 1;
+ 1146 50654 : p = v[nd];
+ 1147 50654 : q = v[nd + 1];
+ 1148 50654 : r = v[nd + 2];
+ 1149 50654 : s = v[nd + 3];
+ 1150 50654 : t = v[nd + 4];
1151 :
1152 : /* special case with only one data disk */
- 1153 46238 : if (l == 0) {
+ 1153 50654 : if (l == 0) {
1154 6 : for (i = 0; i < 5; ++i)
1155 5 : memcpy(v[1 + i], v[0], size);
- 1156 46239 : return;
+ 1156 50655 : return;
1157 : }
1158 :
1159 : raid_sse_begin();
1160 :
1161 : /* generic case with at least two data disks */
- 1162 3076781 : for (i = 0; i < size; i += 16) {
+ 1162 3937517 : for (i = 0; i < size; i += 16) {
1163 : /* last disk without the by two multiplication */
- 1164 3030544 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
+ 1164 3886864 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
1165 :
- 1166 3030544 : asm volatile ("movdqa %xmm4,%xmm0");
- 1167 3030544 : asm volatile ("movdqa %%xmm4,%0" : "=m" (pd[0]));
+ 1166 3886864 : asm volatile ("movdqa %xmm4,%xmm0");
+ 1167 3886864 : asm volatile ("movdqa %%xmm4,%0" : "=m" (pd[0]));
1168 :
- 1169 3030544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
- 1170 3030544 : asm volatile ("movdqa %xmm4,%xmm5");
- 1171 3030544 : asm volatile ("psrlw $4,%xmm5");
- 1172 3030544 : asm volatile ("pand %xmm7,%xmm4");
- 1173 3030544 : asm volatile ("pand %xmm7,%xmm5");
+ 1169 3886864 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 1170 3886864 : asm volatile ("movdqa %xmm4,%xmm5");
+ 1171 3886864 : asm volatile ("psrlw $4,%xmm5");
+ 1172 3886864 : asm volatile ("pand %xmm7,%xmm4");
+ 1173 3886864 : asm volatile ("pand %xmm7,%xmm5");
1174 :
- 1175 3030544 : asm volatile ("movdqa %0,%%xmm1" : : "m" (gfgenpshufb[l][0][0][0]));
- 1176 3030544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][0][1][0]));
- 1177 3030544 : asm volatile ("pshufb %xmm4,%xmm1");
- 1178 3030544 : asm volatile ("pshufb %xmm5,%xmm7");
- 1179 3030544 : asm volatile ("pxor %xmm7,%xmm1");
+ 1175 3886864 : asm volatile ("movdqa %0,%%xmm1" : : "m" (gfgenpshufb[l][0][0][0]));
+ 1176 3886864 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][0][1][0]));
+ 1177 3886864 : asm volatile ("pshufb %xmm4,%xmm1");
+ 1178 3886864 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1179 3886864 : asm volatile ("pxor %xmm7,%xmm1");
1180 :
- 1181 3030544 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][1][0][0]));
- 1182 3030544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][1][1][0]));
- 1183 3030544 : asm volatile ("pshufb %xmm4,%xmm2");
- 1184 3030544 : asm volatile ("pshufb %xmm5,%xmm7");
- 1185 3030544 : asm volatile ("pxor %xmm7,%xmm2");
+ 1181 3886864 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][1][0][0]));
+ 1182 3886864 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][1][1][0]));
+ 1183 3886864 : asm volatile ("pshufb %xmm4,%xmm2");
+ 1184 3886864 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1185 3886864 : asm volatile ("pxor %xmm7,%xmm2");
1186 :
- 1187 3030544 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfgenpshufb[l][2][0][0]));
- 1188 3030544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][2][1][0]));
- 1189 3030544 : asm volatile ("pshufb %xmm4,%xmm3");
- 1190 3030544 : asm volatile ("pshufb %xmm5,%xmm7");
- 1191 3030544 : asm volatile ("pxor %xmm7,%xmm3");
+ 1187 3886864 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfgenpshufb[l][2][0][0]));
+ 1188 3886864 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][2][1][0]));
+ 1189 3886864 : asm volatile ("pshufb %xmm4,%xmm3");
+ 1190 3886864 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1191 3886864 : asm volatile ("pxor %xmm7,%xmm3");
1192 :
1193 : /* intermediate disks */
- 1194 16990192 : for (d = l - 1; d > 0; --d) {
- 1195 13959648 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
- 1196 13959648 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[0]));
- 1197 13959648 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
+ 1194 23263984 : for (d = l - 1; d > 0; --d) {
+ 1195 19377120 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
+ 1196 19377120 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[0]));
+ 1197 19377120 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
1198 :
- 1199 13959648 : asm volatile ("pxor %xmm5,%xmm5");
- 1200 13959648 : asm volatile ("pcmpgtb %xmm0,%xmm5");
- 1201 13959648 : asm volatile ("paddb %xmm0,%xmm0");
- 1202 13959648 : asm volatile ("pand %xmm7,%xmm5");
- 1203 13959648 : asm volatile ("pxor %xmm5,%xmm0");
+ 1199 19377120 : asm volatile ("pxor %xmm5,%xmm5");
+ 1200 19377120 : asm volatile ("pcmpgtb %xmm0,%xmm5");
+ 1201 19377120 : asm volatile ("paddb %xmm0,%xmm0");
+ 1202 19377120 : asm volatile ("pand %xmm7,%xmm5");
+ 1203 19377120 : asm volatile ("pxor %xmm5,%xmm0");
1204 :
- 1205 13959648 : asm volatile ("pxor %xmm4,%xmm0");
- 1206 13959648 : asm volatile ("pxor %xmm4,%xmm6");
- 1207 13959648 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pd[0]));
+ 1205 19377120 : asm volatile ("pxor %xmm4,%xmm0");
+ 1206 19377120 : asm volatile ("pxor %xmm4,%xmm6");
+ 1207 19377120 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pd[0]));
1208 :
- 1209 13959648 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
- 1210 13959648 : asm volatile ("movdqa %xmm4,%xmm5");
- 1211 13959648 : asm volatile ("psrlw $4,%xmm5");
- 1212 13959648 : asm volatile ("pand %xmm7,%xmm4");
- 1213 13959648 : asm volatile ("pand %xmm7,%xmm5");
+ 1209 19377120 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 1210 19377120 : asm volatile ("movdqa %xmm4,%xmm5");
+ 1211 19377120 : asm volatile ("psrlw $4,%xmm5");
+ 1212 19377120 : asm volatile ("pand %xmm7,%xmm4");
+ 1213 19377120 : asm volatile ("pand %xmm7,%xmm5");
1214 :
- 1215 13959648 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
- 1216 13959648 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][0][1][0]));
- 1217 13959648 : asm volatile ("pshufb %xmm4,%xmm6");
- 1218 13959648 : asm volatile ("pshufb %xmm5,%xmm7");
- 1219 13959648 : asm volatile ("pxor %xmm6,%xmm1");
- 1220 13959648 : asm volatile ("pxor %xmm7,%xmm1");
+ 1215 19377120 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
+ 1216 19377120 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][0][1][0]));
+ 1217 19377120 : asm volatile ("pshufb %xmm4,%xmm6");
+ 1218 19377120 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1219 19377120 : asm volatile ("pxor %xmm6,%xmm1");
+ 1220 19377120 : asm volatile ("pxor %xmm7,%xmm1");
1221 :
- 1222 13959648 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][1][0][0]));
- 1223 13959648 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][1][1][0]));
- 1224 13959648 : asm volatile ("pshufb %xmm4,%xmm6");
- 1225 13959648 : asm volatile ("pshufb %xmm5,%xmm7");
- 1226 13959648 : asm volatile ("pxor %xmm6,%xmm2");
- 1227 13959648 : asm volatile ("pxor %xmm7,%xmm2");
+ 1222 19377120 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][1][0][0]));
+ 1223 19377120 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][1][1][0]));
+ 1224 19377120 : asm volatile ("pshufb %xmm4,%xmm6");
+ 1225 19377120 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1226 19377120 : asm volatile ("pxor %xmm6,%xmm2");
+ 1227 19377120 : asm volatile ("pxor %xmm7,%xmm2");
1228 :
- 1229 13959648 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][2][0][0]));
- 1230 13959648 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][2][1][0]));
- 1231 13959648 : asm volatile ("pshufb %xmm4,%xmm6");
- 1232 13959648 : asm volatile ("pshufb %xmm5,%xmm7");
- 1233 13959648 : asm volatile ("pxor %xmm6,%xmm3");
- 1234 13959648 : asm volatile ("pxor %xmm7,%xmm3");
+ 1229 19377120 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][2][0][0]));
+ 1230 19377120 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][2][1][0]));
+ 1231 19377120 : asm volatile ("pshufb %xmm4,%xmm6");
+ 1232 19377120 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1233 19377120 : asm volatile ("pxor %xmm6,%xmm3");
+ 1234 19377120 : asm volatile ("pxor %xmm7,%xmm3");
1235 : }
1236 :
1237 : /* first disk with all coefficients at 1 */
- 1238 3030544 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
- 1239 3030544 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[0]));
- 1240 3030544 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
+ 1238 3886864 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
+ 1239 3886864 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[0]));
+ 1240 3886864 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
1241 :
- 1242 3030544 : asm volatile ("pxor %xmm5,%xmm5");
- 1243 3030544 : asm volatile ("pcmpgtb %xmm0,%xmm5");
- 1244 3030544 : asm volatile ("paddb %xmm0,%xmm0");
- 1245 3030544 : asm volatile ("pand %xmm7,%xmm5");
- 1246 3030544 : asm volatile ("pxor %xmm5,%xmm0");
+ 1242 3886864 : asm volatile ("pxor %xmm5,%xmm5");
+ 1243 3886864 : asm volatile ("pcmpgtb %xmm0,%xmm5");
+ 1244 3886864 : asm volatile ("paddb %xmm0,%xmm0");
+ 1245 3886864 : asm volatile ("pand %xmm7,%xmm5");
+ 1246 3886864 : asm volatile ("pxor %xmm5,%xmm0");
1247 :
- 1248 3030544 : asm volatile ("pxor %xmm4,%xmm0");
- 1249 3030544 : asm volatile ("pxor %xmm4,%xmm1");
- 1250 3030544 : asm volatile ("pxor %xmm4,%xmm2");
- 1251 3030544 : asm volatile ("pxor %xmm4,%xmm3");
- 1252 3030544 : asm volatile ("pxor %xmm4,%xmm6");
+ 1248 3886864 : asm volatile ("pxor %xmm4,%xmm0");
+ 1249 3886864 : asm volatile ("pxor %xmm4,%xmm1");
+ 1250 3886864 : asm volatile ("pxor %xmm4,%xmm2");
+ 1251 3886864 : asm volatile ("pxor %xmm4,%xmm3");
+ 1252 3886864 : asm volatile ("pxor %xmm4,%xmm6");
1253 :
- 1254 3030544 : asm volatile ("movntdq %%xmm6,%0" : "=m" (p[i]));
- 1255 3030544 : asm volatile ("movntdq %%xmm0,%0" : "=m" (q[i]));
- 1256 3030544 : asm volatile ("movntdq %%xmm1,%0" : "=m" (r[i]));
- 1257 3030544 : asm volatile ("movntdq %%xmm2,%0" : "=m" (s[i]));
- 1258 3030544 : asm volatile ("movntdq %%xmm3,%0" : "=m" (t[i]));
+ 1254 3886864 : asm volatile ("movntdq %%xmm6,%0" : "=m" (p[i]));
+ 1255 3886864 : asm volatile ("movntdq %%xmm0,%0" : "=m" (q[i]));
+ 1256 3886864 : asm volatile ("movntdq %%xmm1,%0" : "=m" (r[i]));
+ 1257 3886864 : asm volatile ("movntdq %%xmm2,%0" : "=m" (s[i]));
+ 1258 3886864 : asm volatile ("movntdq %%xmm3,%0" : "=m" (t[i]));
1259 : }
1260 :
1261 : raid_sse_end();
@@ -1591,9 +1591,9 @@
1529 : /*
1530 : * GEN6 (hexa parity with Cauchy matrix) SSSE3 implementation
1531 : */
- 1532 551783 : void raid_gen6_ssse3(int nd, size_t size, void **vv)
+ 1532 564140 : void raid_gen6_ssse3(int nd, size_t size, void **vv)
1533 : {
- 1534 551783 : uint8_t **v = (uint8_t **)vv;
+ 1534 564140 : uint8_t **v = (uint8_t **)vv;
1535 : uint8_t *p;
1536 : uint8_t *q;
1537 : uint8_t *r;
@@ -1603,142 +1603,142 @@
1541 : int d, l;
1542 : size_t i;
1543 : uint8_t buffer[2*16+16];
- 1544 551783 : uint8_t *pd = __align_ptr(buffer, 16);
+ 1544 564140 : uint8_t *pd = __align_ptr(buffer, 16);
1545 :
- 1546 551783 : l = nd - 1;
- 1547 551783 : p = v[nd];
- 1548 551783 : q = v[nd + 1];
- 1549 551783 : r = v[nd + 2];
- 1550 551783 : s = v[nd + 3];
- 1551 551783 : t = v[nd + 4];
- 1552 551783 : u = v[nd + 5];
+ 1546 564140 : l = nd - 1;
+ 1547 564140 : p = v[nd];
+ 1548 564140 : q = v[nd + 1];
+ 1549 564140 : r = v[nd + 2];
+ 1550 564140 : s = v[nd + 3];
+ 1551 564140 : t = v[nd + 4];
+ 1552 564140 : u = v[nd + 5];
1553 :
1554 : /* special case with only one data disk */
- 1555 551783 : if (l == 0) {
+ 1555 564140 : if (l == 0) {
1556 7 : for (i = 0; i < 6; ++i)
1557 6 : memcpy(v[1 + i], v[0], size);
- 1558 551784 : return;
+ 1558 564141 : return;
1559 : }
1560 :
1561 : raid_sse_begin();
1562 :
1563 : /* generic case with at least two data disks */
- 1564 35135798 : for (i = 0; i < size; i += 16) {
+ 1564 36095675 : for (i = 0; i < size; i += 16) {
1565 : /* last disk without the by two multiplication */
- 1566 34584016 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
+ 1566 35531536 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[l][i]));
1567 :
- 1568 34584016 : asm volatile ("movdqa %%xmm4,%0" : "=m" (pd[0]));
- 1569 34584016 : asm volatile ("movdqa %%xmm4,%0" : "=m" (pd[16]));
+ 1568 35531536 : asm volatile ("movdqa %%xmm4,%0" : "=m" (pd[0]));
+ 1569 35531536 : asm volatile ("movdqa %%xmm4,%0" : "=m" (pd[16]));
1570 :
- 1571 34584016 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
- 1572 34584016 : asm volatile ("movdqa %xmm4,%xmm5");
- 1573 34584016 : asm volatile ("psrlw $4,%xmm5");
- 1574 34584016 : asm volatile ("pand %xmm7,%xmm4");
- 1575 34584016 : asm volatile ("pand %xmm7,%xmm5");
+ 1571 35531536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 1572 35531536 : asm volatile ("movdqa %xmm4,%xmm5");
+ 1573 35531536 : asm volatile ("psrlw $4,%xmm5");
+ 1574 35531536 : asm volatile ("pand %xmm7,%xmm4");
+ 1575 35531536 : asm volatile ("pand %xmm7,%xmm5");
1576 :
- 1577 34584016 : asm volatile ("movdqa %0,%%xmm0" : : "m" (gfgenpshufb[l][0][0][0]));
- 1578 34584016 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][0][1][0]));
- 1579 34584016 : asm volatile ("pshufb %xmm4,%xmm0");
- 1580 34584016 : asm volatile ("pshufb %xmm5,%xmm7");
- 1581 34584016 : asm volatile ("pxor %xmm7,%xmm0");
+ 1577 35531536 : asm volatile ("movdqa %0,%%xmm0" : : "m" (gfgenpshufb[l][0][0][0]));
+ 1578 35531536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][0][1][0]));
+ 1579 35531536 : asm volatile ("pshufb %xmm4,%xmm0");
+ 1580 35531536 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1581 35531536 : asm volatile ("pxor %xmm7,%xmm0");
1582 :
- 1583 34584016 : asm volatile ("movdqa %0,%%xmm1" : : "m" (gfgenpshufb[l][1][0][0]));
- 1584 34584016 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][1][1][0]));
- 1585 34584016 : asm volatile ("pshufb %xmm4,%xmm1");
- 1586 34584016 : asm volatile ("pshufb %xmm5,%xmm7");
- 1587 34584016 : asm volatile ("pxor %xmm7,%xmm1");
+ 1583 35531536 : asm volatile ("movdqa %0,%%xmm1" : : "m" (gfgenpshufb[l][1][0][0]));
+ 1584 35531536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][1][1][0]));
+ 1585 35531536 : asm volatile ("pshufb %xmm4,%xmm1");
+ 1586 35531536 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1587 35531536 : asm volatile ("pxor %xmm7,%xmm1");
1588 :
- 1589 34584016 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][2][0][0]));
- 1590 34584016 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][2][1][0]));
- 1591 34584016 : asm volatile ("pshufb %xmm4,%xmm2");
- 1592 34584016 : asm volatile ("pshufb %xmm5,%xmm7");
- 1593 34584016 : asm volatile ("pxor %xmm7,%xmm2");
+ 1589 35531536 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfgenpshufb[l][2][0][0]));
+ 1590 35531536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][2][1][0]));
+ 1591 35531536 : asm volatile ("pshufb %xmm4,%xmm2");
+ 1592 35531536 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1593 35531536 : asm volatile ("pxor %xmm7,%xmm2");
1594 :
- 1595 34584016 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfgenpshufb[l][3][0][0]));
- 1596 34584016 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][3][1][0]));
- 1597 34584016 : asm volatile ("pshufb %xmm4,%xmm3");
- 1598 34584016 : asm volatile ("pshufb %xmm5,%xmm7");
- 1599 34584016 : asm volatile ("pxor %xmm7,%xmm3");
+ 1595 35531536 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfgenpshufb[l][3][0][0]));
+ 1596 35531536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[l][3][1][0]));
+ 1597 35531536 : asm volatile ("pshufb %xmm4,%xmm3");
+ 1598 35531536 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1599 35531536 : asm volatile ("pxor %xmm7,%xmm3");
1600 :
1601 : /* intermediate disks */
- 1602 176229552 : for (d = l - 1; d > 0; --d) {
- 1603 141645536 : asm volatile ("movdqa %0,%%xmm5" : : "m" (pd[0]));
- 1604 141645536 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[16]));
- 1605 141645536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
+ 1602 183662576 : for (d = l - 1; d > 0; --d) {
+ 1603 148131040 : asm volatile ("movdqa %0,%%xmm5" : : "m" (pd[0]));
+ 1604 148131040 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[16]));
+ 1605 148131040 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
1606 :
- 1607 141645536 : asm volatile ("pxor %xmm4,%xmm4");
- 1608 141645536 : asm volatile ("pcmpgtb %xmm6,%xmm4");
- 1609 141645536 : asm volatile ("paddb %xmm6,%xmm6");
- 1610 141645536 : asm volatile ("pand %xmm7,%xmm4");
- 1611 141645536 : asm volatile ("pxor %xmm4,%xmm6");
+ 1607 148131040 : asm volatile ("pxor %xmm4,%xmm4");
+ 1608 148131040 : asm volatile ("pcmpgtb %xmm6,%xmm4");
+ 1609 148131040 : asm volatile ("paddb %xmm6,%xmm6");
+ 1610 148131040 : asm volatile ("pand %xmm7,%xmm4");
+ 1611 148131040 : asm volatile ("pxor %xmm4,%xmm6");
1612 :
- 1613 141645536 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
+ 1613 148131040 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
1614 :
- 1615 141645536 : asm volatile ("pxor %xmm4,%xmm5");
- 1616 141645536 : asm volatile ("pxor %xmm4,%xmm6");
- 1617 141645536 : asm volatile ("movdqa %%xmm5,%0" : "=m" (pd[0]));
- 1618 141645536 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pd[16]));
+ 1615 148131040 : asm volatile ("pxor %xmm4,%xmm5");
+ 1616 148131040 : asm volatile ("pxor %xmm4,%xmm6");
+ 1617 148131040 : asm volatile ("movdqa %%xmm5,%0" : "=m" (pd[0]));
+ 1618 148131040 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pd[16]));
1619 :
- 1620 141645536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
- 1621 141645536 : asm volatile ("movdqa %xmm4,%xmm5");
- 1622 141645536 : asm volatile ("psrlw $4,%xmm5");
- 1623 141645536 : asm volatile ("pand %xmm7,%xmm4");
- 1624 141645536 : asm volatile ("pand %xmm7,%xmm5");
+ 1620 148131040 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 1621 148131040 : asm volatile ("movdqa %xmm4,%xmm5");
+ 1622 148131040 : asm volatile ("psrlw $4,%xmm5");
+ 1623 148131040 : asm volatile ("pand %xmm7,%xmm4");
+ 1624 148131040 : asm volatile ("pand %xmm7,%xmm5");
1625 :
- 1626 141645536 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
- 1627 141645536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][0][1][0]));
- 1628 141645536 : asm volatile ("pshufb %xmm4,%xmm6");
- 1629 141645536 : asm volatile ("pshufb %xmm5,%xmm7");
- 1630 141645536 : asm volatile ("pxor %xmm6,%xmm0");
- 1631 141645536 : asm volatile ("pxor %xmm7,%xmm0");
+ 1626 148131040 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][0][0][0]));
+ 1627 148131040 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][0][1][0]));
+ 1628 148131040 : asm volatile ("pshufb %xmm4,%xmm6");
+ 1629 148131040 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1630 148131040 : asm volatile ("pxor %xmm6,%xmm0");
+ 1631 148131040 : asm volatile ("pxor %xmm7,%xmm0");
1632 :
- 1633 141645536 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][1][0][0]));
- 1634 141645536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][1][1][0]));
- 1635 141645536 : asm volatile ("pshufb %xmm4,%xmm6");
- 1636 141645536 : asm volatile ("pshufb %xmm5,%xmm7");
- 1637 141645536 : asm volatile ("pxor %xmm6,%xmm1");
- 1638 141645536 : asm volatile ("pxor %xmm7,%xmm1");
+ 1633 148131040 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][1][0][0]));
+ 1634 148131040 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][1][1][0]));
+ 1635 148131040 : asm volatile ("pshufb %xmm4,%xmm6");
+ 1636 148131040 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1637 148131040 : asm volatile ("pxor %xmm6,%xmm1");
+ 1638 148131040 : asm volatile ("pxor %xmm7,%xmm1");
1639 :
- 1640 141645536 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][2][0][0]));
- 1641 141645536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][2][1][0]));
- 1642 141645536 : asm volatile ("pshufb %xmm4,%xmm6");
- 1643 141645536 : asm volatile ("pshufb %xmm5,%xmm7");
- 1644 141645536 : asm volatile ("pxor %xmm6,%xmm2");
- 1645 141645536 : asm volatile ("pxor %xmm7,%xmm2");
+ 1640 148131040 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][2][0][0]));
+ 1641 148131040 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][2][1][0]));
+ 1642 148131040 : asm volatile ("pshufb %xmm4,%xmm6");
+ 1643 148131040 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1644 148131040 : asm volatile ("pxor %xmm6,%xmm2");
+ 1645 148131040 : asm volatile ("pxor %xmm7,%xmm2");
1646 :
- 1647 141645536 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][3][0][0]));
- 1648 141645536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][3][1][0]));
- 1649 141645536 : asm volatile ("pshufb %xmm4,%xmm6");
- 1650 141645536 : asm volatile ("pshufb %xmm5,%xmm7");
- 1651 141645536 : asm volatile ("pxor %xmm6,%xmm3");
- 1652 141645536 : asm volatile ("pxor %xmm7,%xmm3");
+ 1647 148131040 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfgenpshufb[d][3][0][0]));
+ 1648 148131040 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfgenpshufb[d][3][1][0]));
+ 1649 148131040 : asm volatile ("pshufb %xmm4,%xmm6");
+ 1650 148131040 : asm volatile ("pshufb %xmm5,%xmm7");
+ 1651 148131040 : asm volatile ("pxor %xmm6,%xmm3");
+ 1652 148131040 : asm volatile ("pxor %xmm7,%xmm3");
1653 : }
1654 :
1655 : /* first disk with all coefficients at 1 */
- 1656 34584016 : asm volatile ("movdqa %0,%%xmm5" : : "m" (pd[0]));
- 1657 34584016 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[16]));
- 1658 34584016 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
+ 1656 35531536 : asm volatile ("movdqa %0,%%xmm5" : : "m" (pd[0]));
+ 1657 35531536 : asm volatile ("movdqa %0,%%xmm6" : : "m" (pd[16]));
+ 1658 35531536 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0]));
1659 :
- 1660 34584016 : asm volatile ("pxor %xmm4,%xmm4");
- 1661 34584016 : asm volatile ("pcmpgtb %xmm6,%xmm4");
- 1662 34584016 : asm volatile ("paddb %xmm6,%xmm6");
- 1663 34584016 : asm volatile ("pand %xmm7,%xmm4");
- 1664 34584016 : asm volatile ("pxor %xmm4,%xmm6");
+ 1660 35531536 : asm volatile ("pxor %xmm4,%xmm4");
+ 1661 35531536 : asm volatile ("pcmpgtb %xmm6,%xmm4");
+ 1662 35531536 : asm volatile ("paddb %xmm6,%xmm6");
+ 1663 35531536 : asm volatile ("pand %xmm7,%xmm4");
+ 1664 35531536 : asm volatile ("pxor %xmm4,%xmm6");
1665 :
- 1666 34584016 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
- 1667 34584016 : asm volatile ("pxor %xmm4,%xmm0");
- 1668 34584016 : asm volatile ("pxor %xmm4,%xmm1");
- 1669 34584016 : asm volatile ("pxor %xmm4,%xmm2");
- 1670 34584016 : asm volatile ("pxor %xmm4,%xmm3");
- 1671 34584016 : asm volatile ("pxor %xmm4,%xmm5");
- 1672 34584016 : asm volatile ("pxor %xmm4,%xmm6");
+ 1666 35531536 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[0][i]));
+ 1667 35531536 : asm volatile ("pxor %xmm4,%xmm0");
+ 1668 35531536 : asm volatile ("pxor %xmm4,%xmm1");
+ 1669 35531536 : asm volatile ("pxor %xmm4,%xmm2");
+ 1670 35531536 : asm volatile ("pxor %xmm4,%xmm3");
+ 1671 35531536 : asm volatile ("pxor %xmm4,%xmm5");
+ 1672 35531536 : asm volatile ("pxor %xmm4,%xmm6");
1673 :
- 1674 34584016 : asm volatile ("movntdq %%xmm5,%0" : "=m" (p[i]));
- 1675 34584016 : asm volatile ("movntdq %%xmm6,%0" : "=m" (q[i]));
- 1676 34584016 : asm volatile ("movntdq %%xmm0,%0" : "=m" (r[i]));
- 1677 34584016 : asm volatile ("movntdq %%xmm1,%0" : "=m" (s[i]));
- 1678 34584016 : asm volatile ("movntdq %%xmm2,%0" : "=m" (t[i]));
- 1679 34584016 : asm volatile ("movntdq %%xmm3,%0" : "=m" (u[i]));
+ 1674 35531536 : asm volatile ("movntdq %%xmm5,%0" : "=m" (p[i]));
+ 1675 35531536 : asm volatile ("movntdq %%xmm6,%0" : "=m" (q[i]));
+ 1676 35531536 : asm volatile ("movntdq %%xmm0,%0" : "=m" (r[i]));
+ 1677 35531536 : asm volatile ("movntdq %%xmm1,%0" : "=m" (s[i]));
+ 1678 35531536 : asm volatile ("movntdq %%xmm2,%0" : "=m" (t[i]));
+ 1679 35531536 : asm volatile ("movntdq %%xmm3,%0" : "=m" (u[i]));
1680 : }
1681 :
1682 : raid_sse_end();
@@ -2046,9 +2046,9 @@
1984 : /*
1985 : * RAID recovering for one disk SSSE3 implementation
1986 : */
- 1987 110866 : void raid_rec1_ssse3(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 1987 111201 : void raid_rec1_ssse3(int nr, int *id, int *ip, int nd, size_t size, void **vv)
1988 : {
- 1989 110866 : uint8_t **v = (uint8_t **)vv;
+ 1989 111201 : uint8_t **v = (uint8_t **)vv;
1990 : uint8_t *p;
1991 : uint8_t *pa;
1992 : uint8_t G;
@@ -2058,43 +2058,43 @@
1996 : (void)nr; /* unused, it's always 1 */
1997 :
1998 : /* if it's RAID5 uses the faster function */
- 1999 110866 : if (ip[0] == 0) {
- 2000 101003 : raid_rec1of1(id, nd, size, vv);
- 2001 211869 : return;
+ 1999 111201 : if (ip[0] == 0) {
+ 2000 101332 : raid_rec1of1(id, nd, size, vv);
+ 2001 212533 : return;
2002 : }
2003 :
2004 : /* setup the coefficients matrix */
- 2005 19726 : G = A(ip[0], id[0]);
+ 2005 19738 : G = A(ip[0], id[0]);
2006 :
2007 : /* invert it to solve the system of linear equations */
- 2008 19726 : V = inv(G);
+ 2008 19738 : V = inv(G);
2009 :
2010 : /* compute delta parity */
- 2011 9863 : raid_delta_gen(1, id, ip, nd, size, vv);
+ 2011 9869 : raid_delta_gen(1, id, ip, nd, size, vv);
2012 :
- 2013 9863 : p = v[nd + ip[0]];
- 2014 9863 : pa = v[id[0]];
+ 2013 9869 : p = v[nd + ip[0]];
+ 2014 9869 : pa = v[id[0]];
2015 :
2016 : raid_sse_begin();
2017 :
- 2018 9863 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
- 2019 9863 : asm volatile ("movdqa %0,%%xmm4" : : "m" (gfmulpshufb[V][0][0]));
- 2020 9863 : asm volatile ("movdqa %0,%%xmm5" : : "m" (gfmulpshufb[V][1][0]));
+ 2018 9869 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 2019 9869 : asm volatile ("movdqa %0,%%xmm4" : : "m" (gfmulpshufb[V][0][0]));
+ 2020 9869 : asm volatile ("movdqa %0,%%xmm5" : : "m" (gfmulpshufb[V][1][0]));
2021 :
- 2022 1160071 : for (i = 0; i < size; i += 16) {
- 2023 1150208 : asm volatile ("movdqa %0,%%xmm0" : : "m" (p[i]));
- 2024 1150208 : asm volatile ("movdqa %0,%%xmm1" : : "m" (pa[i]));
- 2025 1150208 : asm volatile ("movdqa %xmm4,%xmm2");
- 2026 1150208 : asm volatile ("movdqa %xmm5,%xmm3");
- 2027 1150208 : asm volatile ("pxor %xmm0,%xmm1");
- 2028 1150208 : asm volatile ("movdqa %xmm1,%xmm0");
- 2029 1150208 : asm volatile ("psrlw $4,%xmm1");
- 2030 1150208 : asm volatile ("pand %xmm7,%xmm0");
- 2031 1150208 : asm volatile ("pand %xmm7,%xmm1");
- 2032 1150208 : asm volatile ("pshufb %xmm0,%xmm2");
- 2033 1150208 : asm volatile ("pshufb %xmm1,%xmm3");
- 2034 1150208 : asm volatile ("pxor %xmm3,%xmm2");
- 2035 1150208 : asm volatile ("movdqa %%xmm2,%0" : "=m" (pa[i]));
+ 2022 1551373 : for (i = 0; i < size; i += 16) {
+ 2023 1541504 : asm volatile ("movdqa %0,%%xmm0" : : "m" (p[i]));
+ 2024 1541504 : asm volatile ("movdqa %0,%%xmm1" : : "m" (pa[i]));
+ 2025 1541504 : asm volatile ("movdqa %xmm4,%xmm2");
+ 2026 1541504 : asm volatile ("movdqa %xmm5,%xmm3");
+ 2027 1541504 : asm volatile ("pxor %xmm0,%xmm1");
+ 2028 1541504 : asm volatile ("movdqa %xmm1,%xmm0");
+ 2029 1541504 : asm volatile ("psrlw $4,%xmm1");
+ 2030 1541504 : asm volatile ("pand %xmm7,%xmm0");
+ 2031 1541504 : asm volatile ("pand %xmm7,%xmm1");
+ 2032 1541504 : asm volatile ("pshufb %xmm0,%xmm2");
+ 2033 1541504 : asm volatile ("pshufb %xmm1,%xmm3");
+ 2034 1541504 : asm volatile ("pxor %xmm3,%xmm2");
+ 2035 1541504 : asm volatile ("movdqa %%xmm2,%0" : "=m" (pa[i]));
2036 : }
2037 :
2038 : raid_sse_end();
@@ -2105,191 +2105,191 @@
2043 : /*
2044 : * RAID recovering for two disks SSSE3 implementation
2045 : */
- 2046 44124 : void raid_rec2_ssse3(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 2046 44277 : void raid_rec2_ssse3(int nr, int *id, int *ip, int nd, size_t size, void **vv)
2047 : {
- 2048 44124 : uint8_t **v = (uint8_t **)vv;
- 2049 44124 : const int N = 2;
- 2050 44124 : uint8_t *p[N];
- 2051 44124 : uint8_t *pa[N];
- 2052 44124 : uint8_t G[N * N];
- 2053 44124 : uint8_t V[N * N];
+ 2048 44277 : uint8_t **v = (uint8_t **)vv;
+ 2049 44277 : const int N = 2;
+ 2050 44277 : uint8_t *p[N];
+ 2051 44277 : uint8_t *pa[N];
+ 2052 44277 : uint8_t G[N * N];
+ 2053 44277 : uint8_t V[N * N];
2054 : size_t i;
2055 : int j, k;
2056 :
2057 : (void)nr; /* unused, it's always 2 */
2058 :
2059 : /* setup the coefficients matrix */
- 2060 132372 : for (j = 0; j < N; ++j)
- 2061 264744 : for (k = 0; k < N; ++k)
- 2062 352992 : G[j * N + k] = A(ip[j], id[k]);
+ 2060 132831 : for (j = 0; j < N; ++j)
+ 2061 265662 : for (k = 0; k < N; ++k)
+ 2062 354216 : G[j * N + k] = A(ip[j], id[k]);
2063 :
2064 : /* invert it to solve the system of linear equations */
- 2065 44124 : raid_invert(G, V, N);
+ 2065 44277 : raid_invert(G, V, N);
2066 :
2067 : /* compute delta parity */
- 2068 44124 : raid_delta_gen(N, id, ip, nd, size, vv);
+ 2068 44277 : raid_delta_gen(N, id, ip, nd, size, vv);
2069 :
- 2070 132372 : for (j = 0; j < N; ++j) {
- 2071 88248 : p[j] = v[nd + ip[j]];
- 2072 88248 : pa[j] = v[id[j]];
+ 2070 132831 : for (j = 0; j < N; ++j) {
+ 2071 88554 : p[j] = v[nd + ip[j]];
+ 2072 88554 : pa[j] = v[id[j]];
2073 : }
2074 :
2075 : raid_sse_begin();
2076 :
- 2077 44124 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 2077 44277 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
2078 :
- 2079 3074076 : for (i = 0; i < size; i += 16) {
- 2080 3029952 : asm volatile ("movdqa %0,%%xmm0" : : "m" (p[0][i]));
- 2081 3029952 : asm volatile ("movdqa %0,%%xmm2" : : "m" (pa[0][i]));
- 2082 3029952 : asm volatile ("movdqa %0,%%xmm1" : : "m" (p[1][i]));
- 2083 3029952 : asm volatile ("movdqa %0,%%xmm3" : : "m" (pa[1][i]));
- 2084 3029952 : asm volatile ("pxor %xmm2,%xmm0");
- 2085 3029952 : asm volatile ("pxor %xmm3,%xmm1");
+ 2079 3604341 : for (i = 0; i < size; i += 16) {
+ 2080 3560064 : asm volatile ("movdqa %0,%%xmm0" : : "m" (p[0][i]));
+ 2081 3560064 : asm volatile ("movdqa %0,%%xmm2" : : "m" (pa[0][i]));
+ 2082 3560064 : asm volatile ("movdqa %0,%%xmm1" : : "m" (p[1][i]));
+ 2083 3560064 : asm volatile ("movdqa %0,%%xmm3" : : "m" (pa[1][i]));
+ 2084 3560064 : asm volatile ("pxor %xmm2,%xmm0");
+ 2085 3560064 : asm volatile ("pxor %xmm3,%xmm1");
2086 :
- 2087 3029952 : asm volatile ("pxor %xmm6,%xmm6");
+ 2087 3560064 : asm volatile ("pxor %xmm6,%xmm6");
2088 :
- 2089 3029952 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[0]][0][0]));
- 2090 3029952 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[0]][1][0]));
- 2091 3029952 : asm volatile ("movdqa %xmm0,%xmm4");
- 2092 3029952 : asm volatile ("movdqa %xmm0,%xmm5");
- 2093 3029952 : asm volatile ("psrlw $4,%xmm5");
- 2094 3029952 : asm volatile ("pand %xmm7,%xmm4");
- 2095 3029952 : asm volatile ("pand %xmm7,%xmm5");
- 2096 3029952 : asm volatile ("pshufb %xmm4,%xmm2");
- 2097 3029952 : asm volatile ("pshufb %xmm5,%xmm3");
- 2098 3029952 : asm volatile ("pxor %xmm2,%xmm6");
- 2099 3029952 : asm volatile ("pxor %xmm3,%xmm6");
+ 2089 3560064 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[0]][0][0]));
+ 2090 3560064 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[0]][1][0]));
+ 2091 3560064 : asm volatile ("movdqa %xmm0,%xmm4");
+ 2092 3560064 : asm volatile ("movdqa %xmm0,%xmm5");
+ 2093 3560064 : asm volatile ("psrlw $4,%xmm5");
+ 2094 3560064 : asm volatile ("pand %xmm7,%xmm4");
+ 2095 3560064 : asm volatile ("pand %xmm7,%xmm5");
+ 2096 3560064 : asm volatile ("pshufb %xmm4,%xmm2");
+ 2097 3560064 : asm volatile ("pshufb %xmm5,%xmm3");
+ 2098 3560064 : asm volatile ("pxor %xmm2,%xmm6");
+ 2099 3560064 : asm volatile ("pxor %xmm3,%xmm6");
2100 :
- 2101 3029952 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[1]][0][0]));
- 2102 3029952 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[1]][1][0]));
- 2103 3029952 : asm volatile ("movdqa %xmm1,%xmm4");
- 2104 3029952 : asm volatile ("movdqa %xmm1,%xmm5");
- 2105 3029952 : asm volatile ("psrlw $4,%xmm5");
- 2106 3029952 : asm volatile ("pand %xmm7,%xmm4");
- 2107 3029952 : asm volatile ("pand %xmm7,%xmm5");
- 2108 3029952 : asm volatile ("pshufb %xmm4,%xmm2");
- 2109 3029952 : asm volatile ("pshufb %xmm5,%xmm3");
- 2110 3029952 : asm volatile ("pxor %xmm2,%xmm6");
- 2111 3029952 : asm volatile ("pxor %xmm3,%xmm6");
+ 2101 3560064 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[1]][0][0]));
+ 2102 3560064 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[1]][1][0]));
+ 2103 3560064 : asm volatile ("movdqa %xmm1,%xmm4");
+ 2104 3560064 : asm volatile ("movdqa %xmm1,%xmm5");
+ 2105 3560064 : asm volatile ("psrlw $4,%xmm5");
+ 2106 3560064 : asm volatile ("pand %xmm7,%xmm4");
+ 2107 3560064 : asm volatile ("pand %xmm7,%xmm5");
+ 2108 3560064 : asm volatile ("pshufb %xmm4,%xmm2");
+ 2109 3560064 : asm volatile ("pshufb %xmm5,%xmm3");
+ 2110 3560064 : asm volatile ("pxor %xmm2,%xmm6");
+ 2111 3560064 : asm volatile ("pxor %xmm3,%xmm6");
2112 :
- 2113 3029952 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pa[0][i]));
+ 2113 3560064 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pa[0][i]));
2114 :
- 2115 3029952 : asm volatile ("pxor %xmm6,%xmm6");
+ 2115 3560064 : asm volatile ("pxor %xmm6,%xmm6");
2116 :
- 2117 3029952 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[2]][0][0]));
- 2118 3029952 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[2]][1][0]));
- 2119 3029952 : asm volatile ("movdqa %xmm0,%xmm4");
- 2120 3029952 : asm volatile ("movdqa %xmm0,%xmm5");
- 2121 3029952 : asm volatile ("psrlw $4,%xmm5");
- 2122 3029952 : asm volatile ("pand %xmm7,%xmm4");
- 2123 3029952 : asm volatile ("pand %xmm7,%xmm5");
- 2124 3029952 : asm volatile ("pshufb %xmm4,%xmm2");
- 2125 3029952 : asm volatile ("pshufb %xmm5,%xmm3");
- 2126 3029952 : asm volatile ("pxor %xmm2,%xmm6");
- 2127 3029952 : asm volatile ("pxor %xmm3,%xmm6");
+ 2117 3560064 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[2]][0][0]));
+ 2118 3560064 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[2]][1][0]));
+ 2119 3560064 : asm volatile ("movdqa %xmm0,%xmm4");
+ 2120 3560064 : asm volatile ("movdqa %xmm0,%xmm5");
+ 2121 3560064 : asm volatile ("psrlw $4,%xmm5");
+ 2122 3560064 : asm volatile ("pand %xmm7,%xmm4");
+ 2123 3560064 : asm volatile ("pand %xmm7,%xmm5");
+ 2124 3560064 : asm volatile ("pshufb %xmm4,%xmm2");
+ 2125 3560064 : asm volatile ("pshufb %xmm5,%xmm3");
+ 2126 3560064 : asm volatile ("pxor %xmm2,%xmm6");
+ 2127 3560064 : asm volatile ("pxor %xmm3,%xmm6");
2128 :
- 2129 3029952 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[3]][0][0]));
- 2130 3029952 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[3]][1][0]));
- 2131 3029952 : asm volatile ("movdqa %xmm1,%xmm4");
- 2132 3029952 : asm volatile ("movdqa %xmm1,%xmm5");
- 2133 3029952 : asm volatile ("psrlw $4,%xmm5");
- 2134 3029952 : asm volatile ("pand %xmm7,%xmm4");
- 2135 3029952 : asm volatile ("pand %xmm7,%xmm5");
- 2136 3029952 : asm volatile ("pshufb %xmm4,%xmm2");
- 2137 3029952 : asm volatile ("pshufb %xmm5,%xmm3");
- 2138 3029952 : asm volatile ("pxor %xmm2,%xmm6");
- 2139 3029952 : asm volatile ("pxor %xmm3,%xmm6");
+ 2129 3560064 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[V[3]][0][0]));
+ 2130 3560064 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[V[3]][1][0]));
+ 2131 3560064 : asm volatile ("movdqa %xmm1,%xmm4");
+ 2132 3560064 : asm volatile ("movdqa %xmm1,%xmm5");
+ 2133 3560064 : asm volatile ("psrlw $4,%xmm5");
+ 2134 3560064 : asm volatile ("pand %xmm7,%xmm4");
+ 2135 3560064 : asm volatile ("pand %xmm7,%xmm5");
+ 2136 3560064 : asm volatile ("pshufb %xmm4,%xmm2");
+ 2137 3560064 : asm volatile ("pshufb %xmm5,%xmm3");
+ 2138 3560064 : asm volatile ("pxor %xmm2,%xmm6");
+ 2139 3560064 : asm volatile ("pxor %xmm3,%xmm6");
2140 :
- 2141 3029952 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pa[1][i]));
+ 2141 3560064 : asm volatile ("movdqa %%xmm6,%0" : "=m" (pa[1][i]));
2142 : }
2143 :
2144 : raid_sse_end();
- 2145 44124 : }
+ 2145 44277 : }
2146 : #endif
2147 :
2148 : #if defined(CONFIG_X86) && defined(CONFIG_SSSE3)
2149 : /*
2150 : * RAID recovering SSSE3 implementation
2151 : */
- 2152 79244 : void raid_recX_ssse3(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 2152 79288 : void raid_recX_ssse3(int nr, int *id, int *ip, int nd, size_t size, void **vv)
2153 : {
- 2154 79244 : uint8_t **v = (uint8_t **)vv;
- 2155 79244 : int N = nr;
+ 2154 79288 : uint8_t **v = (uint8_t **)vv;
+ 2155 79288 : int N = nr;
2156 : uint8_t *p[RAID_PARITY_MAX];
2157 : uint8_t *pa[RAID_PARITY_MAX];
2158 : uint8_t G[RAID_PARITY_MAX * RAID_PARITY_MAX];
2159 : uint8_t V[RAID_PARITY_MAX * RAID_PARITY_MAX];
2160 : uint8_t buffer[RAID_PARITY_MAX*16+16];
- 2161 79244 : uint8_t *pd = __align_ptr(buffer, 16);
+ 2161 79288 : uint8_t *pd = __align_ptr(buffer, 16);
2162 : size_t i;
2163 : int j, k;
2164 :
2165 : /* setup the coefficients matrix */
- 2166 434842 : for (j = 0; j < N; ++j)
- 2167 2045062 : for (k = 0; k < N; ++k)
- 2168 3378928 : G[j * N + k] = A(ip[j], id[k]);
+ 2166 435102 : for (j = 0; j < N; ++j)
+ 2167 2046374 : for (k = 0; k < N; ++k)
+ 2168 3381120 : G[j * N + k] = A(ip[j], id[k]);
2169 :
2170 : /* invert it to solve the system of linear equations */
- 2171 79244 : raid_invert(G, V, N);
+ 2171 79288 : raid_invert(G, V, N);
2172 :
2173 : /* compute delta parity */
- 2174 79244 : raid_delta_gen(N, id, ip, nd, size, vv);
+ 2174 79288 : raid_delta_gen(N, id, ip, nd, size, vv);
2175 :
- 2176 434842 : for (j = 0; j < N; ++j) {
- 2177 355598 : p[j] = v[nd + ip[j]];
- 2178 355598 : pa[j] = v[id[j]];
+ 2176 435102 : for (j = 0; j < N; ++j) {
+ 2177 355814 : p[j] = v[nd + ip[j]];
+ 2178 355814 : pa[j] = v[id[j]];
2179 : }
2180 :
2181 : raid_sse_begin();
2182 :
- 2183 79244 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
+ 2183 79288 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfconst16.low4[0]));
2184 :
- 2185 4955356 : for (i = 0; i < size; i += 16) {
+ 2185 5869832 : for (i = 0; i < size; i += 16) {
2186 : /* delta */
- 2187 26887888 : for (j = 0; j < N; ++j) {
- 2188 22011776 : asm volatile ("movdqa %0,%%xmm0" : : "m" (p[j][i]));
- 2189 22011776 : asm volatile ("movdqa %0,%%xmm1" : : "m" (pa[j][i]));
- 2190 22011776 : asm volatile ("pxor %xmm1,%xmm0");
- 2191 22011776 : asm volatile ("movdqa %%xmm0,%0" : "=m" (pd[j*16]));
+ 2187 32115408 : for (j = 0; j < N; ++j) {
+ 2188 26324864 : asm volatile ("movdqa %0,%%xmm0" : : "m" (p[j][i]));
+ 2189 26324864 : asm volatile ("movdqa %0,%%xmm1" : : "m" (pa[j][i]));
+ 2190 26324864 : asm volatile ("pxor %xmm1,%xmm0");
+ 2191 26324864 : asm volatile ("movdqa %%xmm0,%0" : "=m" (pd[j*16]));
2192 : }
2193 :
2194 : /* reconstruct */
- 2195 26887888 : for (j = 0; j < N; ++j) {
- 2196 22011776 : asm volatile ("pxor %xmm0,%xmm0");
- 2197 22011776 : asm volatile ("pxor %xmm1,%xmm1");
+ 2195 32115408 : for (j = 0; j < N; ++j) {
+ 2196 26324864 : asm volatile ("pxor %xmm0,%xmm0");
+ 2197 26324864 : asm volatile ("pxor %xmm1,%xmm1");
2198 :
- 2199 127583296 : for (k = 0; k < N; ++k) {
- 2200 105571520 : uint8_t m = V[j * N + k];
+ 2199 153207872 : for (k = 0; k < N; ++k) {
+ 2200 126883008 : uint8_t m = V[j * N + k];
2201 :
- 2202 105571520 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[m][0][0]));
- 2203 105571520 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[m][1][0]));
- 2204 105571520 : asm volatile ("movdqa %0,%%xmm4" : : "m" (pd[k*16]));
- 2205 105571520 : asm volatile ("movdqa %xmm4,%xmm5");
- 2206 105571520 : asm volatile ("psrlw $4,%xmm5");
- 2207 105571520 : asm volatile ("pand %xmm7,%xmm4");
- 2208 105571520 : asm volatile ("pand %xmm7,%xmm5");
- 2209 105571520 : asm volatile ("pshufb %xmm4,%xmm2");
- 2210 105571520 : asm volatile ("pshufb %xmm5,%xmm3");
- 2211 105571520 : asm volatile ("pxor %xmm2,%xmm0");
- 2212 105571520 : asm volatile ("pxor %xmm3,%xmm1");
+ 2202 126883008 : asm volatile ("movdqa %0,%%xmm2" : : "m" (gfmulpshufb[m][0][0]));
+ 2203 126883008 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfmulpshufb[m][1][0]));
+ 2204 126883008 : asm volatile ("movdqa %0,%%xmm4" : : "m" (pd[k*16]));
+ 2205 126883008 : asm volatile ("movdqa %xmm4,%xmm5");
+ 2206 126883008 : asm volatile ("psrlw $4,%xmm5");
+ 2207 126883008 : asm volatile ("pand %xmm7,%xmm4");
+ 2208 126883008 : asm volatile ("pand %xmm7,%xmm5");
+ 2209 126883008 : asm volatile ("pshufb %xmm4,%xmm2");
+ 2210 126883008 : asm volatile ("pshufb %xmm5,%xmm3");
+ 2211 126883008 : asm volatile ("pxor %xmm2,%xmm0");
+ 2212 126883008 : asm volatile ("pxor %xmm3,%xmm1");
2213 : }
2214 :
- 2215 22011776 : asm volatile ("pxor %xmm1,%xmm0");
- 2216 22011776 : asm volatile ("movdqa %%xmm0,%0" : "=m" (pa[j][i]));
+ 2215 26324864 : asm volatile ("pxor %xmm1,%xmm0");
+ 2216 26324864 : asm volatile ("movdqa %%xmm0,%0" : "=m" (pa[j][i]));
2217 : }
2218 : }
2219 :
2220 : raid_sse_end();
- 2221 79244 : }
+ 2221 79288 : }
2222 : #endif
2223 :
2224 : #if defined(CONFIG_X86) && defined(CONFIG_AVX2)
2225 : /*
2226 : * RAID recovering for one disk AVX2 implementation
2227 : */
- 2228 0 : void raid_rec1_avx2(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 2228 126 : void raid_rec1_avx2(int nr, int *id, int *ip, int nd, size_t size, void **vv)
2229 : {
- 2230 0 : uint8_t **v = (uint8_t **)vv;
+ 2230 126 : uint8_t **v = (uint8_t **)vv;
2231 : uint8_t *p;
2232 : uint8_t *pa;
2233 : uint8_t G;
@@ -2299,40 +2299,40 @@
2237 : (void)nr; /* unused, it's always 1 */
2238 :
2239 : /* if it's RAID5 uses the faster function */
- 2240 0 : if (ip[0] == 0) {
- 2241 0 : raid_rec1of1(id, nd, size, vv);
- 2242 0 : return;
+ 2240 126 : if (ip[0] == 0) {
+ 2241 30 : raid_rec1of1(id, nd, size, vv);
+ 2242 156 : return;
2243 : }
2244 :
2245 : /* setup the coefficients matrix */
- 2246 0 : G = A(ip[0], id[0]);
+ 2246 192 : G = A(ip[0], id[0]);
2247 :
2248 : /* invert it to solve the system of linear equations */
- 2249 0 : V = inv(G);
+ 2249 192 : V = inv(G);
2250 :
2251 : /* compute delta parity */
- 2252 0 : raid_delta_gen(1, id, ip, nd, size, vv);
+ 2252 96 : raid_delta_gen(1, id, ip, nd, size, vv);
2253 :
- 2254 0 : p = v[nd + ip[0]];
- 2255 0 : pa = v[id[0]];
+ 2254 96 : p = v[nd + ip[0]];
+ 2255 96 : pa = v[id[0]];
2256 :
2257 : raid_avx_begin();
2258 :
- 2259 0 : asm volatile ("vbroadcasti128 %0,%%ymm7" : : "m" (gfconst16.low4[0]));
- 2260 0 : asm volatile ("vbroadcasti128 %0,%%ymm4" : : "m" (gfmulpshufb[V][0][0]));
- 2261 0 : asm volatile ("vbroadcasti128 %0,%%ymm5" : : "m" (gfmulpshufb[V][1][0]));
+ 2259 96 : asm volatile ("vbroadcasti128 %0,%%ymm7" : : "m" (gfconst16.low4[0]));
+ 2260 96 : asm volatile ("vbroadcasti128 %0,%%ymm4" : : "m" (gfmulpshufb[V][0][0]));
+ 2261 96 : asm volatile ("vbroadcasti128 %0,%%ymm5" : : "m" (gfmulpshufb[V][1][0]));
2262 :
- 2263 0 : for (i = 0; i < size; i += 32) {
- 2264 0 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (p[i]));
- 2265 0 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (pa[i]));
- 2266 0 : asm volatile ("vpxor %ymm1,%ymm0,%ymm0");
- 2267 0 : asm volatile ("vpsrlw $4,%ymm0,%ymm1");
- 2268 0 : asm volatile ("vpand %ymm7,%ymm0,%ymm0");
- 2269 0 : asm volatile ("vpand %ymm7,%ymm1,%ymm1");
- 2270 0 : asm volatile ("vpshufb %ymm0,%ymm4,%ymm2");
- 2271 0 : asm volatile ("vpshufb %ymm1,%ymm5,%ymm3");
- 2272 0 : asm volatile ("vpxor %ymm3,%ymm2,%ymm2");
- 2273 0 : asm volatile ("vmovdqa %%ymm2,%0" : "=m" (pa[i]));
+ 2263 66816 : for (i = 0; i < size; i += 32) {
+ 2264 66720 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (p[i]));
+ 2265 66720 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (pa[i]));
+ 2266 66720 : asm volatile ("vpxor %ymm1,%ymm0,%ymm0");
+ 2267 66720 : asm volatile ("vpsrlw $4,%ymm0,%ymm1");
+ 2268 66720 : asm volatile ("vpand %ymm7,%ymm0,%ymm0");
+ 2269 66720 : asm volatile ("vpand %ymm7,%ymm1,%ymm1");
+ 2270 66720 : asm volatile ("vpshufb %ymm0,%ymm4,%ymm2");
+ 2271 66720 : asm volatile ("vpshufb %ymm1,%ymm5,%ymm3");
+ 2272 66720 : asm volatile ("vpxor %ymm3,%ymm2,%ymm2");
+ 2273 66720 : asm volatile ("vmovdqa %%ymm2,%0" : "=m" (pa[i]));
2274 : }
2275 :
2276 : raid_avx_end();
@@ -2343,173 +2343,173 @@
2281 : /*
2282 : * RAID recovering for two disks AVX2 implementation
2283 : */
- 2284 0 : void raid_rec2_avx2(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 2284 1206 : void raid_rec2_avx2(int nr, int *id, int *ip, int nd, size_t size, void **vv)
2285 : {
- 2286 0 : uint8_t **v = (uint8_t **)vv;
- 2287 0 : const int N = 2;
- 2288 0 : uint8_t *p[N];
- 2289 0 : uint8_t *pa[N];
- 2290 0 : uint8_t G[N * N];
- 2291 0 : uint8_t V[N * N];
+ 2286 1206 : uint8_t **v = (uint8_t **)vv;
+ 2287 1206 : const int N = 2;
+ 2288 1206 : uint8_t *p[N];
+ 2289 1206 : uint8_t *pa[N];
+ 2290 1206 : uint8_t G[N * N];
+ 2291 1206 : uint8_t V[N * N];
2292 : size_t i;
2293 : int j, k;
2294 :
2295 : (void)nr; /* unused, it's always 2 */
2296 :
2297 : /* setup the coefficients matrix */
- 2298 0 : for (j = 0; j < N; ++j)
- 2299 0 : for (k = 0; k < N; ++k)
- 2300 0 : G[j * N + k] = A(ip[j], id[k]);
+ 2298 3618 : for (j = 0; j < N; ++j)
+ 2299 7236 : for (k = 0; k < N; ++k)
+ 2300 9648 : G[j * N + k] = A(ip[j], id[k]);
2301 :
2302 : /* invert it to solve the system of linear equations */
- 2303 0 : raid_invert(G, V, N);
+ 2303 1206 : raid_invert(G, V, N);
2304 :
2305 : /* compute delta parity */
- 2306 0 : raid_delta_gen(N, id, ip, nd, size, vv);
+ 2306 1206 : raid_delta_gen(N, id, ip, nd, size, vv);
2307 :
- 2308 0 : for (j = 0; j < N; ++j) {
- 2309 0 : p[j] = v[nd + ip[j]];
- 2310 0 : pa[j] = v[id[j]];
+ 2308 3618 : for (j = 0; j < N; ++j) {
+ 2309 2412 : p[j] = v[nd + ip[j]];
+ 2310 2412 : pa[j] = v[id[j]];
2311 : }
2312 :
2313 : raid_avx_begin();
2314 :
- 2315 0 : asm volatile ("vbroadcasti128 %0,%%ymm7" : : "m" (gfconst16.low4[0]));
+ 2315 1206 : asm volatile ("vbroadcasti128 %0,%%ymm7" : : "m" (gfconst16.low4[0]));
2316 :
- 2317 0 : for (i = 0; i < size; i += 32) {
- 2318 0 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (p[0][i]));
- 2319 0 : asm volatile ("vmovdqa %0,%%ymm2" : : "m" (pa[0][i]));
- 2320 0 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (p[1][i]));
- 2321 0 : asm volatile ("vmovdqa %0,%%ymm3" : : "m" (pa[1][i]));
- 2322 0 : asm volatile ("vpxor %ymm2,%ymm0,%ymm0");
- 2323 0 : asm volatile ("vpxor %ymm3,%ymm1,%ymm1");
+ 2317 77526 : for (i = 0; i < size; i += 32) {
+ 2318 76320 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (p[0][i]));
+ 2319 76320 : asm volatile ("vmovdqa %0,%%ymm2" : : "m" (pa[0][i]));
+ 2320 76320 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (p[1][i]));
+ 2321 76320 : asm volatile ("vmovdqa %0,%%ymm3" : : "m" (pa[1][i]));
+ 2322 76320 : asm volatile ("vpxor %ymm2,%ymm0,%ymm0");
+ 2323 76320 : asm volatile ("vpxor %ymm3,%ymm1,%ymm1");
2324 :
- 2325 0 : asm volatile ("vpxor %ymm6,%ymm6,%ymm6");
+ 2325 76320 : asm volatile ("vpxor %ymm6,%ymm6,%ymm6");
2326 :
- 2327 0 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[0]][0][0]));
- 2328 0 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[0]][1][0]));
- 2329 0 : asm volatile ("vpsrlw $4,%ymm0,%ymm5");
- 2330 0 : asm volatile ("vpand %ymm7,%ymm0,%ymm4");
- 2331 0 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
- 2332 0 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
- 2333 0 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
- 2334 0 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
- 2335 0 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
+ 2327 76320 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[0]][0][0]));
+ 2328 76320 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[0]][1][0]));
+ 2329 76320 : asm volatile ("vpsrlw $4,%ymm0,%ymm5");
+ 2330 76320 : asm volatile ("vpand %ymm7,%ymm0,%ymm4");
+ 2331 76320 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
+ 2332 76320 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
+ 2333 76320 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
+ 2334 76320 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
+ 2335 76320 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
2336 :
- 2337 0 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[1]][0][0]));
- 2338 0 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[1]][1][0]));
- 2339 0 : asm volatile ("vpsrlw $4,%ymm1,%ymm5");
- 2340 0 : asm volatile ("vpand %ymm7,%ymm1,%ymm4");
- 2341 0 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
- 2342 0 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
- 2343 0 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
- 2344 0 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
- 2345 0 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
+ 2337 76320 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[1]][0][0]));
+ 2338 76320 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[1]][1][0]));
+ 2339 76320 : asm volatile ("vpsrlw $4,%ymm1,%ymm5");
+ 2340 76320 : asm volatile ("vpand %ymm7,%ymm1,%ymm4");
+ 2341 76320 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
+ 2342 76320 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
+ 2343 76320 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
+ 2344 76320 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
+ 2345 76320 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
2346 :
- 2347 0 : asm volatile ("vmovdqa %%ymm6,%0" : "=m" (pa[0][i]));
+ 2347 76320 : asm volatile ("vmovdqa %%ymm6,%0" : "=m" (pa[0][i]));
2348 :
- 2349 0 : asm volatile ("vpxor %ymm6,%ymm6,%ymm6");
+ 2349 76320 : asm volatile ("vpxor %ymm6,%ymm6,%ymm6");
2350 :
- 2351 0 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[2]][0][0]));
- 2352 0 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[2]][1][0]));
- 2353 0 : asm volatile ("vpsrlw $4,%ymm0,%ymm5");
- 2354 0 : asm volatile ("vpand %ymm7,%ymm0,%ymm4");
- 2355 0 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
- 2356 0 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
- 2357 0 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
- 2358 0 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
- 2359 0 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
+ 2351 76320 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[2]][0][0]));
+ 2352 76320 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[2]][1][0]));
+ 2353 76320 : asm volatile ("vpsrlw $4,%ymm0,%ymm5");
+ 2354 76320 : asm volatile ("vpand %ymm7,%ymm0,%ymm4");
+ 2355 76320 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
+ 2356 76320 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
+ 2357 76320 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
+ 2358 76320 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
+ 2359 76320 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
2360 :
- 2361 0 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[3]][0][0]));
- 2362 0 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[3]][1][0]));
- 2363 0 : asm volatile ("vpsrlw $4,%ymm1,%ymm5");
- 2364 0 : asm volatile ("vpand %ymm7,%ymm1,%ymm4");
- 2365 0 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
- 2366 0 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
- 2367 0 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
- 2368 0 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
- 2369 0 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
+ 2361 76320 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[V[3]][0][0]));
+ 2362 76320 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[V[3]][1][0]));
+ 2363 76320 : asm volatile ("vpsrlw $4,%ymm1,%ymm5");
+ 2364 76320 : asm volatile ("vpand %ymm7,%ymm1,%ymm4");
+ 2365 76320 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
+ 2366 76320 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
+ 2367 76320 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
+ 2368 76320 : asm volatile ("vpxor %ymm2,%ymm6,%ymm6");
+ 2369 76320 : asm volatile ("vpxor %ymm3,%ymm6,%ymm6");
2370 :
- 2371 0 : asm volatile ("vmovdqa %%ymm6,%0" : "=m" (pa[1][i]));
+ 2371 76320 : asm volatile ("vmovdqa %%ymm6,%0" : "=m" (pa[1][i]));
2372 : }
2373 :
2374 : raid_avx_end();
- 2375 0 : }
+ 2375 1206 : }
2376 : #endif
2377 :
2378 : #if defined(CONFIG_X86) && defined(CONFIG_AVX2)
2379 : /*
2380 : * RAID recovering AVX2 implementation
2381 : */
- 2382 0 : void raid_recX_avx2(int nr, int *id, int *ip, int nd, size_t size, void **vv)
+ 2382 17765 : void raid_recX_avx2(int nr, int *id, int *ip, int nd, size_t size, void **vv)
2383 : {
- 2384 0 : uint8_t **v = (uint8_t **)vv;
- 2385 0 : int N = nr;
+ 2384 17765 : uint8_t **v = (uint8_t **)vv;
+ 2385 17765 : int N = nr;
2386 : uint8_t *p[RAID_PARITY_MAX];
2387 : uint8_t *pa[RAID_PARITY_MAX];
2388 : uint8_t G[RAID_PARITY_MAX * RAID_PARITY_MAX];
2389 : uint8_t V[RAID_PARITY_MAX * RAID_PARITY_MAX];
2390 : uint8_t buffer[RAID_PARITY_MAX*32+32];
- 2391 0 : uint8_t *pd = __align_ptr(buffer, 32);
+ 2391 17765 : uint8_t *pd = __align_ptr(buffer, 32);
2392 : size_t i;
2393 : int j, k;
2394 :
2395 : /* setup the coefficients matrix */
- 2396 0 : for (j = 0; j < N; ++j)
- 2397 0 : for (k = 0; k < N; ++k)
- 2398 0 : G[j * N + k] = A(ip[j], id[k]);
+ 2396 90821 : for (j = 0; j < N; ++j)
+ 2397 386396 : for (k = 0; k < N; ++k)
+ 2398 626680 : G[j * N + k] = A(ip[j], id[k]);
2399 :
2400 : /* invert it to solve the system of linear equations */
- 2401 0 : raid_invert(G, V, N);
+ 2401 17765 : raid_invert(G, V, N);
2402 :
2403 : /* compute delta parity */
- 2404 0 : raid_delta_gen(N, id, ip, nd, size, vv);
+ 2404 17765 : raid_delta_gen(N, id, ip, nd, size, vv);
2405 :
- 2406 0 : for (j = 0; j < N; ++j) {
- 2407 0 : p[j] = v[nd + ip[j]];
- 2408 0 : pa[j] = v[id[j]];
+ 2406 90821 : for (j = 0; j < N; ++j) {
+ 2407 73056 : p[j] = v[nd + ip[j]];
+ 2408 73056 : pa[j] = v[id[j]];
2409 : }
2410 :
2411 : raid_avx_begin();
2412 :
- 2413 0 : asm volatile ("vbroadcasti128 %0,%%ymm7" : : "m" (gfconst16.low4[0]));
+ 2413 17765 : asm volatile ("vbroadcasti128 %0,%%ymm7" : : "m" (gfconst16.low4[0]));
2414 :
- 2415 0 : for (i = 0; i < size; i += 32) {
+ 2415 423213 : for (i = 0; i < size; i += 32) {
2416 : /* delta */
- 2417 0 : for (j = 0; j < N; ++j) {
- 2418 0 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (p[j][i]));
- 2419 0 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (pa[j][i]));
- 2420 0 : asm volatile ("vpxor %ymm1,%ymm0,%ymm0");
- 2421 0 : asm volatile ("vmovdqa %%ymm0,%0" : "=m" (pd[j*32]));
+ 2417 2174152 : for (j = 0; j < N; ++j) {
+ 2418 1768704 : asm volatile ("vmovdqa %0,%%ymm0" : : "m" (p[j][i]));
+ 2419 1768704 : asm volatile ("vmovdqa %0,%%ymm1" : : "m" (pa[j][i]));
+ 2420 1768704 : asm volatile ("vpxor %ymm1,%ymm0,%ymm0");
+ 2421 1768704 : asm volatile ("vmovdqa %%ymm0,%0" : "=m" (pd[j*32]));
2422 : }
2423 :
2424 : /* reconstruct */
- 2425 0 : for (j = 0; j < N; ++j) {
- 2426 0 : asm volatile ("vpxor %ymm0,%ymm0,%ymm0");
- 2427 0 : asm volatile ("vpxor %ymm1,%ymm1,%ymm1");
+ 2425 2174152 : for (j = 0; j < N; ++j) {
+ 2426 1768704 : asm volatile ("vpxor %ymm0,%ymm0,%ymm0");
+ 2427 1768704 : asm volatile ("vpxor %ymm1,%ymm1,%ymm1");
2428 :
- 2429 0 : for (k = 0; k < N; ++k) {
- 2430 0 : uint8_t m = V[j * N + k];
+ 2429 9930976 : for (k = 0; k < N; ++k) {
+ 2430 8162272 : uint8_t m = V[j * N + k];
2431 :
- 2432 0 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[m][0][0]));
- 2433 0 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[m][1][0]));
- 2434 0 : asm volatile ("vmovdqa %0,%%ymm4" : : "m" (pd[k*32]));
- 2435 0 : asm volatile ("vpsrlw $4,%ymm4,%ymm5");
- 2436 0 : asm volatile ("vpand %ymm7,%ymm4,%ymm4");
- 2437 0 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
- 2438 0 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
- 2439 0 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
- 2440 0 : asm volatile ("vpxor %ymm2,%ymm0,%ymm0");
- 2441 0 : asm volatile ("vpxor %ymm3,%ymm1,%ymm1");
+ 2432 8162272 : asm volatile ("vbroadcasti128 %0,%%ymm2" : : "m" (gfmulpshufb[m][0][0]));
+ 2433 8162272 : asm volatile ("vbroadcasti128 %0,%%ymm3" : : "m" (gfmulpshufb[m][1][0]));
+ 2434 8162272 : asm volatile ("vmovdqa %0,%%ymm4" : : "m" (pd[k*32]));
+ 2435 8162272 : asm volatile ("vpsrlw $4,%ymm4,%ymm5");
+ 2436 8162272 : asm volatile ("vpand %ymm7,%ymm4,%ymm4");
+ 2437 8162272 : asm volatile ("vpand %ymm7,%ymm5,%ymm5");
+ 2438 8162272 : asm volatile ("vpshufb %ymm4,%ymm2,%ymm2");
+ 2439 8162272 : asm volatile ("vpshufb %ymm5,%ymm3,%ymm3");
+ 2440 8162272 : asm volatile ("vpxor %ymm2,%ymm0,%ymm0");
+ 2441 8162272 : asm volatile ("vpxor %ymm3,%ymm1,%ymm1");
2442 : }
2443 :
- 2444 0 : asm volatile ("vpxor %ymm1,%ymm0,%ymm0");
- 2445 0 : asm volatile ("vmovdqa %%ymm0,%0" : "=m" (pa[j][i]));
+ 2444 1768704 : asm volatile ("vpxor %ymm1,%ymm0,%ymm0");
+ 2445 1768704 : asm volatile ("vmovdqa %%ymm0,%0" : "=m" (pa[j][i]));
2446 : }
2447 : }
2448 :
2449 : raid_avx_end();
- 2450 0 : }
+ 2450 17765 : }
2451 : #endif
2452 :
diff --git a/cov/raid/x86z.c.func-sort-c.html b/cov/raid/x86z.c.func-sort-c.html
index 23344f5f..66ea680d 100644
--- a/cov/raid/x86z.c.func-sort-c.html
+++ b/cov/raid/x86z.c.func-sort-c.html
@@ -61,7 +61,7 @@
| raid_genz_sse2 |
- 755 |
+ 1175 |
diff --git a/cov/raid/x86z.c.func.html b/cov/raid/x86z.c.func.html
index 4ef6777e..35e764a4 100644
--- a/cov/raid/x86z.c.func.html
+++ b/cov/raid/x86z.c.func.html
@@ -61,7 +61,7 @@
| raid_genz_sse2 |
- 755 |
+ 1175 |
diff --git a/cov/raid/x86z.c.gcov.html b/cov/raid/x86z.c.gcov.html
index e3b76687..98fd341d 100644
--- a/cov/raid/x86z.c.gcov.html
+++ b/cov/raid/x86z.c.gcov.html
@@ -102,58 +102,58 @@
40 : /*
41 : * GENz (triple parity with powers of 2^-1) SSE2 implementation
42 : */
- 43 755 : void raid_genz_sse2(int nd, size_t size, void **vv)
+ 43 1175 : void raid_genz_sse2(int nd, size_t size, void **vv)
44 : {
- 45 755 : uint8_t **v = (uint8_t**)vv;
+ 45 1175 : uint8_t **v = (uint8_t**)vv;
46 : uint8_t *p;
47 : uint8_t *q;
48 : uint8_t *r;
49 : int d, l;
50 : size_t i;
51 :
- 52 755 : l = nd - 1;
- 53 755 : p = v[nd];
- 54 755 : q = v[nd + 1];
- 55 755 : r = v[nd + 2];
+ 52 1175 : l = nd - 1;
+ 53 1175 : p = v[nd];
+ 54 1175 : q = v[nd + 1];
+ 55 1175 : r = v[nd + 2];
56 :
57 : raid_sse_begin();
58 :
- 59 755 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfzconst16.poly[0]));
- 60 755 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfzconst16.half[0]));
- 61 755 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfzconst16.low7[0]));
+ 59 1175 : asm volatile ("movdqa %0,%%xmm7" : : "m" (gfzconst16.poly[0]));
+ 60 1175 : asm volatile ("movdqa %0,%%xmm3" : : "m" (gfzconst16.half[0]));
+ 61 1175 : asm volatile ("movdqa %0,%%xmm6" : : "m" (gfzconst16.low7[0]));
62 :
- 63 438403 : for (i = 0; i < size; i += 16) {
- 64 437648 : asm volatile ("movdqa %0,%%xmm0" : : "m" (v[l][i]));
- 65 437648 : asm volatile ("movdqa %xmm0,%xmm1");
- 66 437648 : asm volatile ("movdqa %xmm0,%xmm2");
- 67 3548160 : for (d = l - 1; d >= 0; --d) {
- 68 3110512 : asm volatile ("pxor %xmm4,%xmm4");
- 69 3110512 : asm volatile ("pcmpgtb %xmm1,%xmm4");
- 70 3110512 : asm volatile ("paddb %xmm1,%xmm1");
- 71 3110512 : asm volatile ("pand %xmm7,%xmm4");
- 72 3110512 : asm volatile ("pxor %xmm4,%xmm1");
+ 63 1362151 : for (i = 0; i < size; i += 16) {
+ 64 1360976 : asm volatile ("movdqa %0,%%xmm0" : : "m" (v[l][i]));
+ 65 1360976 : asm volatile ("movdqa %xmm0,%xmm1");
+ 66 1360976 : asm volatile ("movdqa %xmm0,%xmm2");
+ 67 10958080 : for (d = l - 1; d >= 0; --d) {
+ 68 9597104 : asm volatile ("pxor %xmm4,%xmm4");
+ 69 9597104 : asm volatile ("pcmpgtb %xmm1,%xmm4");
+ 70 9597104 : asm volatile ("paddb %xmm1,%xmm1");
+ 71 9597104 : asm volatile ("pand %xmm7,%xmm4");
+ 72 9597104 : asm volatile ("pxor %xmm4,%xmm1");
73 :
- 74 3110512 : asm volatile ("movdqa %xmm2,%xmm4");
- 75 3110512 : asm volatile ("pxor %xmm5,%xmm5");
- 76 3110512 : asm volatile ("psllw $7,%xmm4");
- 77 3110512 : asm volatile ("psrlw $1,%xmm2");
- 78 3110512 : asm volatile ("pcmpgtb %xmm4,%xmm5");
- 79 3110512 : asm volatile ("pand %xmm6,%xmm2");
- 80 3110512 : asm volatile ("pand %xmm3,%xmm5");
- 81 3110512 : asm volatile ("pxor %xmm5,%xmm2");
+ 74 9597104 : asm volatile ("movdqa %xmm2,%xmm4");
+ 75 9597104 : asm volatile ("pxor %xmm5,%xmm5");
+ 76 9597104 : asm volatile ("psllw $7,%xmm4");
+ 77 9597104 : asm volatile ("psrlw $1,%xmm2");
+ 78 9597104 : asm volatile ("pcmpgtb %xmm4,%xmm5");
+ 79 9597104 : asm volatile ("pand %xmm6,%xmm2");
+ 80 9597104 : asm volatile ("pand %xmm3,%xmm5");
+ 81 9597104 : asm volatile ("pxor %xmm5,%xmm2");
82 :
- 83 3110512 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
- 84 3110512 : asm volatile ("pxor %xmm4,%xmm0");
- 85 3110512 : asm volatile ("pxor %xmm4,%xmm1");
- 86 3110512 : asm volatile ("pxor %xmm4,%xmm2");
+ 83 9597104 : asm volatile ("movdqa %0,%%xmm4" : : "m" (v[d][i]));
+ 84 9597104 : asm volatile ("pxor %xmm4,%xmm0");
+ 85 9597104 : asm volatile ("pxor %xmm4,%xmm1");
+ 86 9597104 : asm volatile ("pxor %xmm4,%xmm2");
87 : }
- 88 437648 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
- 89 437648 : asm volatile ("movntdq %%xmm1,%0" : "=m" (q[i]));
- 90 437648 : asm volatile ("movntdq %%xmm2,%0" : "=m" (r[i]));
+ 88 1360976 : asm volatile ("movntdq %%xmm0,%0" : "=m" (p[i]));
+ 89 1360976 : asm volatile ("movntdq %%xmm1,%0" : "=m" (q[i]));
+ 90 1360976 : asm volatile ("movntdq %%xmm2,%0" : "=m" (r[i]));
91 : }
92 :
93 : raid_sse_end();
- 94 755 : }
+ 94 1175 : }
95 : #endif
96 :
97 : #if defined(CONFIG_X86_64) && defined(CONFIG_SSE2)
diff --git a/cov/tommyds/index-sort-f.html b/cov/tommyds/index-sort-f.html
index d27390a7..08c3e846 100644
--- a/cov/tommyds/index-sort-f.html
+++ b/cov/tommyds/index-sort-f.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -192,10 +192,10 @@
| tommylist.h |
-
+
|
- 98.5 % |
- 64 / 65 |
+ 100.0 % |
+ 65 / 65 |
100.0 % |
11 / 11 |
diff --git a/cov/tommyds/index-sort-l.html b/cov/tommyds/index-sort-l.html
index 0bfb9318..ea3ee796 100644
--- a/cov/tommyds/index-sort-l.html
+++ b/cov/tommyds/index-sort-l.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -69,16 +69,6 @@
Line Coverage  |
Functions  |
-
- | tommylist.h |
-
-
- |
- 98.5 % |
- 64 / 65 |
- 100.0 % |
- 11 / 11 |
-
| tommytree.h |
@@ -169,6 +159,16 @@
| 100.0 % |
4 / 4 |
+
+ | tommylist.h |
+
+
+ |
+ 100.0 % |
+ 65 / 65 |
+ 100.0 % |
+ 11 / 11 |
+
| tommychain.h |
diff --git a/cov/tommyds/index.html b/cov/tommyds/index.html
index 8857edb3..40867411 100644
--- a/cov/tommyds/index.html
+++ b/cov/tommyds/index.html
@@ -31,9 +31,9 @@
|
|
-
-
+
+
@@ -172,10 +172,10 @@
| tommylist.h |
-
+
|
- 98.5 % |
- 64 / 65 |
+ 100.0 % |
+ 65 / 65 |
100.0 % |
11 / 11 |
diff --git a/cov/tommyds/tommyarray.h.func-sort-c.html b/cov/tommyds/tommyarray.h.func-sort-c.html
index ba37bee8..5c231686 100644
--- a/cov/tommyds/tommyarray.h.func-sort-c.html
+++ b/cov/tommyds/tommyarray.h.func-sort-c.html
@@ -61,11 +61,11 @@
| tommy_array_ref |
- 10264168 |
+ 10268450 |
| tommy_array_get |
- 10261966 |
+ 10266248 |
| tommy_array_size |
diff --git a/cov/tommyds/tommyarray.h.func.html b/cov/tommyds/tommyarray.h.func.html
index c365bae5..81a02afe 100644
--- a/cov/tommyds/tommyarray.h.func.html
+++ b/cov/tommyds/tommyarray.h.func.html
@@ -61,7 +61,7 @@
| tommy_array_get |
- 10261966 |
+ 10266248 |
| tommy_array_insert |
@@ -69,7 +69,7 @@
| tommy_array_ref |
- 10264168 |
+ 10268450 |
| tommy_array_set |
diff --git a/cov/tommyds/tommyarray.h.gcov.html b/cov/tommyds/tommyarray.h.gcov.html
index d78f9401..c6b33ddb 100644
--- a/cov/tommyds/tommyarray.h.gcov.html
+++ b/cov/tommyds/tommyarray.h.gcov.html
@@ -152,16 +152,16 @@
90 : * You must be sure that space for this position is already
91 : * allocated calling tommy_array_grow().
92 : */
- 93 10264168 : tommy_inline void** tommy_array_ref(tommy_array* array, tommy_count_t pos)
+ 93 10268450 : tommy_inline void** tommy_array_ref(tommy_array* array, tommy_count_t pos)
94 : {
95 : tommy_uint_t bsr;
96 :
- 97 10264168 : assert(pos < array->count);
+ 97 10268450 : assert(pos < array->count);
98 :
99 : /* get the highest bit set, in case of all 0, return 0 */
- 100 10264168 : bsr = tommy_ilog2_u32(pos | 1);
+ 100 10268450 : bsr = tommy_ilog2_u32(pos | 1);
101 :
- 102 10264168 : return &array->bucket[bsr][pos];
+ 102 10268450 : return &array->bucket[bsr][pos];
103 : }
104 :
105 : /**
@@ -179,9 +179,9 @@
117 : * You must be sure that space for this position is already
118 : * allocated calling tommy_array_grow().
119 : */
- 120 10261966 : tommy_inline void* tommy_array_get(tommy_array* array, tommy_count_t pos)
+ 120 10266248 : tommy_inline void* tommy_array_get(tommy_array* array, tommy_count_t pos)
121 : {
- 122 10261966 : return *tommy_array_ref(array, pos);
+ 122 10266248 : return *tommy_array_ref(array, pos);
123 : }
124 :
125 : /**
diff --git a/cov/tommyds/tommyarrayblkof.c.func-sort-c.html b/cov/tommyds/tommyarrayblkof.c.func-sort-c.html
index 0be38770..3eaf9665 100644
--- a/cov/tommyds/tommyarrayblkof.c.func-sort-c.html
+++ b/cov/tommyds/tommyarrayblkof.c.func-sort-c.html
@@ -61,7 +61,7 @@
| tommy_arrayblkof_grow |
- 1698291 |
+ 1698221 |
| tommy_arrayblkof_init |
diff --git a/cov/tommyds/tommyarrayblkof.c.func.html b/cov/tommyds/tommyarrayblkof.c.func.html
index b6044427..2887d111 100644
--- a/cov/tommyds/tommyarrayblkof.c.func.html
+++ b/cov/tommyds/tommyarrayblkof.c.func.html
@@ -65,7 +65,7 @@
| tommy_arrayblkof_grow |
- 1698291 |
+ 1698221 |
| tommy_arrayblkof_init |
diff --git a/cov/tommyds/tommyarrayblkof.c.gcov.html b/cov/tommyds/tommyarrayblkof.c.gcov.html
index a8619884..e03fe466 100644
--- a/cov/tommyds/tommyarrayblkof.c.gcov.html
+++ b/cov/tommyds/tommyarrayblkof.c.gcov.html
@@ -110,13 +110,13 @@
48 244 : tommy_array_done(&array->block);
49 244 : }
50 :
- 51 1698291 : void tommy_arrayblkof_grow(tommy_arrayblkof* array, tommy_count_t count)
+ 51 1698221 : void tommy_arrayblkof_grow(tommy_arrayblkof* array, tommy_count_t count)
52 : {
53 : tommy_count_t block_max;
54 : tommy_count_t block_mac;
55 :
- 56 1698291 : if (array->count >= count)
- 57 1821687 : return;
+ 56 1698221 : if (array->count >= count)
+ 57 1821547 : return;
58 1574895 : array->count = count;
59 :
60 1574895 : block_max = (count + TOMMY_ARRAYBLKOF_SIZE - 1) / TOMMY_ARRAYBLKOF_SIZE;
diff --git a/cov/tommyds/tommyarrayblkof.h.func-sort-c.html b/cov/tommyds/tommyarrayblkof.h.func-sort-c.html
index 5f7c441d..5225e0d5 100644
--- a/cov/tommyds/tommyarrayblkof.h.func-sort-c.html
+++ b/cov/tommyds/tommyarrayblkof.h.func-sort-c.html
@@ -61,11 +61,11 @@
| tommy_arrayblkof_ref |
- 6529775 |
+ 6534208 |
| tommy_arrayblkof_size |
- 5093871 |
+ 5098374 |
diff --git a/cov/tommyds/tommyarrayblkof.h.func.html b/cov/tommyds/tommyarrayblkof.h.func.html
index c8fa76e6..5a41dd06 100644
--- a/cov/tommyds/tommyarrayblkof.h.func.html
+++ b/cov/tommyds/tommyarrayblkof.h.func.html
@@ -61,11 +61,11 @@
| tommy_arrayblkof_ref |
- 6529775 |
+ 6534208 |
| tommy_arrayblkof_size |
- 5093871 |
+ 5098374 |
diff --git a/cov/tommyds/tommyarrayblkof.h.gcov.html b/cov/tommyds/tommyarrayblkof.h.gcov.html
index 3a7c1a6c..4116fde7 100644
--- a/cov/tommyds/tommyarrayblkof.h.gcov.html
+++ b/cov/tommyds/tommyarrayblkof.h.gcov.html
@@ -148,23 +148,23 @@
86 : * You must be sure that space for this position is already
87 : * allocated calling tommy_arrayblkof_grow().
88 : */
- 89 6529775 : tommy_inline void* tommy_arrayblkof_ref(tommy_arrayblkof* array, tommy_count_t pos)
+ 89 6534208 : tommy_inline void* tommy_arrayblkof_ref(tommy_arrayblkof* array, tommy_count_t pos)
90 : {
91 : unsigned char* base;
92 :
- 93 6529775 : assert(pos < array->count);
+ 93 6534208 : assert(pos < array->count);
94 :
- 95 6529775 : base = tommy_cast(unsigned char*, tommy_array_get(&array->block, pos / TOMMY_ARRAYBLKOF_SIZE));
+ 95 6534208 : base = tommy_cast(unsigned char*, tommy_array_get(&array->block, pos / TOMMY_ARRAYBLKOF_SIZE));
96 :
- 97 6529775 : return base + (pos % TOMMY_ARRAYBLKOF_SIZE) * array->element_size;
+ 97 6534208 : return base + (pos % TOMMY_ARRAYBLKOF_SIZE) * array->element_size;
98 : }
99 :
100 : /**
101 : * Gets the initialized size of the array.
102 : */
- 103 5093871 : tommy_inline tommy_count_t tommy_arrayblkof_size(tommy_arrayblkof* array)
+ 103 5098374 : tommy_inline tommy_count_t tommy_arrayblkof_size(tommy_arrayblkof* array)
104 : {
- 105 5093871 : return array->count;
+ 105 5098374 : return array->count;
106 : }
107 :
108 : /**
diff --git a/cov/tommyds/tommychain.h.func-sort-c.html b/cov/tommyds/tommychain.h.func-sort-c.html
index b0c08054..aff5319b 100644
--- a/cov/tommyds/tommychain.h.func-sort-c.html
+++ b/cov/tommyds/tommychain.h.func-sort-c.html
@@ -61,19 +61,19 @@
| tommy_chain_splice |
- 4488945 |
+ 4502405 |
| tommy_chain_merge_degenerated |
- 1283277 |
+ 1283232 |
| tommy_chain_concat |
- 1276668 |
+ 1276403 |
| tommy_chain_merge |
- 470542 |
+ 471088 |
| tommy_chain_mergesort |
diff --git a/cov/tommyds/tommychain.h.func.html b/cov/tommyds/tommychain.h.func.html
index 0d8a577d..9025ad4e 100644
--- a/cov/tommyds/tommychain.h.func.html
+++ b/cov/tommyds/tommychain.h.func.html
@@ -61,15 +61,15 @@
| tommy_chain_concat |
- 1276668 |
+ 1276403 |
| tommy_chain_merge |
- 470542 |
+ 471088 |
| tommy_chain_merge_degenerated |
- 1283277 |
+ 1283232 |
| tommy_chain_mergesort |
@@ -77,7 +77,7 @@
| tommy_chain_splice |
- 4488945 |
+ 4502405 |
diff --git a/cov/tommyds/tommychain.h.gcov.html b/cov/tommyds/tommychain.h.gcov.html
index 862b7a05..d8fd9841 100644
--- a/cov/tommyds/tommychain.h.gcov.html
+++ b/cov/tommyds/tommychain.h.gcov.html
@@ -119,83 +119,83 @@
57 : /**
58 : * Splices a chain in the middle of another chain.
59 : */
- 60 4488945 : tommy_inline void tommy_chain_splice(tommy_node* first_before, tommy_node* first_after, tommy_node* second_head, tommy_node* second_tail)
+ 60 4502405 : tommy_inline void tommy_chain_splice(tommy_node* first_before, tommy_node* first_after, tommy_node* second_head, tommy_node* second_tail)
61 : {
62 : /* set the prev list */
- 63 4488945 : first_after->prev = second_tail;
- 64 4488945 : second_head->prev = first_before;
+ 63 4502405 : first_after->prev = second_tail;
+ 64 4502405 : second_head->prev = first_before;
65 :
66 : /* set the next list */
- 67 4488945 : first_before->next = second_head;
- 68 4488945 : second_tail->next = first_after;
- 69 4488945 : }
+ 67 4502405 : first_before->next = second_head;
+ 68 4502405 : second_tail->next = first_after;
+ 69 4502405 : }
70 :
71 : /**
72 : * Concats two chains.
73 : */
- 74 1276668 : tommy_inline void tommy_chain_concat(tommy_node* first_tail, tommy_node* second_head)
+ 74 1276403 : tommy_inline void tommy_chain_concat(tommy_node* first_tail, tommy_node* second_head)
75 : {
76 : /* set the prev list */
- 77 1276668 : second_head->prev = first_tail;
+ 77 1276403 : second_head->prev = first_tail;
78 :
79 : /* set the next list */
- 80 1276668 : first_tail->next = second_head;
- 81 1276668 : }
+ 80 1276403 : first_tail->next = second_head;
+ 81 1276403 : }
82 :
83 : /**
84 : * Merges two chains.
85 : */
- 86 470542 : tommy_inline void tommy_chain_merge(tommy_chain* first, tommy_chain* second, tommy_compare_func* cmp)
+ 86 471088 : tommy_inline void tommy_chain_merge(tommy_chain* first, tommy_chain* second, tommy_compare_func* cmp)
87 : {
- 88 470542 : tommy_node* first_i = first->head;
- 89 470542 : tommy_node* second_i = second->head;
+ 88 471088 : tommy_node* first_i = first->head;
+ 89 471088 : tommy_node* second_i = second->head;
90 :
91 : /* merge */
92 : while (1) {
- 93 9768977 : if (cmp(first_i->data, second_i->data) > 0) {
- 94 4721168 : tommy_node* next = second_i->next;
- 95 4721168 : if (first_i == first->head) {
- 96 232223 : tommy_chain_concat(second_i, first_i);
- 97 232223 : first->head = second_i;
+ 93 9796567 : if (cmp(first_i->data, second_i->data) > 0) {
+ 94 4734738 : tommy_node* next = second_i->next;
+ 95 4734738 : if (first_i == first->head) {
+ 96 232333 : tommy_chain_concat(second_i, first_i);
+ 97 232333 : first->head = second_i;
98 : } else {
- 99 4488945 : tommy_chain_splice(first_i->prev, first_i, second_i, second_i);
+ 99 4502405 : tommy_chain_splice(first_i->prev, first_i, second_i, second_i);
100 : }
- 101 4721168 : if (second_i == second->tail)
- 102 238832 : break;
- 103 4482336 : second_i = next;
+ 101 4734738 : if (second_i == second->tail)
+ 102 239162 : break;
+ 103 4495576 : second_i = next;
104 : } else {
- 105 5047809 : if (first_i == first->tail) {
- 106 231710 : tommy_chain_concat(first_i, second_i);
- 107 231710 : first->tail = second->tail;
- 108 231710 : break;
+ 105 5061829 : if (first_i == first->tail) {
+ 106 231926 : tommy_chain_concat(first_i, second_i);
+ 107 231926 : first->tail = second->tail;
+ 108 231926 : break;
109 : }
- 110 4816099 : first_i = first_i->next;
+ 110 4829903 : first_i = first_i->next;
111 : }
- 112 9298435 : }
- 113 470542 : }
+ 112 9325479 : }
+ 113 471088 : }
114 :
115 : /**
116 : * Merges two chains managing special degenerated cases.
117 : * It's funtionally equivalent at tommy_chain_merge() but faster with already ordered chains.
118 : */
- 119 1283277 : tommy_inline void tommy_chain_merge_degenerated(tommy_chain* first, tommy_chain* second, tommy_compare_func* cmp)
+ 119 1283232 : tommy_inline void tommy_chain_merge_degenerated(tommy_chain* first, tommy_chain* second, tommy_compare_func* cmp)
120 : {
121 : /* identify the condition first <= second */
- 122 1283277 : if (cmp(first->tail->data, second->head->data) <= 0) {
- 123 478049 : tommy_chain_concat(first->tail, second->head);
- 124 478049 : first->tail = second->tail;
- 125 478049 : return;
+ 122 1283232 : if (cmp(first->tail->data, second->head->data) <= 0) {
+ 123 477330 : tommy_chain_concat(first->tail, second->head);
+ 124 477330 : first->tail = second->tail;
+ 125 477330 : return;
126 : }
127 :
128 : /* identify the condition second < first */
129 : /* here we must be strict on comparison to keep the sort stable */
- 130 805228 : if (cmp(second->tail->data, first->head->data) < 0) {
- 131 334686 : tommy_chain_concat(second->tail, first->head);
- 132 334686 : first->head = second->head;
- 133 334686 : return;
+ 130 805902 : if (cmp(second->tail->data, first->head->data) < 0) {
+ 131 334814 : tommy_chain_concat(second->tail, first->head);
+ 132 334814 : first->head = second->head;
+ 133 334814 : return;
134 : }
135 :
- 136 470542 : tommy_chain_merge(first, second, cmp);
+ 136 471088 : tommy_chain_merge(first, second, cmp);
137 : }
138 :
139 : /**
@@ -241,42 +241,42 @@
179 : tommy_chain* last;
180 :
181 : /* carry bit to add */
- 182 1284961 : last = &bit[TOMMY_CHAIN_BIT_MAX];
- 183 1284961 : bit[TOMMY_CHAIN_BIT_MAX].head = node;
- 184 1284961 : bit[TOMMY_CHAIN_BIT_MAX].tail = node;
- 185 1284961 : next = node->next;
+ 182 1284916 : last = &bit[TOMMY_CHAIN_BIT_MAX];
+ 183 1284916 : bit[TOMMY_CHAIN_BIT_MAX].head = node;
+ 184 1284916 : bit[TOMMY_CHAIN_BIT_MAX].tail = node;
+ 185 1284916 : next = node->next;
186 :
187 : /* add the bit, propagating the carry */
- 188 1284961 : i = 0;
- 189 1284961 : mask = counter;
- 190 3847147 : while ((mask & 1) != 0) {
- 191 1277225 : tommy_chain_merge_degenerated(&bit[i], last, cmp);
- 192 1277225 : mask >>= 1;
- 193 1277225 : last = &bit[i];
- 194 1277225 : ++i;
+ 188 1284916 : i = 0;
+ 189 1284916 : mask = counter;
+ 190 3847013 : while ((mask & 1) != 0) {
+ 191 1277181 : tommy_chain_merge_degenerated(&bit[i], last, cmp);
+ 192 1277181 : mask >>= 1;
+ 193 1277181 : last = &bit[i];
+ 194 1277181 : ++i;
195 : }
196 :
197 : /* copy the carry in the first empty bit */
- 198 1284961 : bit[i] = *last;
+ 198 1284916 : bit[i] = *last;
199 :
200 : /* add the carry in the counter */
- 201 1284961 : ++counter;
+ 201 1284916 : ++counter;
202 :
- 203 1284961 : if (node == tail)
+ 203 1284916 : if (node == tail)
204 1684 : break;
- 205 1283277 : node = next;
- 206 1283277 : }
+ 205 1283232 : node = next;
+ 206 1283232 : }
207 :
208 : /* merge the buckets */
209 1684 : i = tommy_ctz_u32(counter);
210 1684 : mask = counter >> i;
- 211 12395 : while (mask != 1) {
- 212 9027 : mask >>= 1;
- 213 9027 : if (mask & 1)
- 214 6052 : tommy_chain_merge_degenerated(&bit[i + 1], &bit[i], cmp);
+ 211 12396 : while (mask != 1) {
+ 212 9028 : mask >>= 1;
+ 213 9028 : if (mask & 1)
+ 214 6051 : tommy_chain_merge_degenerated(&bit[i + 1], &bit[i], cmp);
215 : else
- 216 2975 : bit[i + 1] = bit[i];
- 217 9027 : ++i;
+ 216 2977 : bit[i + 1] = bit[i];
+ 217 9028 : ++i;
218 : }
219 :
220 1684 : *chain = bit[i];
diff --git a/cov/tommyds/tommyhash.c.func-sort-c.html b/cov/tommyds/tommyhash.c.func-sort-c.html
index 33dc0918..0e1009a9 100644
--- a/cov/tommyds/tommyhash.c.func-sort-c.html
+++ b/cov/tommyds/tommyhash.c.func-sort-c.html
@@ -61,11 +61,11 @@
| tommy_le_uint32_read |
- 11588068 |
+ 11587716 |
| tommy_hash_u32 |
- 4059980 |
+ 4059834 |
| tommy_strhash_u32 |
diff --git a/cov/tommyds/tommyhash.c.func.html b/cov/tommyds/tommyhash.c.func.html
index c9643387..1dc814cc 100644
--- a/cov/tommyds/tommyhash.c.func.html
+++ b/cov/tommyds/tommyhash.c.func.html
@@ -61,7 +61,7 @@
| tommy_hash_u32 |
- 4059980 |
+ 4059834 |
| tommy_hash_u64 |
@@ -69,7 +69,7 @@
| tommy_le_uint32_read |
- 11588068 |
+ 11587716 |
| tommy_strhash_u32 |
diff --git a/cov/tommyds/tommyhash.c.gcov.html b/cov/tommyds/tommyhash.c.gcov.html
index c9a5f607..9fd8bf6e 100644
--- a/cov/tommyds/tommyhash.c.gcov.html
+++ b/cov/tommyds/tommyhash.c.gcov.html
@@ -92,12 +92,12 @@
30 : /******************************************************************************/
31 : /* hash */
32 :
- 33 11588068 : tommy_inline tommy_uint32_t tommy_le_uint32_read(const void* ptr)
+ 33 11587716 : tommy_inline tommy_uint32_t tommy_le_uint32_read(const void* ptr)
34 : {
35 : /* allow unaligned read on Intel x86 and x86_64 platforms */
36 : #if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__x86_64__) || defined(_M_X64)
37 : /* defines from http://predef.sourceforge.net/ */
- 38 11588068 : return *(const tommy_uint32_t*)ptr;
+ 38 11587716 : return *(const tommy_uint32_t*)ptr;
39 : #else
40 : const unsigned char* ptr8 = tommy_cast(const unsigned char*, ptr);
41 : return ptr8[0] + ((tommy_uint32_t)ptr8[1] << 8) + ((tommy_uint32_t)ptr8[2] << 16) + ((tommy_uint32_t)ptr8[3] << 24);
@@ -128,53 +128,53 @@
66 : c ^= b; c -= tommy_rot(b, 24); \
67 : } while (0)
68 :
- 69 4059980 : tommy_uint32_t tommy_hash_u32(tommy_uint32_t init_val, const void* void_key, tommy_size_t key_len)
+ 69 4059834 : tommy_uint32_t tommy_hash_u32(tommy_uint32_t init_val, const void* void_key, tommy_size_t key_len)
70 : {
- 71 4059980 : const unsigned char* key = tommy_cast(const unsigned char*, void_key);
+ 71 4059834 : const unsigned char* key = tommy_cast(const unsigned char*, void_key);
72 : tommy_uint32_t a, b, c;
73 :
- 74 4059980 : a = b = c = 0xdeadbeef + ((tommy_uint32_t)key_len) + init_val;
+ 74 4059834 : a = b = c = 0xdeadbeef + ((tommy_uint32_t)key_len) + init_val;
75 :
- 76 10240282 : while (key_len > 12) {
- 77 2120322 : a += tommy_le_uint32_read(key + 0);
- 78 2120322 : b += tommy_le_uint32_read(key + 4);
- 79 2120322 : c += tommy_le_uint32_read(key + 8);
+ 76 10239927 : while (key_len > 12) {
+ 77 2120259 : a += tommy_le_uint32_read(key + 0);
+ 78 2120259 : b += tommy_le_uint32_read(key + 4);
+ 79 2120259 : c += tommy_le_uint32_read(key + 8);
80 :
- 81 2120322 : tommy_mix(a, b, c);
+ 81 2120259 : tommy_mix(a, b, c);
82 :
- 83 2120322 : key_len -= 12;
- 84 2120322 : key += 12;
+ 83 2120259 : key_len -= 12;
+ 84 2120259 : key += 12;
85 : }
86 :
- 87 4059980 : switch (key_len) {
+ 87 4059834 : switch (key_len) {
88 : case 0 :
89 1 : return c; /* used only when called with a zero length */
90 : case 12 :
- 91 207725 : c += tommy_le_uint32_read(key + 8);
- 92 207725 : b += tommy_le_uint32_read(key + 4);
- 93 207725 : a += tommy_le_uint32_read(key + 0);
- 94 207725 : break;
- 95 217414 : case 11 : c += ((tommy_uint32_t)key[10]) << 16;
- 96 640353 : case 10 : c += ((tommy_uint32_t)key[9]) << 8;
- 97 1060088 : case 9 : c += key[8];
+ 91 207749 : c += tommy_le_uint32_read(key + 8);
+ 92 207749 : b += tommy_le_uint32_read(key + 4);
+ 93 207749 : a += tommy_le_uint32_read(key + 0);
+ 94 207749 : break;
+ 95 217406 : case 11 : c += ((tommy_uint32_t)key[10]) << 16;
+ 96 640298 : case 10 : c += ((tommy_uint32_t)key[9]) << 8;
+ 97 1060028 : case 9 : c += key[8];
98 : case 8 :
- 99 1471035 : b += tommy_le_uint32_read(key + 4);
- 100 1471035 : a += tommy_le_uint32_read(key + 0);
- 101 1471035 : break;
- 102 413146 : case 7 : b += ((tommy_uint32_t)key[6]) << 16;
- 103 812931 : case 6 : b += ((tommy_uint32_t)key[5]) << 8;
- 104 1229650 : case 5 : b += key[4];
+ 99 1470945 : b += tommy_le_uint32_read(key + 4);
+ 100 1470945 : a += tommy_le_uint32_read(key + 0);
+ 101 1470945 : break;
+ 102 413147 : case 7 : b += ((tommy_uint32_t)key[6]) << 16;
+ 103 812922 : case 6 : b += ((tommy_uint32_t)key[5]) << 8;
+ 104 1229617 : case 5 : b += key[4];
105 : case 4 :
- 106 1661723 : a += tommy_le_uint32_read(key + 0);
- 107 1661723 : break;
- 108 301724 : case 3 : a += ((tommy_uint32_t)key[2]) << 16;
- 109 509517 : case 2 : a += ((tommy_uint32_t)key[1]) << 8;
- 110 719496 : case 1 : a += key[0];
+ 106 1661668 : a += tommy_le_uint32_read(key + 0);
+ 107 1661668 : break;
+ 108 301716 : case 3 : a += ((tommy_uint32_t)key[2]) << 16;
+ 109 509499 : case 2 : a += ((tommy_uint32_t)key[1]) << 8;
+ 110 719471 : case 1 : a += key[0];
111 : }
112 :
- 113 4059979 : tommy_final(a, b, c);
+ 113 4059833 : tommy_final(a, b, c);
114 :
- 115 4059979 : return c;
+ 115 4059833 : return c;
116 : }
117 :
118 19 : tommy_uint64_t tommy_hash_u64(tommy_uint64_t init_val, const void* void_key, tommy_size_t key_len)
diff --git a/cov/tommyds/tommyhash.h.func-sort-c.html b/cov/tommyds/tommyhash.h.func-sort-c.html
index d5ce8a3f..cd71c362 100644
--- a/cov/tommyds/tommyhash.h.func-sort-c.html
+++ b/cov/tommyds/tommyhash.h.func-sort-c.html
@@ -61,11 +61,11 @@
| tommy_inthash_u32 |
- 18827331 |
+ 18827742 |
| tommy_inthash_u64 |
- 5047944 |
+ 5047846 |
diff --git a/cov/tommyds/tommyhash.h.func.html b/cov/tommyds/tommyhash.h.func.html
index dec15cb0..85bde6e0 100644
--- a/cov/tommyds/tommyhash.h.func.html
+++ b/cov/tommyds/tommyhash.h.func.html
@@ -61,11 +61,11 @@
| tommy_inthash_u32 |
- 18827331 |
+ 18827742 |
| tommy_inthash_u64 |
- 5047944 |
+ 5047846 |
diff --git a/cov/tommyds/tommyhash.h.gcov.html b/cov/tommyds/tommyhash.h.gcov.html
index ee86a587..0f8705fe 100644
--- a/cov/tommyds/tommyhash.h.gcov.html
+++ b/cov/tommyds/tommyhash.h.gcov.html
@@ -167,17 +167,17 @@
105 : * Implementation of the Robert Jenkins "4-byte Integer Hashing",
106 : * from http://burtleburtle.net/bob/hash/integer.html
107 : */
- 108 18827331 : tommy_inline tommy_uint32_t tommy_inthash_u32(tommy_uint32_t key)
+ 108 18827742 : tommy_inline tommy_uint32_t tommy_inthash_u32(tommy_uint32_t key)
109 : {
- 110 18827331 : key -= key << 6;
- 111 18827331 : key ^= key >> 17;
- 112 18827331 : key -= key << 9;
- 113 18827331 : key ^= key << 4;
- 114 18827331 : key -= key << 3;
- 115 18827331 : key ^= key << 10;
- 116 18827331 : key ^= key >> 15;
+ 110 18827742 : key -= key << 6;
+ 111 18827742 : key ^= key >> 17;
+ 112 18827742 : key -= key << 9;
+ 113 18827742 : key ^= key << 4;
+ 114 18827742 : key -= key << 3;
+ 115 18827742 : key ^= key << 10;
+ 116 18827742 : key ^= key >> 15;
117 :
- 118 18827331 : return key;
+ 118 18827742 : return key;
119 : }
120 :
121 : /**
@@ -185,17 +185,17 @@
123 : * Implementation of the Thomas Wang "Integer Hash Function",
124 : * from http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
125 : */
- 126 5047944 : tommy_inline tommy_uint64_t tommy_inthash_u64(tommy_uint64_t key)
+ 126 5047846 : tommy_inline tommy_uint64_t tommy_inthash_u64(tommy_uint64_t key)
127 : {
- 128 5047944 : key = ~key + (key << 21);
- 129 5047944 : key = key ^ (key >> 24);
- 130 5047944 : key = key + (key << 3) + (key << 8);
- 131 5047944 : key = key ^ (key >> 14);
- 132 5047944 : key = key + (key << 2) + (key << 4);
- 133 5047944 : key = key ^ (key >> 28);
- 134 5047944 : key = key + (key << 31);
+ 128 5047846 : key = ~key + (key << 21);
+ 129 5047846 : key = key ^ (key >> 24);
+ 130 5047846 : key = key + (key << 3) + (key << 8);
+ 131 5047846 : key = key ^ (key >> 14);
+ 132 5047846 : key = key + (key << 2) + (key << 4);
+ 133 5047846 : key = key ^ (key >> 28);
+ 134 5047846 : key = key + (key << 31);
135 :
- 136 5047944 : return key;
+ 136 5047846 : return key;
137 : }
138 :
139 : #endif
diff --git a/cov/tommyds/tommyhashdyn.c.func-sort-c.html b/cov/tommyds/tommyhashdyn.c.func-sort-c.html
index fb075697..5ef41753 100644
--- a/cov/tommyds/tommyhashdyn.c.func-sort-c.html
+++ b/cov/tommyds/tommyhashdyn.c.func-sort-c.html
@@ -61,19 +61,19 @@
| hashdyn_grow_step |
- 13238040 |
+ 13237087 |
| tommy_hashdyn_insert |
- 13238040 |
+ 13237087 |
| hashdyn_shrink_step |
- 281966 |
+ 281913 |
| tommy_hashdyn_remove_existing |
- 281838 |
+ 281785 |
| tommy_hashdyn_resize |
diff --git a/cov/tommyds/tommyhashdyn.c.func.html b/cov/tommyds/tommyhashdyn.c.func.html
index 95919145..b5f91fa9 100644
--- a/cov/tommyds/tommyhashdyn.c.func.html
+++ b/cov/tommyds/tommyhashdyn.c.func.html
@@ -61,11 +61,11 @@
| hashdyn_grow_step |
- 13238040 |
+ 13237087 |
| hashdyn_shrink_step |
- 281966 |
+ 281913 |
| tommy_hashdyn_done |
@@ -85,7 +85,7 @@
| tommy_hashdyn_insert |
- 13238040 |
+ 13237087 |
| tommy_hashdyn_memory_usage |
@@ -97,7 +97,7 @@
| tommy_hashdyn_remove_existing |
- 281838 |
+ 281785 |
| tommy_hashdyn_resize |
diff --git a/cov/tommyds/tommyhashdyn.c.gcov.html b/cov/tommyds/tommyhashdyn.c.gcov.html
index 7436ebc4..c8b02295 100644
--- a/cov/tommyds/tommyhashdyn.c.gcov.html
+++ b/cov/tommyds/tommyhashdyn.c.gcov.html
@@ -148,9 +148,9 @@
86 16078528 : tommy_hashdyn_node* j_next = j->next;
87 16078528 : tommy_count_t pos = j->key & new_bucket_mask;
88 16078528 : if (new_bucket[pos])
- 89 1911305 : tommy_list_insert_tail_not_empty(new_bucket[pos], j);
+ 89 1915427 : tommy_list_insert_tail_not_empty(new_bucket[pos], j);
90 : else
- 91 14167223 : tommy_list_insert_first(&new_bucket[pos], j);
+ 91 14163101 : tommy_list_insert_first(&new_bucket[pos], j);
92 16078528 : j = j_next;
93 : }
94 : }
@@ -179,47 +179,47 @@
117 : /**
118 : * Grow.
119 : */
- 120 13238040 : tommy_inline void hashdyn_grow_step(tommy_hashdyn* hashdyn)
+ 120 13237087 : tommy_inline void hashdyn_grow_step(tommy_hashdyn* hashdyn)
121 : {
122 : /* grow if more than 50% full */
- 123 13238040 : if (hashdyn->count >= hashdyn->bucket_max / 2)
+ 123 13237087 : if (hashdyn->count >= hashdyn->bucket_max / 2)
124 41492 : tommy_hashdyn_resize(hashdyn, hashdyn->bucket_bit + 1);
- 125 13238040 : }
+ 125 13237087 : }
126 :
127 : /**
128 : * Shrink.
129 : */
- 130 281966 : tommy_inline void hashdyn_shrink_step(tommy_hashdyn* hashdyn)
+ 130 281913 : tommy_inline void hashdyn_shrink_step(tommy_hashdyn* hashdyn)
131 : {
132 : /* shrink if less than 12.5% full */
- 133 281966 : if (hashdyn->count <= hashdyn->bucket_max / 8 && hashdyn->bucket_bit > TOMMY_HASHDYN_BIT)
+ 133 281913 : if (hashdyn->count <= hashdyn->bucket_max / 8 && hashdyn->bucket_bit > TOMMY_HASHDYN_BIT)
134 49 : tommy_hashdyn_resize(hashdyn, hashdyn->bucket_bit - 1);
- 135 281966 : }
+ 135 281913 : }
136 :
- 137 13238040 : void tommy_hashdyn_insert(tommy_hashdyn* hashdyn, tommy_hashdyn_node* node, void* data, tommy_hash_t hash)
+ 137 13237087 : void tommy_hashdyn_insert(tommy_hashdyn* hashdyn, tommy_hashdyn_node* node, void* data, tommy_hash_t hash)
138 : {
- 139 13238040 : tommy_count_t pos = hash & hashdyn->bucket_mask;
+ 139 13237087 : tommy_count_t pos = hash & hashdyn->bucket_mask;
140 :
- 141 13238040 : tommy_list_insert_tail(&hashdyn->bucket[pos], node, data);
+ 141 13237087 : tommy_list_insert_tail(&hashdyn->bucket[pos], node, data);
142 :
- 143 13238040 : node->key = hash;
+ 143 13237087 : node->key = hash;
144 :
- 145 13238040 : ++hashdyn->count;
+ 145 13237087 : ++hashdyn->count;
146 :
- 147 13238040 : hashdyn_grow_step(hashdyn);
- 148 13238040 : }
+ 147 13237087 : hashdyn_grow_step(hashdyn);
+ 148 13237087 : }
149 :
- 150 281838 : void* tommy_hashdyn_remove_existing(tommy_hashdyn* hashdyn, tommy_hashdyn_node* node)
+ 150 281785 : void* tommy_hashdyn_remove_existing(tommy_hashdyn* hashdyn, tommy_hashdyn_node* node)
151 : {
- 152 281838 : tommy_count_t pos = node->key & hashdyn->bucket_mask;
+ 152 281785 : tommy_count_t pos = node->key & hashdyn->bucket_mask;
153 :
- 154 281838 : tommy_list_remove_existing(&hashdyn->bucket[pos], node);
+ 154 281785 : tommy_list_remove_existing(&hashdyn->bucket[pos], node);
155 :
- 156 281838 : --hashdyn->count;
+ 156 281785 : --hashdyn->count;
157 :
- 158 281838 : hashdyn_shrink_step(hashdyn);
+ 158 281785 : hashdyn_shrink_step(hashdyn);
159 :
- 160 281838 : return node->data;
+ 160 281785 : return node->data;
161 : }
162 :
163 256 : void* tommy_hashdyn_remove(tommy_hashdyn* hashdyn, tommy_search_func* cmp, const void* cmp_arg, tommy_hash_t hash)
@@ -253,10 +253,10 @@
191 5812535 : for (pos = 0; pos < bucket_max; ++pos) {
192 5812288 : tommy_hashdyn_node* node = bucket[pos];
193 :
- 194 13485965 : while (node) {
- 195 1861389 : void* data = node->data;
- 196 1861389 : node = node->next;
- 197 1861389 : func(data);
+ 194 13485518 : while (node) {
+ 195 1860942 : void* data = node->data;
+ 196 1860942 : node = node->next;
+ 197 1860942 : func(data);
198 : }
199 : }
200 247 : }
diff --git a/cov/tommyds/tommyhashdyn.h.func-sort-c.html b/cov/tommyds/tommyhashdyn.h.func-sort-c.html
index 79d15ca7..c86e887e 100644
--- a/cov/tommyds/tommyhashdyn.h.func-sort-c.html
+++ b/cov/tommyds/tommyhashdyn.h.func-sort-c.html
@@ -61,11 +61,11 @@
| tommy_hashdyn_bucket |
- 3107888 |
+ 3109334 |
| tommy_hashdyn_search |
- 3107888 |
+ 3109334 |
| tommy_hashdyn_count |
diff --git a/cov/tommyds/tommyhashdyn.h.func.html b/cov/tommyds/tommyhashdyn.h.func.html
index 261f1b90..adf7080e 100644
--- a/cov/tommyds/tommyhashdyn.h.func.html
+++ b/cov/tommyds/tommyhashdyn.h.func.html
@@ -61,7 +61,7 @@
| tommy_hashdyn_bucket |
- 3107888 |
+ 3109334 |
| tommy_hashdyn_count |
@@ -69,7 +69,7 @@
| tommy_hashdyn_search |
- 3107888 |
+ 3109334 |
diff --git a/cov/tommyds/tommyhashdyn.h.gcov.html b/cov/tommyds/tommyhashdyn.h.gcov.html
index 054796f8..f1320b97 100644
--- a/cov/tommyds/tommyhashdyn.h.gcov.html
+++ b/cov/tommyds/tommyhashdyn.h.gcov.html
@@ -267,9 +267,9 @@
205 : * \param hash Hash of the element to find.
206 : * \return The head of the bucket, or 0 if empty.
207 : */
- 208 3107888 : tommy_inline tommy_hashdyn_node* tommy_hashdyn_bucket(tommy_hashdyn* hashdyn, tommy_hash_t hash)
+ 208 3109334 : tommy_inline tommy_hashdyn_node* tommy_hashdyn_bucket(tommy_hashdyn* hashdyn, tommy_hash_t hash)
209 : {
- 210 3107888 : return hashdyn->bucket[hash & hashdyn->bucket_mask];
+ 210 3109334 : return hashdyn->bucket[hash & hashdyn->bucket_mask];
211 : }
212 :
213 : /**
@@ -282,17 +282,17 @@
220 : * \param hash Hash of the element to find.
221 : * \return The first element found, or 0 if none.
222 : */
- 223 3107888 : tommy_inline void* tommy_hashdyn_search(tommy_hashdyn* hashdyn, tommy_search_func* cmp, const void* cmp_arg, tommy_hash_t hash)
+ 223 3109334 : tommy_inline void* tommy_hashdyn_search(tommy_hashdyn* hashdyn, tommy_search_func* cmp, const void* cmp_arg, tommy_hash_t hash)
224 : {
- 225 3107888 : tommy_hashdyn_node* i = tommy_hashdyn_bucket(hashdyn, hash);
+ 225 3109334 : tommy_hashdyn_node* i = tommy_hashdyn_bucket(hashdyn, hash);
226 :
- 227 6891902 : while (i) {
+ 227 6902625 : while (i) {
228 : /* we first check if the hash matches, as in the same bucket we may have multiples hash values */
- 229 1840795 : if (i->key == hash && cmp(cmp_arg, i->data) == 0)
- 230 1164669 : return i->data;
- 231 676126 : i = i->next;
+ 229 1848605 : if (i->key == hash && cmp(cmp_arg, i->data) == 0)
+ 230 1164648 : return i->data;
+ 231 683957 : i = i->next;
232 : }
- 233 1943219 : return 0;
+ 233 1944686 : return 0;
234 : }
235 :
236 : /**
diff --git a/cov/tommyds/tommylist.h.func-sort-c.html b/cov/tommyds/tommylist.h.func-sort-c.html
index 33a78f47..e3c06b4f 100644
--- a/cov/tommyds/tommylist.h.func-sort-c.html
+++ b/cov/tommyds/tommylist.h.func-sort-c.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -61,23 +61,23 @@
| tommy_list_head |
- 25316250 |
+ 25314296 |
| tommy_list_insert_first |
- 23386989 |
+ 23369043 |
| tommy_list_insert_tail |
- 18383755 |
+ 18382517 |
| tommy_list_insert_tail_not_empty |
- 11075294 |
+ 11092002 |
| tommy_list_remove_existing |
- 339939 |
+ 339841 |
| tommy_list_concat |
@@ -85,7 +85,7 @@
| tommy_list_init |
- 11836 |
+ 11842 |
| tommy_list_foreach |
@@ -101,7 +101,7 @@
| tommy_list_tail |
- 1 |
+ 2 |
diff --git a/cov/tommyds/tommylist.h.func.html b/cov/tommyds/tommylist.h.func.html
index 2d4e8c14..a181f52a 100644
--- a/cov/tommyds/tommylist.h.func.html
+++ b/cov/tommyds/tommylist.h.func.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -77,31 +77,31 @@
| tommy_list_head |
- 25316250 |
+ 25314296 |
| tommy_list_init |
- 11836 |
+ 11842 |
| tommy_list_insert_first |
- 23386989 |
+ 23369043 |
| tommy_list_insert_tail |
- 18383755 |
+ 18382517 |
| tommy_list_insert_tail_not_empty |
- 11075294 |
+ 11092002 |
| tommy_list_remove_existing |
- 339939 |
+ 339841 |
| tommy_list_tail |
- 1 |
+ 2 |
diff --git a/cov/tommyds/tommylist.h.gcov.html b/cov/tommyds/tommylist.h.gcov.html
index 8c510e44..147bca17 100644
--- a/cov/tommyds/tommylist.h.gcov.html
+++ b/cov/tommyds/tommylist.h.gcov.html
@@ -31,9 +31,9 @@
|
-
-
+
+
@@ -173,32 +173,32 @@
111 : * Initializes the list.
112 : * The list is completely inplace, so it doesn't need to be deinitialized.
113 : */
- 114 11836 : tommy_inline void tommy_list_init(tommy_list* list)
+ 114 11842 : tommy_inline void tommy_list_init(tommy_list* list)
115 : {
- 116 11836 : *list = 0;
- 117 11836 : }
+ 116 11842 : *list = 0;
+ 117 11842 : }
118 :
119 : /**
120 : * Gets the head of the list.
121 : * \return The head node. For empty lists 0 is returned.
122 : */
- 123 25316250 : tommy_inline tommy_node* tommy_list_head(tommy_list* list)
+ 123 25314296 : tommy_inline tommy_node* tommy_list_head(tommy_list* list)
124 : {
- 125 25316250 : return *list;
+ 125 25314296 : return *list;
126 : }
127 :
128 : /**
129 : * Gets the tail of the list.
130 : * \return The tail node. For empty lists 0 is returned.
131 : */
- 132 1 : tommy_inline tommy_node* tommy_list_tail(tommy_list* list)
+ 132 2 : tommy_inline tommy_node* tommy_list_tail(tommy_list* list)
133 : {
- 134 1 : tommy_node* head = tommy_list_head(list);
+ 134 2 : tommy_node* head = tommy_list_head(list);
135 :
- 136 1 : if (!head)
+ 136 2 : if (!head)
137 1 : return 0;
138 :
- 139 0 : return head->prev;
+ 139 1 : return head->prev;
140 : }
141 :
142 : /** \internal
@@ -206,16 +206,16 @@
144 : * \param list The list to initialize.
145 : * \param node The node to insert.
146 : */
- 147 23386989 : tommy_inline void tommy_list_insert_first(tommy_list* list, tommy_node* node)
+ 147 23369043 : tommy_inline void tommy_list_insert_first(tommy_list* list, tommy_node* node)
148 : {
149 : /* one element "circular" prev list */
- 150 23386989 : node->prev = node;
+ 150 23369043 : node->prev = node;
151 :
152 : /* one element "0 terminated" next list */
- 153 23386989 : node->next = 0;
+ 153 23369043 : node->next = 0;
154 :
- 155 23386989 : *list = node;
- 156 23386989 : }
+ 155 23369043 : *list = node;
+ 156 23369043 : }
157 :
158 : /** \internal
159 : * Inserts an element at the head of a not empty list.
@@ -243,16 +243,16 @@
181 : * \param head The node at the list head. It cannot be 0.
182 : * \param node The node to insert.
183 : */
- 184 11075294 : tommy_inline void tommy_list_insert_tail_not_empty(tommy_node* head, tommy_node* node)
+ 184 11092002 : tommy_inline void tommy_list_insert_tail_not_empty(tommy_node* head, tommy_node* node)
185 : {
186 : /* insert in the "circular" prev list */
- 187 11075294 : node->prev = head->prev;
- 188 11075294 : head->prev = node;
+ 187 11092002 : node->prev = head->prev;
+ 188 11092002 : head->prev = node;
189 :
190 : /* insert in the "0 terminated" next list */
- 191 11075294 : node->next = 0;
- 192 11075294 : node->prev->next = node;
- 193 11075294 : }
+ 191 11092002 : node->next = 0;
+ 192 11092002 : node->prev->next = node;
+ 193 11092002 : }
194 :
195 : /**
196 : * Inserts an element at the head of a list.
@@ -276,17 +276,17 @@
214 : * \param node The node to insert.
215 : * \param data The object containing the node. It's used to set the tommy_node::data field of the node.
216 : */
- 217 18383755 : tommy_inline void tommy_list_insert_tail(tommy_list* list, tommy_node* node, void* data)
+ 217 18382517 : tommy_inline void tommy_list_insert_tail(tommy_list* list, tommy_node* node, void* data)
218 : {
- 219 18383755 : tommy_node* head = tommy_list_head(list);
+ 219 18382517 : tommy_node* head = tommy_list_head(list);
220 :
- 221 18383755 : if (head)
- 222 9163989 : tommy_list_insert_tail_not_empty(head, node);
+ 221 18382517 : if (head)
+ 222 9176575 : tommy_list_insert_tail_not_empty(head, node);
223 : else
- 224 9219766 : tommy_list_insert_first(list, node);
+ 224 9205942 : tommy_list_insert_first(list, node);
225 :
- 226 18383755 : node->data = data;
- 227 18383755 : }
+ 226 18382517 : node->data = data;
+ 227 18382517 : }
228 :
229 : /** \internal
230 : * Removes an element from the head of a not empty list.
@@ -314,23 +314,23 @@
252 : * \param node The node to remove. The node must be in the list.
253 : * \return The tommy_node::data field of the node removed.
254 : */
- 255 339939 : tommy_inline void* tommy_list_remove_existing(tommy_list* list, tommy_node* node)
+ 255 339841 : tommy_inline void* tommy_list_remove_existing(tommy_list* list, tommy_node* node)
256 : {
- 257 339939 : tommy_node* head = tommy_list_head(list);
+ 257 339841 : tommy_node* head = tommy_list_head(list);
258 :
259 : /* remove from the "circular" prev list */
- 260 339939 : if (node->next)
- 261 116617 : node->next->prev = node->prev;
+ 260 339841 : if (node->next)
+ 261 116843 : node->next->prev = node->prev;
262 : else
- 263 223322 : head->prev = node->prev; /* the last */
+ 263 222998 : head->prev = node->prev; /* the last */
264 :
265 : /* remove from the "0 terminated" next list */
- 266 339939 : if (head == node)
- 267 237808 : *list = node->next; /* the new head, in case 0 */
+ 266 339841 : if (head == node)
+ 267 237549 : *list = node->next; /* the new head, in case 0 */
268 : else
- 269 102131 : node->prev->next = node->next;
+ 269 102292 : node->prev->next = node->next;
270 :
- 271 339939 : return node->data;
+ 271 339841 : return node->data;
272 : }
273 :
274 : /**
@@ -349,24 +349,24 @@
287 : /* if the second is empty, nothing to do */
288 63152 : second_head = tommy_list_head(second);
289 63152 : if (second_head == 0)
- 290 55812 : return;
+ 290 55791 : return;
291 :
292 : /* if the first is empty, copy the second */
- 293 7340 : first_head = tommy_list_head(first);
- 294 7340 : if (first_head == 0) {
- 295 6493 : *first = *second;
- 296 6493 : return;
+ 293 7361 : first_head = tommy_list_head(first);
+ 294 7361 : if (first_head == 0) {
+ 295 6496 : *first = *second;
+ 296 6496 : return;
297 : }
298 :
299 : /* tail of the first list */
- 300 847 : first_tail = first_head->prev;
+ 300 865 : first_tail = first_head->prev;
301 :
302 : /* set the "circular" prev list */
- 303 847 : first_head->prev = second_head->prev;
- 304 847 : second_head->prev = first_tail;
+ 303 865 : first_head->prev = second_head->prev;
+ 304 865 : second_head->prev = first_tail;
305 :
306 : /* set the "0 terminated" next list */
- 307 847 : first_tail->next = second_head;
+ 307 865 : first_tail->next = second_head;
308 : }
309 :
310 : /**
@@ -436,10 +436,10 @@
374 : {
375 7613 : tommy_node* node = tommy_list_head(list);
376 :
- 377 3679835 : while (node) {
- 378 3664609 : void* data = node->data;
- 379 3664609 : node = node->next;
- 380 3664609 : func(data);
+ 377 3679790 : while (node) {
+ 378 3664564 : void* data = node->data;
+ 379 3664564 : node = node->next;
+ 380 3664564 : func(data);
381 : }
382 7613 : }
383 :
diff --git a/cov/tommyds/tommytree.c.func-sort-c.html b/cov/tommyds/tommytree.c.func-sort-c.html
index 16ecb826..7d9ddaea 100644
--- a/cov/tommyds/tommytree.c.func-sort-c.html
+++ b/cov/tommyds/tommytree.c.func-sort-c.html
@@ -61,55 +61,55 @@
| tommy_tree_search_node |
- 137057609 |
+ 136763359 |
| tommy_tree_delta |
- 112396325 |
+ 112389685 |
| tommy_tree_balance |
- 104889300 |
+ 104883364 |
| tommy_tree_insert_node |
- 96209014 |
+ 96203762 |
| tommy_tree_foreach_arg_node |
- 26344537 |
+ 26344201 |
| tommy_tree_search_compare |
- 12332158 |
+ 12302451 |
| tommy_tree_rotate_left |
- 7495650 |
+ 7494888 |
| tommy_tree_insert |
- 7471723 |
+ 7471241 |
| tommy_tree_foreach_node |
- 7052440 |
+ 7052356 |
| tommy_tree_remove_node |
- 791759 |
+ 790764 |
| tommy_tree_move_right |
- 187066 |
+ 186865 |
| tommy_tree_rotate_right |
- 170576 |
+ 171259 |
| tommy_tree_remove |
- 79698 |
+ 79604 |
| tommy_tree_foreach_arg |
diff --git a/cov/tommyds/tommytree.c.func.html b/cov/tommyds/tommytree.c.func.html
index 4191ac06..df90989b 100644
--- a/cov/tommyds/tommytree.c.func.html
+++ b/cov/tommyds/tommytree.c.func.html
@@ -61,11 +61,11 @@
| tommy_tree_balance |
- 104889300 |
+ 104883364 |
| tommy_tree_delta |
- 112396325 |
+ 112389685 |
| tommy_tree_foreach |
@@ -77,11 +77,11 @@
| tommy_tree_foreach_arg_node |
- 26344537 |
+ 26344201 |
| tommy_tree_foreach_node |
- 7052440 |
+ 7052356 |
| tommy_tree_init |
@@ -89,11 +89,11 @@
| tommy_tree_insert |
- 7471723 |
+ 7471241 |
| tommy_tree_insert_node |
- 96209014 |
+ 96203762 |
| tommy_tree_memory_usage |
@@ -101,11 +101,11 @@
| tommy_tree_move_right |
- 187066 |
+ 186865 |
| tommy_tree_remove |
- 79698 |
+ 79604 |
| tommy_tree_remove_existing |
@@ -113,15 +113,15 @@
| tommy_tree_remove_node |
- 791759 |
+ 790764 |
| tommy_tree_rotate_left |
- 7495650 |
+ 7494888 |
| tommy_tree_rotate_right |
- 170576 |
+ 171259 |
| tommy_tree_search |
@@ -129,11 +129,11 @@
| tommy_tree_search_compare |
- 12332158 |
+ 12302451 |
| tommy_tree_search_node |
- 137057609 |
+ 136763359 |
diff --git a/cov/tommyds/tommytree.c.gcov.html b/cov/tommyds/tommytree.c.gcov.html
index a127c7cf..cfbcb983 100644
--- a/cov/tommyds/tommytree.c.gcov.html
+++ b/cov/tommyds/tommytree.c.gcov.html
@@ -101,97 +101,97 @@
39 3159 : tree->cmp = cmp;
40 3159 : }
41 :
- 42 112396325 : static int tommy_tree_delta(tommy_tree_node* root)
+ 42 112389685 : static int tommy_tree_delta(tommy_tree_node* root)
43 : {
- 44 112396325 : int left_height = root->prev ? root->prev->key : 0;
- 45 112396325 : int right_height = root->next ? root->next->key : 0;
+ 44 112389685 : int left_height = root->prev ? root->prev->key : 0;
+ 45 112389685 : int right_height = root->next ? root->next->key : 0;
46 :
- 47 112396325 : return left_height - right_height;
+ 47 112389685 : return left_height - right_height;
48 : }
49 :
50 : /* AVL tree operations */
51 : static tommy_tree_node* tommy_tree_balance(tommy_tree_node*);
52 :
- 53 7495650 : static tommy_tree_node* tommy_tree_rotate_left(tommy_tree_node* root)
+ 53 7494888 : static tommy_tree_node* tommy_tree_rotate_left(tommy_tree_node* root)
54 : {
- 55 7495650 : tommy_tree_node* next = root->next;
+ 55 7494888 : tommy_tree_node* next = root->next;
56 :
- 57 7495650 : root->next = next->prev;
+ 57 7494888 : root->next = next->prev;
58 :
- 59 7495650 : next->prev = tommy_tree_balance(root);
+ 59 7494888 : next->prev = tommy_tree_balance(root);
60 :
- 61 7495650 : return tommy_tree_balance(next);
+ 61 7494888 : return tommy_tree_balance(next);
62 : }
63 :
- 64 170576 : static tommy_tree_node* tommy_tree_rotate_right(tommy_tree_node* root)
+ 64 171259 : static tommy_tree_node* tommy_tree_rotate_right(tommy_tree_node* root)
65 : {
- 66 170576 : tommy_tree_node* prev = root->prev;
+ 66 171259 : tommy_tree_node* prev = root->prev;
67 :
- 68 170576 : root->prev = prev->next;
+ 68 171259 : root->prev = prev->next;
69 :
- 70 170576 : prev->next = tommy_tree_balance(root);
+ 70 171259 : prev->next = tommy_tree_balance(root);
71 :
- 72 170576 : return tommy_tree_balance(prev);
+ 72 171259 : return tommy_tree_balance(prev);
73 : }
74 :
- 75 187066 : static tommy_tree_node* tommy_tree_move_right(tommy_tree_node* root, tommy_tree_node* node)
+ 75 186865 : static tommy_tree_node* tommy_tree_move_right(tommy_tree_node* root, tommy_tree_node* node)
76 : {
- 77 187066 : if (!root)
- 78 79570 : return node;
+ 77 186865 : if (!root)
+ 78 79476 : return node;
79 :
- 80 107496 : root->next = tommy_tree_move_right(root->next, node);
+ 80 107389 : root->next = tommy_tree_move_right(root->next, node);
81 :
- 82 107496 : return tommy_tree_balance(root);
+ 82 107389 : return tommy_tree_balance(root);
83 : }
84 :
- 85 104889300 : static tommy_tree_node* tommy_tree_balance(tommy_tree_node* root)
+ 85 104883364 : static tommy_tree_node* tommy_tree_balance(tommy_tree_node* root)
86 : {
- 87 104889300 : int delta = tommy_tree_delta(root);
+ 87 104883364 : int delta = tommy_tree_delta(root);
88 :
- 89 104889300 : if (delta < -1) {
- 90 7379314 : if (tommy_tree_delta(root->next) > 0)
- 91 42865 : root->next = tommy_tree_rotate_right(root->next);
- 92 7379314 : return tommy_tree_rotate_left(root);
+ 89 104883364 : if (delta < -1) {
+ 90 7377984 : if (tommy_tree_delta(root->next) > 0)
+ 91 42922 : root->next = tommy_tree_rotate_right(root->next);
+ 92 7377984 : return tommy_tree_rotate_left(root);
93 : }
94 :
- 95 97509986 : if (delta > 1) {
- 96 127711 : if (tommy_tree_delta(root->prev) < 0)
- 97 116336 : root->prev = tommy_tree_rotate_left(root->prev);
- 98 127711 : return tommy_tree_rotate_right(root);
+ 95 97505380 : if (delta > 1) {
+ 96 128337 : if (tommy_tree_delta(root->prev) < 0)
+ 97 116904 : root->prev = tommy_tree_rotate_left(root->prev);
+ 98 128337 : return tommy_tree_rotate_right(root);
99 : }
100 :
101 : /* recompute key */
- 102 97382275 : root->key = 0;
+ 102 97377043 : root->key = 0;
103 :
- 104 97382275 : if (root->prev && root->prev->key > root->key)
- 105 78777420 : root->key = root->prev->key;
+ 104 97377043 : if (root->prev && root->prev->key > root->key)
+ 105 78773858 : root->key = root->prev->key;
106 :
- 107 97382275 : if (root->next && root->next->key > root->key)
- 108 44917237 : root->key = root->next->key;
+ 107 97377043 : if (root->next && root->next->key > root->key)
+ 108 44909116 : root->key = root->next->key;
109 :
110 : /* count itself */
- 111 97382275 : root->key += 1;
+ 111 97377043 : root->key += 1;
112 :
- 113 97382275 : return root;
+ 113 97377043 : return root;
114 : }
115 :
- 116 96209014 : static tommy_tree_node* tommy_tree_insert_node(tommy_compare_func* cmp, tommy_tree_node* root, tommy_tree_node** let)
+ 116 96203762 : static tommy_tree_node* tommy_tree_insert_node(tommy_compare_func* cmp, tommy_tree_node* root, tommy_tree_node** let)
117 : {
118 : int c;
119 :
- 120 96209014 : if (!root)
- 121 7471722 : return *let;
+ 120 96203762 : if (!root)
+ 121 7471240 : return *let;
122 :
- 123 88737292 : c = cmp((*let)->data, root->data);
+ 123 88732522 : c = cmp((*let)->data, root->data);
124 :
- 125 88737292 : if (c < 0) {
- 126 1527618 : root->prev = tommy_tree_insert_node(cmp, root->prev, let);
- 127 1527618 : return tommy_tree_balance(root);
+ 125 88732522 : if (c < 0) {
+ 126 1537706 : root->prev = tommy_tree_insert_node(cmp, root->prev, let);
+ 127 1537706 : return tommy_tree_balance(root);
128 : }
129 :
- 130 87209674 : if (c > 0) {
- 131 87209673 : root->next = tommy_tree_insert_node(cmp, root->next, let);
- 132 87209673 : return tommy_tree_balance(root);
+ 130 87194816 : if (c > 0) {
+ 131 87194815 : root->next = tommy_tree_insert_node(cmp, root->next, let);
+ 132 87194815 : return tommy_tree_balance(root);
133 : }
134 :
135 : /* already present, set the return pointer */
@@ -200,78 +200,78 @@
138 1 : return root;
139 : }
140 :
- 141 7471723 : void* tommy_tree_insert(tommy_tree* tree, tommy_tree_node* node, void* data)
+ 141 7471241 : void* tommy_tree_insert(tommy_tree* tree, tommy_tree_node* node, void* data)
142 : {
- 143 7471723 : tommy_tree_node* insert = node;
+ 143 7471241 : tommy_tree_node* insert = node;
144 :
- 145 7471723 : insert->data = data;
- 146 7471723 : insert->prev = 0;
- 147 7471723 : insert->next = 0;
- 148 7471723 : insert->key = 0;
+ 145 7471241 : insert->data = data;
+ 146 7471241 : insert->prev = 0;
+ 147 7471241 : insert->next = 0;
+ 148 7471241 : insert->key = 0;
149 :
- 150 7471723 : tree->root = tommy_tree_insert_node(tree->cmp, tree->root, &insert);
+ 150 7471241 : tree->root = tommy_tree_insert_node(tree->cmp, tree->root, &insert);
151 :
- 152 7471723 : if (insert == node)
- 153 7471722 : ++tree->count;
+ 152 7471241 : if (insert == node)
+ 153 7471240 : ++tree->count;
154 :
- 155 7471723 : return insert->data;
+ 155 7471241 : return insert->data;
156 : }
157 :
- 158 791759 : static tommy_tree_node* tommy_tree_remove_node(tommy_compare_func* cmp, tommy_tree_node* root, void* data, tommy_tree_node** let)
+ 158 790764 : static tommy_tree_node* tommy_tree_remove_node(tommy_compare_func* cmp, tommy_tree_node* root, void* data, tommy_tree_node** let)
159 : {
160 : int c;
161 :
- 162 791759 : if (!root)
+ 162 790764 : if (!root)
163 128 : return 0;
164 :
- 165 791631 : c = cmp(data, root->data);
+ 165 790636 : c = cmp(data, root->data);
166 :
- 167 791631 : if (c < 0) {
- 168 304358 : root->prev = tommy_tree_remove_node(cmp, root->prev, data, let);
- 169 304358 : return tommy_tree_balance(root);
+ 167 790636 : if (c < 0) {
+ 168 303798 : root->prev = tommy_tree_remove_node(cmp, root->prev, data, let);
+ 169 303798 : return tommy_tree_balance(root);
170 : }
171 :
- 172 487273 : if (c > 0) {
- 173 407703 : root->next = tommy_tree_remove_node(cmp, root->next, data, let);
- 174 407703 : return tommy_tree_balance(root);
+ 172 486838 : if (c > 0) {
+ 173 407362 : root->next = tommy_tree_remove_node(cmp, root->next, data, let);
+ 174 407362 : return tommy_tree_balance(root);
175 : }
176 :
177 : /* found */
- 178 79570 : *let = root;
+ 178 79476 : *let = root;
179 :
- 180 79570 : return tommy_tree_move_right(root->prev, root->next);
+ 180 79476 : return tommy_tree_move_right(root->prev, root->next);
181 : }
182 :
- 183 79698 : void* tommy_tree_remove(tommy_tree* tree, void* data)
+ 183 79604 : void* tommy_tree_remove(tommy_tree* tree, void* data)
184 : {
- 185 79698 : tommy_tree_node* node = 0;
+ 185 79604 : tommy_tree_node* node = 0;
186 :
- 187 79698 : tree->root = tommy_tree_remove_node(tree->cmp, tree->root, data, &node);
+ 187 79604 : tree->root = tommy_tree_remove_node(tree->cmp, tree->root, data, &node);
188 :
- 189 79698 : if (!node)
+ 189 79604 : if (!node)
190 128 : return 0;
191 :
- 192 79570 : --tree->count;
+ 192 79476 : --tree->count;
193 :
- 194 79570 : return node->data;
+ 194 79476 : return node->data;
195 : }
196 :
- 197 137057609 : static tommy_tree_node* tommy_tree_search_node(tommy_compare_func* cmp, tommy_tree_node* root, void* data)
+ 197 136763359 : static tommy_tree_node* tommy_tree_search_node(tommy_compare_func* cmp, tommy_tree_node* root, void* data)
198 : {
199 : int c;
200 :
- 201 137057609 : if (!root)
- 202 1588629 : return 0;
+ 201 136763359 : if (!root)
+ 202 1588540 : return 0;
203 :
- 204 135468980 : c = cmp(data, root->data);
+ 204 135174819 : c = cmp(data, root->data);
205 :
- 206 135472865 : if (c < 0)
- 207 49253417 : return tommy_tree_search_node(cmp, root->prev, data);
+ 206 135179988 : if (c < 0)
+ 207 49127582 : return tommy_tree_search_node(cmp, root->prev, data);
208 :
- 209 86219448 : if (c > 0)
- 210 75476068 : return tommy_tree_search_node(cmp, root->next, data);
+ 209 86052406 : if (c > 0)
+ 210 75338711 : return tommy_tree_search_node(cmp, root->next, data);
211 :
- 212 10743380 : return root;
+ 212 10713695 : return root;
213 : }
214 :
215 2 : void* tommy_tree_search(tommy_tree* tree, void* data)
@@ -284,14 +284,14 @@
222 1 : return node->data;
223 : }
224 :
- 225 12332158 : void* tommy_tree_search_compare(tommy_tree* tree, tommy_compare_func* cmp, void* cmp_arg)
+ 225 12302451 : void* tommy_tree_search_compare(tommy_tree* tree, tommy_compare_func* cmp, void* cmp_arg)
226 : {
- 227 12332158 : tommy_tree_node* node = tommy_tree_search_node(cmp, tree->root, cmp_arg);
+ 227 12302451 : tommy_tree_node* node = tommy_tree_search_node(cmp, tree->root, cmp_arg);
228 :
- 229 12331935 : if (!node)
- 230 1588633 : return 0;
+ 229 12302205 : if (!node)
+ 230 1588572 : return 0;
231 :
- 232 10743302 : return node->data;
+ 232 10713633 : return node->data;
233 : }
234 :
235 128 : void* tommy_tree_remove_existing(tommy_tree* tree, tommy_tree_node* node)
@@ -303,21 +303,21 @@
241 128 : return data;
242 : }
243 :
- 244 7052440 : static void tommy_tree_foreach_node(tommy_tree_node* root, tommy_foreach_func* func)
+ 244 7052356 : static void tommy_tree_foreach_node(tommy_tree_node* root, tommy_foreach_func* func)
245 : {
246 : tommy_tree_node* next;
247 :
- 248 7052440 : if (!root)
- 249 10579387 : return;
+ 248 7052356 : if (!root)
+ 249 10579261 : return;
250 :
- 251 3525493 : tommy_tree_foreach_node(root->prev, func);
+ 251 3525451 : tommy_tree_foreach_node(root->prev, func);
252 :
253 : /* make a copy in case func is free() */
- 254 3525493 : next = root->next;
+ 254 3525451 : next = root->next;
255 :
- 256 3525493 : func(root->data);
+ 256 3525451 : func(root->data);
257 :
- 258 3525493 : tommy_tree_foreach_node(next, func);
+ 258 3525451 : tommy_tree_foreach_node(next, func);
259 : }
260 :
261 1454 : void tommy_tree_foreach(tommy_tree* tree, tommy_foreach_func* func)
@@ -325,21 +325,21 @@
263 1454 : tommy_tree_foreach_node(tree->root, func);
264 1454 : }
265 :
- 266 26344537 : static void tommy_tree_foreach_arg_node(tommy_tree_node* root, tommy_foreach_arg_func* func, void* arg)
+ 266 26344201 : static void tommy_tree_foreach_arg_node(tommy_tree_node* root, tommy_foreach_arg_func* func, void* arg)
267 : {
268 : tommy_tree_node* next;
269 :
- 270 26344537 : if (!root)
- 271 39519776 : return;
+ 270 26344201 : if (!root)
+ 271 39519272 : return;
272 :
- 273 13169298 : tommy_tree_foreach_arg_node(root->prev, func, arg);
+ 273 13169130 : tommy_tree_foreach_arg_node(root->prev, func, arg);
274 :
275 : /* make a copy in case func is free() */
- 276 13169298 : next = root->next;
+ 276 13169130 : next = root->next;
277 :
- 278 13169298 : func(arg, root->data);
+ 278 13169130 : func(arg, root->data);
279 :
- 280 13169298 : tommy_tree_foreach_arg_node(next, func, arg);
+ 280 13169130 : tommy_tree_foreach_arg_node(next, func, arg);
281 : }
282 :
283 5941 : void tommy_tree_foreach_arg(tommy_tree* tree, tommy_foreach_arg_func* func, void* arg)
diff --git a/cov/tommyds/tommytypes.h.func-sort-c.html b/cov/tommyds/tommytypes.h.func-sort-c.html
index 2422252b..0eadd42d 100644
--- a/cov/tommyds/tommytypes.h.func-sort-c.html
+++ b/cov/tommyds/tommytypes.h.func-sort-c.html
@@ -61,7 +61,7 @@
| tommy_ilog2_u32 |
- 10264168 |
+ 10268450 |
| tommy_ctz_u32 |
diff --git a/cov/tommyds/tommytypes.h.func.html b/cov/tommyds/tommytypes.h.func.html
index 043b3ab5..94c5e7af 100644
--- a/cov/tommyds/tommytypes.h.func.html
+++ b/cov/tommyds/tommytypes.h.func.html
@@ -69,7 +69,7 @@
| tommy_ilog2_u32 |
- 10264168 |
+ 10268450 |
diff --git a/cov/tommyds/tommytypes.h.gcov.html b/cov/tommyds/tommytypes.h.gcov.html
index f668ab60..7eedf268 100644
--- a/cov/tommyds/tommytypes.h.gcov.html
+++ b/cov/tommyds/tommytypes.h.gcov.html
@@ -390,7 +390,7 @@
328 : * \param value Value to scan. 0 is not allowed.
329 : * \return The index of the most significant bit set.
330 : */
- 331 10264168 : tommy_inline tommy_uint_t tommy_ilog2_u32(tommy_uint32_t value)
+ 331 10268450 : tommy_inline tommy_uint_t tommy_ilog2_u32(tommy_uint32_t value)
332 : {
333 : #if defined(_MSC_VER)
334 : unsigned long count;
@@ -406,7 +406,7 @@
344 : * So we write "__builtin_clz(x) ^ 31" instead of "31 - __builtin_clz(x)",
345 : * to allow the double xor to be optimized out.
346 : */
- 347 10264168 : return __builtin_clz(value) ^ 31;
+ 347 10268450 : return __builtin_clz(value) ^ 31;
348 : #else
349 : /* Find the log base 2 of an N-bit integer in O(lg(N)) operations with multiply and lookup */
350 : /* from http://graphics.stanford.edu/~seander/bithacks.html */