cluster/gfs/gfs_fsck util.c
CVSROOT: /cvs/cluster
Module name: cluster
Branch: STABLE
Changes by: rpeterso at sourceware.org 2007-01-24 16:52:32
Modified files:
gfs/gfs_fsck : util.c
Log message:
Resolves: bz 223493 gfs_fsck runs slower than previous versions
gfs/gfs_fsck/util.c +15 -10
@@ -318,20 +318,25 @@/* doesn't think we hung. (This may take a long time). */ void warm_fuzzy_stuff (uint64_t block) { +static uint64_t one_percent =0 ;static struct timeval tv;static uint32_t seconds =0 ; - last_reported_block = block; -gettimeofday (&tv,NULL ); -if (!seconds) - seconds = tv.tv_sec; -if (tv.tv_sec - seconds) { -uint64_t percent; +if (!one_percent) + one_percent = last_fs_block /100 ; +if (block - last_reported_block >= one_percent) { + last_reported_block = block; +gettimeofday (&tv,NULL ); +if (!seconds) + seconds = tv.tv_sec; +if (tv.tv_sec - seconds) { +static uint64_t percent; - seconds = tv.tv_sec; -if (last_fs_block) { - percent = (block *100 ) / last_fs_block; -log_notice ("\r%" PRIu64" percent complete.\r" , percent); + seconds = tv.tv_sec; +if (last_fs_block) { + percent = (block *100 ) / last_fs_block; +log_notice ("\r%" PRIu64" percent complete.\r" , percent); + } } } }