diff options
author | Theodore Ts'o <tytso@mit.edu> | 1997-12-01 18:24:10 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1997-12-01 18:24:10 +0000 |
commit | 5be8dc2143c7b3b21a9b8fb56797dd855ee87560 (patch) | |
tree | c05a66556a187b90c0bd8cab1429f04cd3587967 /e2fsck/dirinfo.c | |
parent | 134ea28aaf76a3497361c99e115ff666b0c000b8 (diff) | |
download | e2fsprogs-5be8dc2143c7b3b21a9b8fb56797dd855ee87560.tar.gz |
Many files:
dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more paranoid
about validating the directory counts from the block group
information.
all files: Don't include stdlib.h anymore; include it in ext2_fs.h,
since that file requires stdlib.h
ChangeLog, Makefile.in, dirinfo.c:
dirinfo.c (e2fsck_add_dir_info): Use ext2fs_get_num_dirs instead of
e2fsck_get_num_dirs, which has been removed.
Makefile.in (PROGS): Remove @EXTRA_PROGS@, since we don't want to
compile and install flushb.
ChangeLog, configure.in:
Remove @EXTRA_PROGS@, since we aren't using it in 2fsck/Makefile.in anymore
ChangeLog, Makefile.in:
Install debugfs in /sbin, instead of /usr/sbin.
libext2fs.texinfo:
Update version string to be 1.12
Makefile.in:
Fix bug in find script which made the exclusion list, where a '-' was
missing from an -name option.
Diffstat (limited to 'e2fsck/dirinfo.c')
-rw-r--r-- | e2fsck/dirinfo.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/e2fsck/dirinfo.c b/e2fsck/dirinfo.c index 38a8e437..2ab4a94e 100644 --- a/e2fsck/dirinfo.c +++ b/e2fsck/dirinfo.c @@ -8,18 +8,6 @@ #include <et/com_err.h> #include "e2fsck.h" -int e2fsck_get_num_dirs(e2fsck_t ctx) -{ - ext2_filsys fs = ctx->fs; - int i, num_dirs; - - num_dirs = 0; - for (i = 0; i < fs->group_desc_count; i++) - num_dirs += fs->group_desc[i].bg_used_dirs_count; - - return num_dirs; -} - /* * This subroutine is called during pass1 to create a directory info * entry. During pass1, the passed-in parent is 0; it will get filled @@ -29,6 +17,7 @@ void e2fsck_add_dir_info(e2fsck_t ctx, ino_t ino, ino_t parent) { struct dir_info *dir; int i, j; + ino_t num_dirs; errcode_t retval; #if 0 @@ -36,8 +25,10 @@ void e2fsck_add_dir_info(e2fsck_t ctx, ino_t ino, ino_t parent) #endif if (!ctx->dir_info) { ctx->dir_info_count = 0; - ctx->dir_info_size = e2fsck_get_num_dirs(ctx) + 10; - + retval = ext2fs_get_num_dirs(ctx->fs, &num_dirs); + if (retval) + num_dirs = 1024; /* Guess */ + ctx->dir_info_size = num_dirs + 10; ctx->dir_info = e2fsck_allocate_memory(ctx, ctx->dir_info_size * sizeof (struct dir_info), "directory map"); |