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
This commit is contained in:
imp 1998-07-28 18:50:01 +00:00
parent 0c1764387c
commit d7d6a198df

View File

@ -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 @@ getfile(fill, skip)
}
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 @@ gethead(buf)
qcvt.val[0] = i;
buf->c_dinode.di_size = qcvt.qval;
}
readmapflag = 0;
switch (buf->c_type) {
@ -1108,8 +1111,11 @@ gethead(buf)
*/
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 @@ accthdr(header)
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;