diff options
author | mckusick <mckusick@FreeBSD.org> | 2002-12-03 05:12:53 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2002-12-03 05:12:53 +0000 |
commit | f563ab1aae2e32cc78003ff3a4e8f4b09a89d6b0 (patch) | |
tree | ef6b5258342205d6fc48691f14e897a9db9abdaf /sbin/dump | |
parent | e6af62684b27beed8dacaaabb711dd63c2f67889 (diff) | |
download | FreeBSD-src-f563ab1aae2e32cc78003ff3a4e8f4b09a89d6b0.zip FreeBSD-src-f563ab1aae2e32cc78003ff3a4e8f4b09a89d6b0.tar.gz |
Correct the estimated block count calculated by dump to account
for the minimal amount of space used by a snapshot.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sbin/dump')
-rw-r--r-- | sbin/dump/dump.h | 1 | ||||
-rw-r--r-- | sbin/dump/traverse.c | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h index a148c6b..eb04b0c 100644 --- a/sbin/dump/dump.h +++ b/sbin/dump/dump.h @@ -103,7 +103,6 @@ time_t unctime(char *str); /* mapping rouintes */ union dinode; -long blockest(union dinode *dp); int mapfiles(ino_t maxino, long *tapesize); int mapdirs(ino_t maxino, long *tapesize); diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 9882283..ab2ee71 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -76,6 +76,7 @@ static int dirindir(ino_t ino, ufs2_daddr_t blkno, int level, long *size, static void dmpindir(ino_t ino, ufs2_daddr_t blk, int level, off_t *size); static int searchdir(ino_t ino, ufs2_daddr_t blkno, long size, long filesize, long *tapesize, int nodump); +static long blockest(union dinode *dp); /* * This is an estimation of the number of TP_BSIZE blocks in the file. @@ -84,7 +85,7 @@ static int searchdir(ino_t ino, ufs2_daddr_t blkno, long size, long filesize, * (when some of the blocks are usually used for indirect pointers); * hence the estimate may be high. */ -long +static long blockest(union dinode *dp) { long blkest, sizeest; @@ -103,6 +104,8 @@ blockest(union dinode *dp) * dump blocks (sizeest vs. blkest in the indirect block * calculation). */ + if ((DIP(dp, di_flags) & SF_SNAPSHOT) != 0) + return (1); blkest = howmany(dbtob(DIP(dp, di_blocks)), TP_BSIZE); sizeest = howmany(DIP(dp, di_size), TP_BSIZE); if (blkest > sizeest) |