]> git.wh0rd.org - dump.git/commitdiff
Updated and cleaned the -B compressed limit.
authorStelian Pop <stelian@popies.net>
Fri, 20 Jul 2001 11:02:45 +0000 (11:02 +0000)
committerStelian Pop <stelian@popies.net>
Fri, 20 Jul 2001 11:02:45 +0000 (11:02 +0000)
CHANGES
dump/dump.h
dump/tape.c

diff --git a/CHANGES b/CHANGES
index 002456fd22829384375da8f34a9838ee59cb38f0..7fc259da1b98e20492ac9d176aa3a2e5a046fe62 100644 (file)
--- 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 
-       <jarausch@igpm.rwth-aachen.de>.
+       <jarausch@igpm.rwth-aachen.de>. 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.
index 1f4ab9ec8a84df21610e53c868207157e37084d5..dacfee1ead2e0a72bd2556392f90abe2a51f7db6 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <pop@noos.fr>, 1999-2000
  *     Stelian Pop <pop@noos.fr> - AlcĂ´ve <www.alcove.fr>, 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 */
index f048a78bb6f7fc1b4f7787ad5ce9bf872d8fbbec..5e79fd2f66a7abac0c70d893a186d21928c1b71c 100644 (file)
@@ -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 <config.h>
@@ -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 */