From b0522d37ac04aeae5ba01a848a8530ec4785b79d Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Fri, 20 Jul 2001 11:02:45 +0000 Subject: [PATCH] Updated and cleaned the -B compressed limit. --- CHANGES | 7 +++++-- dump/dump.h | 3 +-- dump/tape.c | 7 ++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 002456f..7fc259d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.126 2001/07/20 09:01:44 stelian Exp $ +$Id: CHANGES,v 1.127 2001/07/20 11:02:45 stelian Exp $ Changes between versions 0.4b22 and 0.4b23 (released ????????????) ================================================================== @@ -24,7 +24,10 @@ Changes between versions 0.4b22 and 0.4b23 (released ????????????) 6. Changed the -B option of dump to limit the size of _compressed_ output per volume if compression is on. Patch contributed by Helmut Jarausch - . + . Note however that, since + it is impossible to predict the size of the compressed + data before doing the compression, the -B limit is a bit + conservative. 7. Fixed a bug in reading the operator typed file/tape path for the next volume in restore. diff --git a/dump/dump.h b/dump/dump.h index 1f4ab9e..dacfee1 100644 --- a/dump/dump.h +++ b/dump/dump.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - AlcĂ´ve , 2000 * - * $Id: dump.h,v 1.28 2001/07/19 09:49:35 stelian Exp $ + * $Id: dump.h,v 1.29 2001/07/20 11:02:45 stelian Exp $ */ /*- @@ -86,7 +86,6 @@ int density; /* density in 0.1" units */ long tapesize; /* estimated tape size, blocks */ long tsize; /* tape size in 0.1" units */ long asize; /* number of 0.1" units written on current tape */ -unsigned long csize; /* number of compressed bytes written on current tape */ int etapes; /* estimated number of tapes */ int nonodump; /* if set, do not honor UF_NODUMP user flags */ int unlimited; /* if set, write to end of medium */ diff --git a/dump/tape.c b/dump/tape.c index f048a78..5e79fd2 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.52 2001/07/20 09:01:46 stelian Exp $"; + "$Id: tape.c,v 1.53 2001/07/20 11:02:45 stelian Exp $"; #endif /* not lint */ #include @@ -443,12 +443,11 @@ flushtape(void) nextblock = slp->tblock; trecno = 0; asize += tenths + returned.clen / density; - csize += returned.clen; blockswritten += ntrec; blocksthisvol += ntrec; if (!pipeout && !unlimited) { if (blocksperfile) { - if ( compressed ? csize + writesize >= blocksperfile * 1024 + if ( compressed ? (bytes_written - tapea_bytes + SLAVES * (writesize + sizeof(struct tapebuf))) >= blocksperfile * 1024 : blocksthisvol >= blocksperfile ) { close_rewind(); startnewtape(0); @@ -693,7 +692,6 @@ rollforward(void) slp->count = lastspclrec + blks + 1 - spcl.c_tapea; slp->inode = curino; asize += tenths + returned.clen / density; - csize += returned.clen; blockswritten += ntrec; blocksthisvol += ntrec; #endif @@ -850,7 +848,6 @@ restore_check_point: enslave(); /* Share open tape file descriptor with slaves */ asize = 0; - csize = 0; blocksthisvol = 0; if (top) newtape++; /* new tape signal */ -- 2.39.2