X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Frestore.c;h=1b04fea6b9b8b43e81275461eaab2c90e680c222;hb=633963a251fb12a63e43a7f6f2391dc9507972a7;hp=8f0cfd5cab105dffa9600e33e780036472511e3a;hpb=11856e771fadee7ddb9b5a613c91f562bf363da7;p=dump.git diff --git a/restore/restore.c b/restore/restore.c index 8f0cfd5..1b04fea 100644 --- a/restore/restore.c +++ b/restore/restore.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: restore.c,v 1.22 2002/01/16 09:32:14 stelian Exp $"; + "$Id: restore.c,v 1.26 2002/01/25 15:08:59 stelian Exp $"; #endif /* not lint */ #include @@ -83,7 +83,7 @@ listfile(char *name, dump_ino_t ino, int type) long descend = hflag ? GOOD : FAIL; #ifdef USE_QFA long tnum; - long tpos; + long long tpos; #endif if (TSTINO(ino, dumpmap) == 0) @@ -92,7 +92,7 @@ listfile(char *name, dump_ino_t ino, int type) #ifdef USE_QFA if (tapeposflag) { /* add QFA positions to output */ (void)Inode2Tapepos(ino, &tnum, &tpos, 1); - fprintf(stdout, "%10lu\t%ld\t%ld\t%s\n", (unsigned long)ino, + fprintf(stdout, "%10lu\t%ld\t%lld\t%s\n", (unsigned long)ino, tnum, tpos, name); } else @@ -108,7 +108,7 @@ listfile(char *name, dump_ino_t ino, int type) long addfile(char *name, dump_ino_t ino, int type) { - register struct entry *ep, *np; + struct entry *ep, *np; long descend = hflag ? GOOD : FAIL; char buf[100]; @@ -192,8 +192,8 @@ static struct entry *removelist; void removeoldleaves(void) { - register struct entry *ep, *nextep; - register dump_ino_t i, mydirino; + struct entry *ep, *nextep; + dump_ino_t i, mydirino; Vprintf(stdout, "Mark entries to be removed.\n"); if ((ep = lookupino(WINO))) { @@ -249,7 +249,7 @@ removeoldleaves(void) long nodeupdates(char *name, dump_ino_t ino, int type) { - register struct entry *ep, *np, *ip; + struct entry *ep, *np, *ip; long descend = GOOD; int lookuptype = 0; int key = 0; @@ -558,8 +558,8 @@ keyval(int key) void findunreflinks(void) { - register struct entry *ep, *np; - register dump_ino_t i; + struct entry *ep, *np; + dump_ino_t i; Vprintf(stdout, "Find unreferenced names.\n"); for (i = ROOTINO; i < maxino; i++) { @@ -606,7 +606,7 @@ findunreflinks(void) void removeoldnodes(void) { - register struct entry *ep, **prev; + struct entry *ep, **prev; long change; Vprintf(stdout, "Remove old nodes (directories).\n"); @@ -649,7 +649,7 @@ compare_entry(struct entry *ep, int do_compare) void compareleaves(void) { - register struct entry *ep; + struct entry *ep; dump_ino_t first; long curvol; @@ -736,7 +736,7 @@ compareleaves(void) void createleaves(char *symtabfile) { - register struct entry *ep; + struct entry *ep; dump_ino_t first; long curvol; @@ -835,17 +835,26 @@ createleaves(char *symtabfile) void createfiles(void) { - register dump_ino_t first, next, last; - register struct entry *ep; + dump_ino_t first, next, last; + struct entry *ep; long curvol; #ifdef USE_QFA - long tnum, tpos, curtpos, tmpcnt; + long tnum, tmpcnt; + long long tpos, curtpos; time_t tistart, tiend, titaken; #endif Vprintf(stdout, "Extract requested files\n"); curfile.action = SKIP; - getvol((long)1); +#ifdef USE_QFA + if (tapeposflag) + curfile.ino = 0; + else +#endif + if (volinfo[1] == ROOTINO) + curfile.ino = 0; + else + getvol((long)1); skipmaps(); skipdirs(); first = lowerbnd(ROOTINO); @@ -870,7 +879,7 @@ createfiles(void) if (!pipein) getvol((long)0); if (curfile.ino == maxino) { - next = lowerbnd(next); + next = lowerbnd(first); while (next < curfile.ino) { ep = lookupino(next); if (ep == NULL) @@ -908,7 +917,7 @@ createfiles(void) * might be too slow */ if (tpos > curtpos) { #ifdef DEBUG_QFA - msg("positioning tape %ld from %ld to %ld for inode %10lu ...\n", volno, curtpos, tpos, (unsigned long)next); + msg("positioning tape %ld from %lld to %lld for inode %10lu ...\n", volno, curtpos, tpos, (unsigned long)next); #endif if (GotoTapePos(tpos) == 0) { #ifdef DEBUG_QFA @@ -925,7 +934,18 @@ createfiles(void) } } } + else #endif /* USA_QFA */ + if (volinfo[1] == ROOTINO) { + int i, goodvol = 1; + + for (i = 1; i < TP_NINOS && volinfo[i] != 0; ++i) + if (volinfo[i] < next) + goodvol = i; + + if (goodvol != volno) + RequestVol(goodvol); + } do { curvol = volno; @@ -996,8 +1016,8 @@ createfiles(void) void createlinks(void) { - register struct entry *np, *ep; - register dump_ino_t i; + struct entry *np, *ep; + dump_ino_t i; char name[BUFSIZ]; if ((ep = lookupino(WINO))) { @@ -1040,8 +1060,8 @@ createlinks(void) void checkrestore(void) { - register struct entry *ep; - register dump_ino_t i; + struct entry *ep; + dump_ino_t i; Vprintf(stdout, "Check the symbol table.\n"); for (i = WINO; i < maxino; i++) {