summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1998-02-21 05:01:19 +0000
committerTheodore Ts'o <tytso@mit.edu>1998-02-21 05:01:19 +0000
commit79b05dbed2003cd678ba6b210695420486ce920d (patch)
treec15a570c3a0e33d7d804449f67a5652eee8bf829 /lib
parent51fde2bb4f5818f24b0f7835d847bf8270b4c738 (diff)
downloade2fsprogs-79b05dbed2003cd678ba6b210695420486ce920d.tar.gz
ChangeLog, dblist.c:
dblist.c (ext2fs_get_num_dirs): Improve the estimation of the number of directories when the block group information is unreliable.
Diffstat (limited to 'lib')
-rw-r--r--lib/ext2fs/ChangeLog6
-rw-r--r--lib/ext2fs/dblist.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index ddc1f761..e955cd79 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,3 +1,9 @@
+Fri Feb 20 23:58:01 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * dblist.c (ext2fs_get_num_dirs): Improve the estimation of the
+ number of directories when the block group information is
+ unreliable.
+
1998-02-20 Theodore Y. Ts'o <tytso@edt.mit.edu>
* inode.c (ext2fs_get_next_inode): Always do the check to see if the
diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c
index e7567917..5db0c4f0 100644
--- a/lib/ext2fs/dblist.c
+++ b/lib/ext2fs/dblist.c
@@ -40,10 +40,10 @@ errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ino_t *ret_num_dirs)
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
num_dirs = 0;
- max_dirs = 8 * fs->blocksize;
+ max_dirs = fs->super->s_inodes_per_group;
for (i = 0; i < fs->group_desc_count; i++) {
if (fs->group_desc[i].bg_used_dirs_count > max_dirs)
- num_dirs += max_dirs;
+ num_dirs += max_dirs / 8;
else
num_dirs += fs->group_desc[i].bg_used_dirs_count;
}