Deleted Added
full compact
main.c (11770) main.c (12377)
1/*-
2 * Copyright (c) 1980, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 63 unchanged lines hidden (view full) ---

72
73#ifndef SBOFF
74#define SBOFF (SBLOCK * DEV_BSIZE)
75#endif
76
77int notify = 0; /* notify operator flag */
78int blockswritten = 0; /* number of blocks written on current tape */
79int tapeno = 0; /* current tape number */
1/*-
2 * Copyright (c) 1980, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 63 unchanged lines hidden (view full) ---

72
73#ifndef SBOFF
74#define SBOFF (SBLOCK * DEV_BSIZE)
75#endif
76
77int notify = 0; /* notify operator flag */
78int blockswritten = 0; /* number of blocks written on current tape */
79int tapeno = 0; /* current tape number */
80int density = 0; /* density in bytes/0.1" */
80int density = 0; /* density in bytes/0.1" " <- this is for hilit19 */
81int ntrec = NTREC; /* # tape blocks in each tape record */
82int cartridge = 0; /* Assume non-cartridge tape */
83long dev_bsize = 1; /* recalculated below */
84long blocksperfile; /* output blocks per file */
85char *host = NULL; /* remote host (if any) */
86
87static long numarg __P((int, char *, long, long, int *, char ***));
88static __dead void missingarg __P((int, char *));

--- 73 unchanged lines hidden (view full) ---

162 lastlevel = '?';
163 argc--;
164 argv++;
165 break;
166
167 case 'b': /* blocks per tape write */
168 ntrec = numarg('b', "number of blocks per write",
169 1L, 1000L, &argc, &argv);
81int ntrec = NTREC; /* # tape blocks in each tape record */
82int cartridge = 0; /* Assume non-cartridge tape */
83long dev_bsize = 1; /* recalculated below */
84long blocksperfile; /* output blocks per file */
85char *host = NULL; /* remote host (if any) */
86
87static long numarg __P((int, char *, long, long, int *, char ***));
88static __dead void missingarg __P((int, char *));

--- 73 unchanged lines hidden (view full) ---

162 lastlevel = '?';
163 argc--;
164 argv++;
165 break;
166
167 case 'b': /* blocks per tape write */
168 ntrec = numarg('b', "number of blocks per write",
169 1L, 1000L, &argc, &argv);
170 /* XXX restore is unable to restore dumps that
171 were created with a blocksize larger than 32K.
172 Possibly a bug in the scsi tape driver. */
173 if ( ntrec > 32 ) {
174 msg("please choose a blocksize <= 32\n");
175 exit(X_ABORT);
176 }
170 break;
171
172 case 'B': /* blocks per output file */
173 blocksperfile = numarg('B', "number of blocks per file",
174 1L, 0L, &argc, &argv);
175 break;
176
177 case 'c': /* Tape is cart. not 9-track */

--- 53 unchanged lines hidden (view full) ---

231 /*
232 * Determine how to default tape size and density
233 *
234 * density tape size
235 * 9-track 1600 bpi (160 bytes/.1") 2300 ft.
236 * 9-track 6250 bpi (625 bytes/.1") 2300 ft.
237 * cartridge 8000 bpi (100 bytes/.1") 1700 ft.
238 * (450*4 - slop)
177 break;
178
179 case 'B': /* blocks per output file */
180 blocksperfile = numarg('B', "number of blocks per file",
181 1L, 0L, &argc, &argv);
182 break;
183
184 case 'c': /* Tape is cart. not 9-track */

--- 53 unchanged lines hidden (view full) ---

238 /*
239 * Determine how to default tape size and density
240 *
241 * density tape size
242 * 9-track 1600 bpi (160 bytes/.1") 2300 ft.
243 * 9-track 6250 bpi (625 bytes/.1") 2300 ft.
244 * cartridge 8000 bpi (100 bytes/.1") 1700 ft.
245 * (450*4 - slop)
246 * hilit19 hits again: "
239 */
240 if (density == 0)
241 density = cartridge ? 100 : 160;
242 if (tsize == 0)
243 tsize = cartridge ? 1700L*120L : 2300L*120L;
244 }
245
246 if (index(tape, ':')) {

--- 110 unchanged lines hidden (view full) ---

357 else if (cartridge) {
358 /* Estimate number of tapes, assuming streaming stops at
359 the end of each block written, and not in mid-block.
360 Assume no erroneous blocks; this can be compensated
361 for with an artificially low tape size. */
362 fetapes =
363 ( tapesize /* blocks */
364 * TP_BSIZE /* bytes/block */
247 */
248 if (density == 0)
249 density = cartridge ? 100 : 160;
250 if (tsize == 0)
251 tsize = cartridge ? 1700L*120L : 2300L*120L;
252 }
253
254 if (index(tape, ':')) {

--- 110 unchanged lines hidden (view full) ---

365 else if (cartridge) {
366 /* Estimate number of tapes, assuming streaming stops at
367 the end of each block written, and not in mid-block.
368 Assume no erroneous blocks; this can be compensated
369 for with an artificially low tape size. */
370 fetapes =
371 ( tapesize /* blocks */
372 * TP_BSIZE /* bytes/block */
365 * (1.0/density) /* 0.1" / byte */
373 * (1.0/density) /* 0.1" / byte " */
366 +
367 tapesize /* blocks */
368 * (1.0/ntrec) /* streaming-stops per block */
374 +
375 tapesize /* blocks */
376 * (1.0/ntrec) /* streaming-stops per block */
369 * 15.48 /* 0.1" / streaming-stop */
370 ) * (1.0 / tsize ); /* tape / 0.1" */
377 * 15.48 /* 0.1" / streaming-stop " */
378 ) * (1.0 / tsize ); /* tape / 0.1" " */
371 } else {
372 /* Estimate number of tapes, for old fashioned 9-track
373 tape */
374 int tenthsperirg = (density == 625) ? 3 : 7;
375 fetapes =
376 ( tapesize /* blocks */
377 * TP_BSIZE /* bytes / block */
379 } else {
380 /* Estimate number of tapes, for old fashioned 9-track
381 tape */
382 int tenthsperirg = (density == 625) ? 3 : 7;
383 fetapes =
384 ( tapesize /* blocks */
385 * TP_BSIZE /* bytes / block */
378 * (1.0/density) /* 0.1" / byte */
386 * (1.0/density) /* 0.1" / byte " */
379 +
380 tapesize /* blocks */
381 * (1.0/ntrec) /* IRG's / block */
387 +
388 tapesize /* blocks */
389 * (1.0/ntrec) /* IRG's / block */
382 * tenthsperirg /* 0.1" / IRG */
383 ) * (1.0 / tsize ); /* tape / 0.1" */
390 * tenthsperirg /* 0.1" / IRG " */
391 ) * (1.0 / tsize ); /* tape / 0.1" " */
384 }
385 etapes = fetapes; /* truncating assignment */
386 etapes++;
387 /* count the dumped inodes map on each additional tape */
388 tapesize += (etapes - 1) *
389 (howmany(mapsize * sizeof(char), TP_BSIZE) + 1);
390 tapesize += etapes + 10; /* headers + 10 trailer blks */
391 msg("estimated %ld tape blocks on %3.2f tape(s).\n",

--- 43 unchanged lines hidden (view full) ---

435 */
436 dp = getino(ino);
437 mode = dp->di_mode & IFMT;
438 if (mode == IFDIR)
439 continue;
440 (void)dumpino(dp, ino);
441 }
442
392 }
393 etapes = fetapes; /* truncating assignment */
394 etapes++;
395 /* count the dumped inodes map on each additional tape */
396 tapesize += (etapes - 1) *
397 (howmany(mapsize * sizeof(char), TP_BSIZE) + 1);
398 tapesize += etapes + 10; /* headers + 10 trailer blks */
399 msg("estimated %ld tape blocks on %3.2f tape(s).\n",

--- 43 unchanged lines hidden (view full) ---

443 */
444 dp = getino(ino);
445 mode = dp->di_mode & IFMT;
446 if (mode == IFDIR)
447 continue;
448 (void)dumpino(dp, ino);
449 }
450
451 (void)time((time_t *)&(tend_writing));
443 spcl.c_type = TS_END;
444 for (i = 0; i < ntrec; i++)
445 writeheader(maxino - 1);
446 if (pipeout)
452 spcl.c_type = TS_END;
453 for (i = 0; i < ntrec; i++)
454 writeheader(maxino - 1);
455 if (pipeout)
447 msg("DUMP: %ld tape blocks\n",spcl.c_tapea);
456 msg("%ld tape blocks\n", spcl.c_tapea);
448 else
457 else
449 msg("DUMP: %ld tape blocks on %d volumes(s)\n",
458 msg("%ld tape blocks on %d volumes(s)\n",
450 spcl.c_tapea, spcl.c_volume);
459 spcl.c_tapea, spcl.c_volume);
460
461 /* report dump performance, avoid division through zero */
462 if (tend_writing - tstart_writing == 0)
463 msg("finished in less than a second\n");
464 else
465 msg("finished in %d seconds, throughput %d KBytes/sec\n",
466 tend_writing - tstart_writing,
467 spcl.c_tapea / (tend_writing - tstart_writing));
468
451 putdumptime();
452 trewind();
453 broadcast("DUMP IS DONE!\7\7\n");
454 msg("DUMP IS DONE\n");
455 Exit(X_FINOK);
456 /* NOTREACHED */
457}
458

--- 102 unchanged lines hidden ---
469 putdumptime();
470 trewind();
471 broadcast("DUMP IS DONE!\7\7\n");
472 msg("DUMP IS DONE\n");
473 Exit(X_FINOK);
474 /* NOTREACHED */
475}
476

--- 102 unchanged lines hidden ---