From 4acaf865a54528c32e3f2650007462c97f86a933 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Mon, 1 Mar 2004 15:38:10 +0000 Subject: [PATCH] Another try at fixing size estimate. --- CHANGES | 4 +++- dump/traverse.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index a67e5f5..fa664c4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.241 2004/02/18 16:26:40 stelian Exp $ +$Id: CHANGES,v 1.242 2004/03/01 15:38:10 stelian Exp $ Changes between versions 0.4b35 and 0.4b36 (released ?????????????????) ======================================================================= @@ -27,6 +27,8 @@ Changes between versions 0.4b35 and 0.4b36 (released ?????????????????) 6. Made explicit in the dump man page that dump will not create a remote file, it will only write to an already existing one. +7. Another try at making size estimates better again. + Changes between versions 0.4b34 and 0.4b35 (released December 21, 2003) ======================================================================= diff --git a/dump/traverse.c b/dump/traverse.c index 2142abc..fb868db 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.56 2003/10/26 16:05:47 stelian Exp $"; + "$Id: traverse.c,v 1.57 2004/03/01 15:38:13 stelian Exp $"; #endif /* not lint */ #include @@ -202,9 +202,9 @@ blockest(struct dinode const *dp) * dump blocks (sizeest vs. blkest in the indirect block * calculation). */ - blkest = howmany((u_quad_t)dp->di_blocks * 512, TP_BSIZE); + blkest = howmany((u_quad_t)dp->di_blocks * 512, fs->blocksize) * (fs->blocksize / TP_BSIZE); i_size = dp->di_size + ((u_quad_t) dp->di_size_high << 32); - sizeest = howmany(i_size, TP_BSIZE); + sizeest = howmany(i_size, fs->blocksize) * (fs->blocksize / TP_BSIZE); if (blkest > sizeest) blkest = sizeest; #ifdef __linux__ @@ -212,7 +212,7 @@ blockest(struct dinode const *dp) /* calculate the number of indirect blocks on the dump tape */ blkest += howmany(sizeest - NDADDR * fs->blocksize / TP_BSIZE, - NINDIR(sblock) * EXT2_FRAGS_PER_BLOCK(fs->super)); + TP_NINDIR); } #else if (i_size > sblock->fs_bsize * NDADDR) { -- 2.39.5