X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftraverse.c;h=b0a1f145ddbb8f8e9323767fb0ec8101cfbd5b49;hb=e5916e4b30bb009709fe2a3a6f63ac16e986de6f;hp=fb868dba4050aec08cc81ae8a961cc5eb6045f19;hpb=4acaf865a54528c32e3f2650007462c97f86a933;p=dump.git diff --git a/dump/traverse.c b/dump/traverse.c index fb868db..b0a1f14 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.57 2004/03/01 15:38:13 stelian Exp $"; + "$Id: traverse.c,v 1.60 2004/03/10 16:26:30 stelian Exp $"; #endif /* not lint */ #include @@ -208,6 +208,14 @@ blockest(struct dinode const *dp) if (blkest > sizeest) blkest = sizeest; #ifdef __linux__ + if ((dp->di_mode & IFMT) == IFDIR) { + /* + * for directories, assume only half of space is filled + * with entries. + */ + blkest = blkest / 2; + sizeest = sizeest / 2; + } if (i_size > (u_quad_t)fs->blocksize * NDADDR) { /* calculate the number of indirect blocks on the dump tape */ blkest +=