aboutsummaryrefslogtreecommitdiff
path: root/e2fsck/pass5.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1999-07-19 15:27:37 +0000
committerTheodore Ts'o <tytso@mit.edu>1999-07-19 15:27:37 +0000
commit5596defa1e212242c1bf1b028139143fbb7777a0 (patch)
tree611585743f9f67fe1a42167f6094941fed54da8a /e2fsck/pass5.c
parent9f10a7b31e57288093930fc9565102409eeac6e9 (diff)
downloade2fsprogs-5596defa1e212242c1bf1b028139143fbb7777a0.tar.gz
Many files:
unix.c: Add support for calculating a progress bar if the -C0 option is given. The function e2fsck_clear_progbar() clears the progress bar and must be called before any message is issued. SIGUSR1 will enable the progress bar, and SIGUSR2 will disable the progress bar. This is used by fsck to handle parallel filesystem checks. Also, set the device_name from the filesystem label if it is available. e2fsck.h: Add new flags E2F_FLAG_PROG_BAR and E2F_FLAG_PROG_SUPRESS. Add new field in the e2fsck structure which contains the last tenth of a percent printed for the user. message.c (print_e2fsck_message): Add call to e2fsck_clear_progbar(). pass1.c (e2fsck_pass1): pass2.c (e2fsck_pass2): pass3.c (e2fsck_pass3): pass4.c (e2fsck_pass4): pass5.c (e2fsck_pass5): Add call to e2fsck_clear_progbar when printing the resource tracking information. pass5.c (check_block_bitmaps, check_inode_bitmaps): If there is an error in the bitmaps, suppress printing the progress bar using the suppression flag for the remainder of the check, in order to clean up the display.
Diffstat (limited to 'e2fsck/pass5.c')
-rw-r--r--e2fsck/pass5.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c
index 274052ec..b39b3134 100644
--- a/e2fsck/pass5.c
+++ b/e2fsck/pass5.c
@@ -65,8 +65,10 @@ void e2fsck_pass5(e2fsck_t ctx)
ctx->block_found_map = 0;
#ifdef RESOURCE_TRACK
- if (ctx->options & E2F_OPT_TIME2)
+ if (ctx->options & E2F_OPT_TIME2) {
+ e2fsck_clear_progbar(ctx);
print_resource_track("Pass 5", &rtrack);
+ }
#endif
}
@@ -142,6 +144,7 @@ redo_counts:
}
pctx.blk = i;
fix_problem(ctx, problem, &pctx);
+ ctx->flags |= E2F_FLAG_PROG_SUPPRESS;
had_problem++;
do_counts:
@@ -166,6 +169,8 @@ redo_counts:
fixit = end_problem_latch(ctx, PR_LATCH_BBITMAP);
else
fixit = -1;
+ ctx->flags &= ~E2F_FLAG_PROG_SUPPRESS;
+
if (fixit == 1) {
ext2fs_free_block_bitmap(fs->block_map);
retval = ext2fs_copy_bitmap(ctx->block_found_map,
@@ -282,6 +287,7 @@ redo_counts:
}
pctx.ino = i;
fix_problem(ctx, problem, &pctx);
+ ctx->flags |= E2F_FLAG_PROG_SUPPRESS;
had_problem++;
do_counts:
@@ -312,6 +318,8 @@ do_counts:
fixit = end_problem_latch(ctx, PR_LATCH_IBITMAP);
else
fixit = -1;
+ ctx->flags &= ~E2F_FLAG_PROG_SUPPRESS;
+
if (fixit == 1) {
ext2fs_free_inode_bitmap(fs->inode_map);
retval = ext2fs_copy_bitmap(ctx->inode_used_map,