]> git.wh0rd.org - dump.git/commitdiff
Bump estimate blocks to long long to cope with huge dumps.
authorStelian Pop <stelian@popies.net>
Wed, 28 Apr 2010 09:29:35 +0000 (09:29 +0000)
committerStelian Pop <stelian@popies.net>
Wed, 28 Apr 2010 09:29:35 +0000 (09:29 +0000)
CHANGES
dump/dump.h
dump/main.c
dump/traverse.c

diff --git a/CHANGES b/CHANGES
index b31b75a3b8966f8ca70979df705bf72d31bdad16..088e5bbf18bbbb3cdffaecab1c310de74c02bde9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.310 2010/03/22 16:08:10 stelian Exp $
+$Id: CHANGES,v 1.311 2010/04/28 09:29:35 stelian Exp $
 
 Changes between versions 0.4b42 and 0.4b43 (released ?????????????)
 ===================================================================
 
 Changes between versions 0.4b42 and 0.4b43 (released ?????????????)
 ===================================================================
@@ -39,6 +39,10 @@ Changes between versions 0.4b42 and 0.4b43 (released ?????????????)
        Brière <fbriere@fbriere.net> for the bug report and the associated
        patch.
 
        Brière <fbriere@fbriere.net> for the bug report and the associated
        patch.
 
+9.     Fix progress/estimated blocks display in dump when doing really
+       huge backups. Thanks to Steve Bonds <sbonds@users.sourceforge.net>
+       for the bug report and tests. (Sourceforge bug #2987758)
+
 Changes between versions 0.4b41 and 0.4b42 (released June 18, 2009)
 ===================================================================
 
 Changes between versions 0.4b41 and 0.4b42 (released June 18, 2009)
 ===================================================================
 
index fafd4c399552a859ce519fe139727d082b33849d..f26d12b6260b9f72f80e9f4b55c4037a503b92c3 100644 (file)
@@ -5,7 +5,7 @@
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
  *     Stelian Pop <stelian@popies.net>, 1999-2000
  *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  *
- *     $Id: dump.h,v 1.49 2004/07/01 09:14:49 stelian Exp $
+ *     $Id: dump.h,v 1.50 2010/04/28 09:29:50 stelian Exp $
  */
 
 /*-
  */
 
 /*-
@@ -91,7 +91,7 @@ extern int    fifoout;        /* true => output to fifo */
 extern dump_ino_t curino;      /* current inumber; used globally */
 extern int     newtape;        /* new tape flag */
 extern int     density;        /* density in 0.1" units */
 extern dump_ino_t curino;      /* current inumber; used globally */
 extern int     newtape;        /* new tape flag */
 extern int     density;        /* density in 0.1" units */
-extern long    tapesize;       /* estimated tape size, blocks */
+extern long long tapesize;     /* estimated tape size, blocks */
 extern long    tsize;          /* tape size in 0.1" units */
 extern long    asize;          /* number of 0.1" units written on current tape */
 extern int     etapes;         /* estimated number of tapes */
 extern long    tsize;          /* tape size in 0.1" units */
 extern long    asize;          /* number of 0.1" units written on current tape */
 extern int     etapes;         /* estimated number of tapes */
@@ -148,12 +148,12 @@ time_t    unctime __P((const char *str));
 /* mapping rouintes */
 struct dinode;
 long   blockest __P((struct dinode const *dp));
 /* mapping rouintes */
 struct dinode;
 long   blockest __P((struct dinode const *dp));
-int    mapfiles __P((dump_ino_t maxino, long *tapesize));
+int    mapfiles __P((dump_ino_t maxino, long long *tapesize));
 #ifdef __linux__
 #ifdef __linux__
-int    mapfilesfromdir __P((dump_ino_t maxino, long *tapesize, char *directory));
-int    maponefile __P((dump_ino_t maxino, long *tapesize, char *directory));
+int    mapfilesfromdir __P((dump_ino_t maxino, long long *tapesize, char *directory));
+int    maponefile __P((dump_ino_t maxino, long long *tapesize, char *directory));
 #endif
 #endif
-int    mapdirs __P((dump_ino_t maxino, long *tapesize));
+int    mapdirs __P((dump_ino_t maxino, long long *tapesize));
 
 /* file dumping routines */
 void   blksout __P((blk_t *blkp, int frags, dump_ino_t ino));
 
 /* file dumping routines */
 void   blksout __P((blk_t *blkp, int frags, dump_ino_t ino));
index 74ca0be0d72aaa9adf9721087bccb1e60f26b5e1..ae3e3caa6ee64f3c12ebdcc47390db0a5bb628b4 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.96 2009/07/23 09:34:07 stelian Exp $";
+       "$Id: main.c,v 1.97 2010/04/28 09:29:50 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -123,7 +123,7 @@ int fifoout;        /* true => output to fifo */
 dump_ino_t curino;     /* current inumber; used globally */
 int    newtape;        /* new tape flag */
 int    density;        /* density in 0.1" units */
 dump_ino_t curino;     /* current inumber; used globally */
 int    newtape;        /* new tape flag */
 int    density;        /* density in 0.1" units */
-long   tapesize;       /* estimated tape size, blocks */
+long 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 */
 int    etapes;         /* estimated number of tapes */
 long   tsize;          /* tape size in 0.1" units */
 long   asize;          /* number of 0.1" units written on current tape */
 int    etapes;         /* estimated number of tapes */
@@ -869,12 +869,12 @@ main(int argc, char *argv[])
 
        if (pipeout || unlimited) {
                tapesize += 1 + ntrec;  /* 1 map header + trailer blocks */
 
        if (pipeout || unlimited) {
                tapesize += 1 + ntrec;  /* 1 map header + trailer blocks */
-               msg("estimated %ld blocks.\n", tapesize);
+               msg("estimated %lld blocks.\n", tapesize);
        } else {
                double fetapes;
 
                if (blocksperfiles) {
        } else {
                double fetapes;
 
                if (blocksperfiles) {
-                       long tapesize_left;
+                       long long tapesize_left;
 
                        tapesize_left = tapesize;
                        fetapes = 0;
 
                        tapesize_left = tapesize;
                        fetapes = 0;
@@ -921,7 +921,7 @@ main(int argc, char *argv[])
                tapesize += (etapes - 1) *
                        (howmany(mapsize * sizeof(char), TP_BSIZE) + 1);
                tapesize += etapes + ntrec;     /* headers + trailer blks */
                tapesize += (etapes - 1) *
                        (howmany(mapsize * sizeof(char), TP_BSIZE) + 1);
                tapesize += etapes + ntrec;     /* headers + trailer blks */
-               msg("estimated %ld blocks on %3.2f tape(s).\n",
+               msg("estimated %lld blocks on %3.2f tape(s).\n",
                    tapesize, fetapes);
        }
 
                    tapesize, fetapes);
        }
 
index 18892180712b57e807a466d5eb4870d34e6e9490..491d43ad28169b5b949817d656ed9398b2351348 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.68 2010/03/22 15:40:55 stelian Exp $";
+       "$Id: traverse.c,v 1.69 2010/04/28 09:29:50 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -99,7 +99,7 @@ static        int dirindir __P((dump_ino_t ino, daddr_t blkno, int level, long *size));
 static void dmpindir __P((dump_ino_t ino, daddr_t blk, int level, fsizeT *size));
 static int searchdir __P((dump_ino_t ino, daddr_t blkno, long size, long filesize));
 #endif
 static void dmpindir __P((dump_ino_t ino, daddr_t blk, int level, fsizeT *size));
 static int searchdir __P((dump_ino_t ino, daddr_t blkno, long size, long filesize));
 #endif
-static void mapfileino __P((dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped));
+static void mapfileino __P((dump_ino_t ino, struct dinode const *dp, long long *tapesize, int *dirskipped));
 static void dump_xattr __P((dump_ino_t ino, struct dinode *dp));
 
 #ifdef HAVE_EXT2_JOURNAL_INUM
 static void dump_xattr __P((dump_ino_t ino, struct dinode *dp));
 
 #ifdef HAVE_EXT2_JOURNAL_INUM
@@ -260,7 +260,7 @@ blockest(struct dinode const *dp)
  * copy of the given inode, or be NULL (in which case it is fetched.)
  */
 static void
  * copy of the given inode, or be NULL (in which case it is fetched.)
  */
 static void
-mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskipped)
+mapfileino(dump_ino_t ino, struct dinode const *dp, long long *tapesize, int *dirskipped)
 {
        int mode;
 
 {
        int mode;
 
@@ -315,7 +315,7 @@ mapfileino(dump_ino_t ino, struct dinode const *dp, long *tapesize, int *dirskip
  */
 #ifdef __linux__
 int
  */
 #ifdef __linux__
 int
-mapfiles(UNUSED(dump_ino_t maxino), long *tapesize)
+mapfiles(UNUSED(dump_ino_t maxino), long long *tapesize)
 {
        ext2_ino_t ino;
        int anydirskipped = 0;
 {
        ext2_ino_t ino;
        int anydirskipped = 0;
@@ -359,7 +359,7 @@ mapfiles(UNUSED(dump_ino_t maxino), long *tapesize)
 }
 #else
 int
 }
 #else
 int
-mapfiles(dump_ino_t maxino, long *tapesize)
+mapfiles(dump_ino_t maxino, long long *tapesize)
 {
        dump_ino_t ino;
        int anydirskipped = 0;
 {
        dump_ino_t ino;
        int anydirskipped = 0;
@@ -378,7 +378,7 @@ mapfiles(dump_ino_t maxino, long *tapesize)
 
 #ifdef __linux__
 int
 
 #ifdef __linux__
 int
-maponefile(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
+maponefile(UNUSED(dump_ino_t maxino), long long *tapesize, char *directory)
 {
        errcode_t retval;
        ext2_ino_t dir_ino;
 {
        errcode_t retval;
        ext2_ino_t dir_ino;
@@ -426,7 +426,7 @@ maponefile(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
 
 #ifdef __linux__
 struct mapfile_context {
 
 #ifdef __linux__
 struct mapfile_context {
-       long *tapesize;
+       long long *tapesize;
        int *anydirskipped;
 };
 
        int *anydirskipped;
 };
 
@@ -468,7 +468,7 @@ mapfilesindir(struct ext2_dir_entry *dirent, UNUSED(int offset),
  * the directories in the filesystem.
  */
 int
  * the directories in the filesystem.
  */
 int
-mapfilesfromdir(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
+mapfilesfromdir(UNUSED(dump_ino_t maxino), long long *tapesize, char *directory)
 {
        errcode_t retval;
        struct mapfile_context mfc;
 {
        errcode_t retval;
        struct mapfile_context mfc;
@@ -530,7 +530,7 @@ mapfilesfromdir(UNUSED(dump_ino_t maxino), long *tapesize, char *directory)
 struct mapdirs_context {
        int *ret;
        int nodump;
 struct mapdirs_context {
        int *ret;
        int nodump;
-       long *tapesize;
+       long long *tapesize;
 };
 #endif
 
 };
 #endif
 
@@ -547,7 +547,7 @@ struct mapdirs_context {
  * pass using this algorithm.
  */
 int
  * pass using this algorithm.
  */
 int
-mapdirs(dump_ino_t maxino, long *tapesize)
+mapdirs(dump_ino_t maxino, long long *tapesize)
 {
        struct  dinode *dp;
        int isdir;
 {
        struct  dinode *dp;
        int isdir;
@@ -672,7 +672,7 @@ searchdir(struct ext2_dir_entry *dp, UNUSED(int offset),
 {
        struct mapdirs_context *mdc;
        int *ret;
 {
        struct mapdirs_context *mdc;
        int *ret;
-       long *tapesize;
+       long long *tapesize;
        struct dinode *ip;
 
        mdc = (struct mapdirs_context *)private;
        struct dinode *ip;
 
        mdc = (struct mapdirs_context *)private;