/*
- * $Id: store.cc,v 1.376 1998/02/04 23:41:00 wessels Exp $
+ * $Id: store.cc,v 1.377 1998/02/06 17:47:09 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
static void destroy_MemObjectData(MemObject *);
static void destroy_StoreEntry(StoreEntry *);
static void storePurgeMem(StoreEntry *);
-static void storeSetPrivateKey(StoreEntry *);
static unsigned int getKeyCounter(void);
static int storeKeepInMemory(const StoreEntry *);
return key_counter;
}
-static void
+void
storeSetPrivateKey(StoreEntry * e)
{
const cache_key *newkey;
/*
- * $Id: store_dir.cc,v 1.46 1998/02/04 23:41:02 wessels Exp $
+ * $Id: store_dir.cc,v 1.47 1998/02/06 17:47:11 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
if (e->swap_file_number < 0) /* was never swapped out */
return;
}
+ /*
+ * icons and such; don't write them to the swap log
+ */
+ if (EBIT_TEST(e->flag, ENTRY_SPECIAL))
+ return;
s->op = (char) op;
s->swap_file_number = e->swap_file_number;
s->timestamp = e->timestamp;
continue;
if (EBIT_TEST(e->flag, KEY_PRIVATE))
continue;
+ if (EBIT_TEST(e->flag, ENTRY_SPECIAL))
+ continue;
dirn = storeDirNumber(e->swap_file_number);
assert(dirn < Config.cacheSwap.n_configured);
if (fd[dirn] < 0)
int statcount; /* # entries from directory walking */
int clashcount; /* # swapfile clashes avoided */
int dupcount; /* # duplicates purged */
+ int cancelcount; /* # SWAP_LOG_DEL objects purged */
int invalid; /* # bad lines */
int badflags; /* # bad e->flags */
int need_to_validate;
if (s.op == SWAP_LOG_ADD) {
(void) 0;
} else if (s.op == SWAP_LOG_DEL) {
- if ((e = storeGet(s.key)) != NULL)
- storeReleaseRequest(e);
+ if ((e = storeGet(s.key)) != NULL) {
+ /*
+ * Make sure we don't unlink the file, it might be
+ * in use by a subsequent entry. Also note that
+ * we don't have to subtract from store_swap_size
+ * because adding to store_swap_size happens in
+ * the cleanup procedure.
+ */
+ storeExpireNow(e);
+ storeSetPrivateKey(e);
+ EBIT_SET(e->flag, RELEASE_REQUEST);
+ storeDirMapBitReset(e->swap_file_number);
+ e->swap_file_number = -1;
+ RebuildState.objcount--;
+ RebuildState.cancelcount++;
+ }
continue;
} else {
x = log(++RebuildState.bad_log_op) / log(10.0);
e = (StoreEntry *) link_ptr;
if (EBIT_TEST(e->flag, ENTRY_VALIDATED))
continue;
- if (EBIT_TEST(e->flag, RELEASE_REQUEST))
+ if (e->swap_file_number < 0)
continue;
EBIT_SET(e->flag, ENTRY_VALIDATED);
/* Only set the file bit if we know its a valid entry */
debug(20, 1) (" %7d With invalid flags.\n", RebuildState.badflags);
debug(20, 1) (" %7d Objects loaded.\n", RebuildState.objcount);
debug(20, 1) (" %7d Objects expired.\n", RebuildState.expcount);
+ debug(20, 1) (" %7d Objects cancelled.\n", RebuildState.cancelcount);
debug(20, 1) (" %7d Duplicate URLs purged.\n", RebuildState.dupcount);
debug(20, 1) (" %7d Swapfile clashes avoided.\n", RebuildState.clashcount);
debug(20, 1) (" Took %d seconds (%6.1lf objects/sec).\n",