Module Name: src
Committed By: riz
Date: Fri Nov 6 20:27:55 UTC 2015
Modified Files:
src/sbin/dump [netbsd-7]: main.c tape.c
Log Message:
Pull up following revision(s) (requested by bouyer in ticket #991):
sbin/dump/tape.c: revision 1.54
sbin/dump/main.c: revision 1.73
Consistently use iswap64() and 64bit intermediate variable, as well as
64bit formats for c_tapea. Fixes tape useage report for large filesystems.
To generate a diff of this commit:
cvs rdiff -u -r1.71.4.1 -r1.71.4.2 src/sbin/dump/main.c
cvs rdiff -u -r1.53 -r1.53.6.1 src/sbin/dump/tape.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/dump/main.c
diff -u src/sbin/dump/main.c:1.71.4.1 src/sbin/dump/main.c:1.71.4.2
--- src/sbin/dump/main.c:1.71.4.1 Fri Nov 6 20:26:43 2015
+++ src/sbin/dump/main.c Fri Nov 6 20:27:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.71.4.1 2015/11/06 20:26:43 riz Exp $ */
+/* $NetBSD: main.c,v 1.71.4.2 2015/11/06 20:27:55 riz Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: main.c,v 1.71.4.1 2015/11/06 20:26:43 riz Exp $");
+__RCSID("$NetBSD: main.c,v 1.71.4.2 2015/11/06 20:27:55 riz Exp $");
#endif
#endif /* not lint */
@@ -641,10 +641,10 @@ main(int argc, char *argv[])
for (i = 0; i < ntrec; i++)
writeheader(maxino - 1);
if (pipeout)
- msg("%d tape blocks\n",iswap32(spcl.c_tapea));
+ msg("%lld tape blocks\n",(long long)iswap64(spcl.c_tapea));
else
- msg("%d tape blocks on %d volume%s\n",
- iswap32(spcl.c_tapea), iswap32(spcl.c_volume),
+ msg("%lld tape blocks on %d volume%s\n",
+ (long long)iswap64(spcl.c_tapea), iswap32(spcl.c_volume),
(iswap32(spcl.c_volume) == 1) ? "" : "s");
tnow = do_stats();
date = iswap32(spcl.c_date);
Index: src/sbin/dump/tape.c
diff -u src/sbin/dump/tape.c:1.53 src/sbin/dump/tape.c:1.53.6.1
--- src/sbin/dump/tape.c:1.53 Sat Jun 15 01:27:19 2013
+++ src/sbin/dump/tape.c Fri Nov 6 20:27:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tape.c,v 1.53 2013/06/15 01:27:19 christos Exp $ */
+/* $NetBSD: tape.c,v 1.53.6.1 2015/11/06 20:27:55 riz Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)tape.c 8.4 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: tape.c,v 1.53 2013/06/15 01:27:19 christos Exp $");
+__RCSID("$NetBSD: tape.c,v 1.53.6.1 2015/11/06 20:27:55 riz Exp $");
#endif
#endif /* not lint */
@@ -333,7 +333,7 @@ flushtape(void)
if (spcl.c_addr[i] != 0)
blks++;
}
- slp->count = lastspclrec + blks + 1 - iswap32(spcl.c_tapea);
+ slp->count = lastspclrec + blks + 1 - iswap64(spcl.c_tapea);
slp->tapea = iswap64(spcl.c_tapea);
slp->firstrec = lastfirstrec + ntrec;
slp->inode = curino;
@@ -457,7 +457,8 @@ rollforward(void)
{
struct req *p, *q, *prev;
struct slave *tslp;
- int i, size, savedtapea, got;
+ int i, size, got;
+ int64_t savedtapea;
union u_spcl *ntb, *otb;
tslp = &slaves[SLAVES];
ntb = (union u_spcl *)tslp->tblock[1];
@@ -498,10 +499,10 @@ rollforward(void)
q->count = 1;
trecno = 0;
nextblock = tslp->tblock;
- savedtapea = iswap32(spcl.c_tapea);
- spcl.c_tapea = iswap32(slp->tapea);
+ savedtapea = iswap64(spcl.c_tapea);
+ spcl.c_tapea = iswap64(slp->tapea);
startnewtape(0);
- spcl.c_tapea = iswap32(savedtapea);
+ spcl.c_tapea = iswap64(savedtapea);
lastspclrec = savedtapea - 1;
}
size = (char *)ntb - (char *)q;
@@ -579,7 +580,7 @@ startnewtape(int top)
interrupt_save = signal(SIGINT, SIG_IGN);
parentpid = getpid();
- tapea_volume = iswap32(spcl.c_tapea);
+ tapea_volume = iswap64(spcl.c_tapea);
(void)time(&tstart_volume);
restore_check_point: