summaryrefslogtreecommitdiffstats
path: root/sbin/restore
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-07-28 18:50:01 +0000
committerimp <imp@FreeBSD.org>1998-07-28 18:50:01 +0000
commitd7d6a198df823a359b39db442d8f3c1aa006fa3f (patch)
tree55c9d679aabbe23babc45843007d3125424c0087 /sbin/restore
parent0c1764387cef9f99af21a47fa453917fa3072468 (diff)
downloadFreeBSD-src-d7d6a198df823a359b39db442d8f3c1aa006fa3f.zip
FreeBSD-src-d7d6a198df823a359b39db442d8f3c1aa006fa3f.tar.gz
Commit patch from Tor Egge to fix the "large filesystem restore" problem.
This appears to work for me in the old case, but I don't have large enough filesystems to test the fix case. Reported working by: karl@mcs.net
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/tape.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 9cf1d3f..03ddd15 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -41,7 +41,7 @@
static char sccsid[] = "@(#)tape.c 8.9 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: tape.c,v 1.13 1998/07/28 06:20:15 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -107,6 +107,8 @@ static void xtrmap __P((char *, long));
static void xtrmapskip __P((char *, long));
static void xtrskip __P((char *, long));
+static int readmapflag;
+
/*
* Set up an input source
*/
@@ -681,7 +683,7 @@ getfile(fill, skip)
gettingfile++;
loop:
for (i = 0; i < spcl.c_count; i++) {
- if (spcl.c_addr[i]) {
+ if (readmapflag || spcl.c_addr[i]) {
readtape(&buf[curblk++][0]);
if (curblk == fssize / TP_BSIZE) {
(*fill)((char *)buf, (long)(size > TP_BSIZE ?
@@ -700,7 +702,7 @@ loop:
}
if ((size -= TP_BSIZE) <= 0) {
for (i++; i < spcl.c_count; i++)
- if (spcl.c_addr[i])
+ if (readmapflag || spcl.c_addr[i])
readtape(junk);
break;
}
@@ -1098,6 +1100,7 @@ good:
qcvt.val[0] = i;
buf->c_dinode.di_size = qcvt.qval;
}
+ readmapflag = 0;
switch (buf->c_type) {
@@ -1108,8 +1111,11 @@ good:
*/
buf->c_inumber = 0;
buf->c_dinode.di_size = buf->c_count * TP_BSIZE;
- for (i = 0; i < buf->c_count; i++)
- buf->c_addr[i]++;
+ if (buf->c_count > TP_NINDIR)
+ readmapflag = 1;
+ else
+ for (i = 0; i < buf->c_count; i++)
+ buf->c_addr[i]++;
break;
case TS_TAPE:
@@ -1190,7 +1196,7 @@ newcalc:
blks = 0;
if (header->c_type != TS_END)
for (i = 0; i < header->c_count; i++)
- if (header->c_addr[i] != 0)
+ if (readmapflag || header->c_addr[i] != 0)
blks++;
predict = blks;
blksread = 0;
OpenPOWER on IntegriCloud