From: wessels <> Date: Thu, 5 Feb 1998 07:56:49 +0000 (+0000) Subject: call release request on SWAP_LOG_DEL entries. X-Git-Tag: SQUID_3_0_PRE1~4170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53122c0fadf6f1444efcbc8c3c94898e31cde043;p=thirdparty%2Fsquid.git call release request on SWAP_LOG_DEL entries. Dont log 'invalid swap file' thousands of times --- diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index 1f2e465c51..f8da7ab46b 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -35,6 +35,7 @@ struct storeRebuildState { int invalid; /* # bad lines */ int badflags; /* # bad e->flags */ int need_to_validate; + int bad_log_op; int zero_object_len; time_t start; time_t stop; @@ -187,6 +188,7 @@ storeRebuildFromSwapLog(rebuild_dir * d) int count; int used; /* is swapfile already in use? */ int newer; /* is the log entry newer than current entry? */ + double x; assert(d != NULL); /* load a number of objects per invocation */ for (count = 0; count < d->speed; count++) { @@ -202,10 +204,14 @@ storeRebuildFromSwapLog(rebuild_dir * d) if (s.op == SWAP_LOG_ADD) { (void) 0; } else if (s.op == SWAP_LOG_DEL) { - /* XXX we should just storeRelease()? */ + if ((e = storeGet(s.key)) != NULL) + storeReleaseRequest(e); continue; } else { - debug(20, 1) ("storeRebuildFromSwapLog: Invalid swap entry\n"); + x = log(++RebuildState.bad_log_op) / log(10.0); + if (0.0 == x - (double) (int) x) + debug(20, 1) ("WARNING: %d invalid swap log entries found\n", + RebuildState.bad_log_op); RebuildState.invalid++; continue; }