summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2011-05-14 19:43:45 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2011-05-14 19:43:45 +0000
commit7f47315422f6846ea700fc7826f47b10dbfe086d (patch)
tree0f35ecdef88a473b478dee8544ef1e06c76cfc26
parentd93fcbb20d2a452d78b831210c1d8e3ef381602e (diff)
download2011-ddhardrescue-7f47315422f6846ea700fc7826f47b10dbfe086d.tar.gz
2011-ddhardrescue-7f47315422f6846ea700fc7826f47b10dbfe086d.tar.bz2
2011-ddhardrescue-7f47315422f6846ea700fc7826f47b10dbfe086d.zip
sliceSplitEvt -> sliceEvtSplit ; Suppressino compteur de debug, modification initialisation algo (pour qu'il devienne capable de démarrer une liste de slices non vide, pour la reprise d'une restauration)
git-svn-id: file:///var/svn/2011-ddhardrescue/trunk@17 d3078510-dda0-49f1-841c-895ef4b7ec81
-rw-r--r--src/recover.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/recover.c b/src/recover.c
index 9b1719b..8d47853 100644
--- a/src/recover.c
+++ b/src/recover.c
@@ -2,15 +2,13 @@
#include <stdio.h>
#include "recover.h"
-
-extern unsigned long c;
-
void recover(slices_evt_t *slicesEvt, char *src, char *dst, char *ddOpts) {
slice_t *sliceToRead;
address_t firstError=0, median, foundMax=0;
int res;
- sliceToRead=slicesEvt->data->first;
+ //sliceToRead=slicesEvt->data->first;
+ sliceToRead=slicesFindLargest(slicesEvt->data, S_UNKNOWN);
while (!end) {
// try to recover sliceToRead and split it if read error
switch ( tryRecoverUntilError(sliceToRead, &firstError, src, dst, ddOpts) ) {
@@ -20,10 +18,10 @@ void recover(slices_evt_t *slicesEvt, char *src, char *dst, char *ddOpts) {
break;
case EIO:
// slice recovery has encountered a readerror
- res=sliceSplitEvt(slicesEvt, sliceToRead, firstError, S_RECOVERED, S_UNREADABLE, S_UNKNOWN);
+ res=sliceEvtSplit(slicesEvt, sliceToRead, firstError, S_RECOVERED, S_UNREADABLE, S_UNKNOWN);
if (res<1) {
//TODO
- printf("sliceSplit return %d\n", res);
+ printf("sliceEvtSplit return %d\n", res);
exit(5);
}
break;
@@ -43,7 +41,7 @@ void recover(slices_evt_t *slicesEvt, char *src, char *dst, char *ddOpts) {
median=(sliceToRead->begin+sliceToRead->end)/2;
- res=sliceSplitEvt(slicesEvt, sliceToRead, median, S_UNKNOWN, S_UNKNOWN, S_UNKNOWN);
+ res=sliceEvtSplit(slicesEvt, sliceToRead, median, S_UNKNOWN, S_UNKNOWN, S_UNKNOWN);
switch (res) {
case 1:
// No split, try analyse this zone
@@ -80,8 +78,6 @@ int tryRecoverUntilError(slice_t *sliceToRead, address_t *firstError, char *src,
int res;
address_t seek, count;
- c++; //XXX This is a debug counter
-
seek=sliceToRead->begin;
count=sliceToRead->end - seek + 1;
// res=snprintf(ddinvocation, 255, "dd %s %s %s seek=%lld skip=%lld count=%lld", src, dst, ddOpts, seek, seek, count);