mirror of https://github.com/vitalif/e2fsprogs
ChangeLog, e2fsck.h, unix.c:
unix.c (e2fsck_update_progress): Limit the number of updates to the progress bars to 8 times a second. This allows a 9600 baud console link to keep up.bitmap-optimize
parent
1917875fcd
commit
0601232332
|
@ -1,3 +1,9 @@
|
|||
2000-02-12 <tytso@snap.thunk.org>
|
||||
|
||||
* unix.c (e2fsck_update_progress): Limit the number of updates to
|
||||
the progress bars to 8 times a second. This allows a 9600
|
||||
baud console link to keep up.
|
||||
|
||||
2000-02-11 <tytso@snap.thunk.org>
|
||||
|
||||
* unix.c (main): If compression is enabled on the filesystem,
|
||||
|
|
|
@ -219,6 +219,7 @@ struct e2fsck_struct {
|
|||
int progress_fd;
|
||||
int progress_pos;
|
||||
int progress_last_percent;
|
||||
unsigned int progress_last_time;
|
||||
|
||||
/* File counts */
|
||||
int fs_directory_count;
|
||||
|
|
|
@ -325,6 +325,8 @@ static int e2fsck_update_progress(e2fsck_t ctx, int pass,
|
|||
char buf[80];
|
||||
int i;
|
||||
float percent;
|
||||
int tick;
|
||||
struct timeval tv;
|
||||
|
||||
if (pass == 0)
|
||||
return 0;
|
||||
|
@ -335,6 +337,12 @@ static int e2fsck_update_progress(e2fsck_t ctx, int pass,
|
|||
} else {
|
||||
if (ctx->flags & E2F_FLAG_PROG_SUPPRESS)
|
||||
return 0;
|
||||
gettimeofday(&tv, NULL);
|
||||
tick = (tv.tv_sec << 3) + (tv.tv_usec / (1000000 / 8));
|
||||
if ((tick == ctx->progress_last_time) &&
|
||||
(cur != max) && (cur != 0))
|
||||
return 0;
|
||||
ctx->progress_last_time = tick;
|
||||
ctx->progress_pos = (ctx->progress_pos+1) & 3;
|
||||
ctx->flags |= E2F_FLAG_PROG_BAR;
|
||||
percent = calc_percent(&e2fsck_tbl, pass, cur, max);
|
||||
|
|
Loading…
Reference in New Issue