* [Cluster-devel] cluster/gfs/gfs_fsck util.c
@ 2007-01-24 16:52 rpeterso
0 siblings, 0 replies; only message in thread
From: rpeterso @ 2007-01-24 16:52 UTC (permalink / raw)
To: cluster-devel.redhat.com
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
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/util.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1.2.3.6.2&r2=1.1.2.3.6.3
--- cluster/gfs/gfs_fsck/util.c 2006/11/17 16:32:49 1.1.2.3.6.2
+++ cluster/gfs/gfs_fsck/util.c 2007/01/24 16:52:32 1.1.2.3.6.3
@@ -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);
+ }
}
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-01-24 16:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-24 16:52 [Cluster-devel] cluster/gfs/gfs_fsck util.c rpeterso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).