summaryrefslogtreecommitdiff
path: root/e2fsck/pass3.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-11-14 05:23:04 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-11-14 05:23:04 +0000
commitf8188fff23dc2d9c9f858fb21264e46b17672825 (patch)
tree003f979b0273e095a216787bff3cb14fc7dfb99b /e2fsck/pass3.c
parentd36d835b48f3c280b254a9ca6d519d5c97d14ad4 (diff)
downloade2fsprogs-f8188fff23dc2d9c9f858fb21264e46b17672825.tar.gz
Many files:
pass1.c, pass2.c, pass3.c, pass4.c, pass5.c: Add calls to the progress indicator function. pass1.c (scan_callback): Add call to the progress feedback function (if it exists). super.c (check_super_block): Skip the device size check if the get_device_size returns EXT2_EXT_UNIMPLEMENTED. iscan.c (main): Don't use fatal_error() anymore. pass1b.c, swapfs.c, badblocks.c: Set E2F_FLAG_ABORT instead of calling fatal_error(0). problem.c, pass3.c (PR_3_ROOT_NOT_DIR_ABORT, PR_3_NO_ROOT_INODE_ABORT): New problem codes. problem.c, pass2.c (PR_2_SPLIT_DOT): New problem code. problem.c, pass1.c (PR_1_SUPPRESS_MESSAGES): New problem code. problemP.h: New file which separates out the private fix_problem data structures. util.c, dirinfo.c, pass1.c, pass1b.c, pass2.c, pass5.c, super.c, swapfs.c util.c: allocate_memory() now takes a e2fsck context as its first argument, and rename it to be e2fsck_allocate_memory(). problemP.h: New file which contains the private problem abstraction definitions. Makefile.pq: Remove include of MAKEFILE.STD, which doesn't exist at this point.
Diffstat (limited to 'e2fsck/pass3.c')
-rw-r--r--e2fsck/pass3.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c
index f85d9bd7..9af3be77 100644
--- a/e2fsck/pass3.c
+++ b/e2fsck/pass3.c
@@ -64,7 +64,8 @@ void e2fsck_pass3(e2fsck_t ctx)
#endif
struct problem_context pctx;
struct dir_info *dir;
-
+ unsigned long max, count;
+
#ifdef RESOURCE_TRACK
init_resource_track(&rtrack);
#endif
@@ -108,11 +109,19 @@ void e2fsck_pass3(e2fsck_t ctx)
ext2fs_mark_inode_bitmap(inode_done_map, EXT2_ROOT_INO);
+ max = e2fsck_get_num_dirinfo(ctx);
+ count = 0;
+
+ if (ctx->progress)
+ (ctx->progress)(ctx, 3, 0, max);
for (i=0; (dir = e2fsck_dir_info_iter(ctx, &i)) != 0;) {
+ if (ctx->progress)
+ (ctx->progress)(ctx, 3, count++, max);
if (ext2fs_test_inode_bitmap(ctx->inode_dir_map, dir->ino))
check_directory(ctx, dir, &pctx);
}
-
+ if (ctx->progress)
+ (ctx->progress)(ctx, 3, max, max);
e2fsck_free_dir_info(ctx);
ext2fs_free_inode_bitmap(inode_loop_detect);
@@ -144,15 +153,20 @@ static void check_root(e2fsck_t ctx)
* offered to clear it.
*/
if (!(ext2fs_test_inode_bitmap(ctx->inode_dir_map,
- EXT2_ROOT_INO)))
- fatal_error("Root inode not directory");
+ EXT2_ROOT_INO))) {
+ fix_problem(ctx, PR_3_ROOT_NOT_DIR_ABORT, &pctx);
+ ctx->flags |= E2F_FLAG_ABORT;
+ }
return;
}
- if (!fix_problem(ctx, PR_3_NO_ROOT_INODE, &pctx))
- fatal_error("Cannot proceed without a root inode.");
+ if (!fix_problem(ctx, PR_3_NO_ROOT_INODE, &pctx)) {
+ fix_problem(ctx, PR_3_NO_ROOT_INODE_ABORT, &pctx);
+ ctx->flags |= E2F_FLAG_ABORT;
+ return;
+ }
- read_bitmaps(ctx);
+ e2fsck_read_bitmaps(ctx);
/*
* First, find a free block
@@ -330,7 +344,7 @@ ino_t get_lost_and_found(e2fsck_t ctx)
* Read the inode and block bitmaps in; we'll be messing with
* them.
*/
- read_bitmaps(ctx);
+ e2fsck_read_bitmaps(ctx);
/*
* First, find a free block