From: wessels <> Date: Wed, 1 Apr 1998 10:26:44 +0000 (+0000) Subject: move RELEASE_REQUEST entries to the LRU list TAIL so they get X-Git-Tag: SQUID_3_0_PRE1~3666 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=229dbdb366903000355aecdbe5eddd0d85a34abf;p=thirdparty%2Fsquid.git move RELEASE_REQUEST entries to the LRU list TAIL so they get removed by the LRU procedure. --- diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index ce673733bc..80360a31e4 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -560,12 +560,18 @@ storeCleanup(void *datanotused) continue; if (EBIT_TEST(e->flag, RELEASE_REQUEST)) { if (e->swap_file_number > -1) - debug(20, 1) ("storeCleanup: WARNING: swap_file_number = %08X for RELEASE_REQUEST entry\n", + debug(20, 3) ("storeCleanup: swap_file_number = %08X for RELEASE_REQUEST entry\n", e->swap_file_number); /* * I don't think it safe to call storeRelease() * from inside this loop using link_ptr. */ + /* + * Move to the tail of the LRU list + * so it gets kicked out + */ + dlinkDelete(&e->lru, &store_list); + dlinkAddTail(e, &e->lru, &store_list); continue; } if (opt_store_doublecheck) { diff --git a/src/tools.cc b/src/tools.cc index aaf7af1a63..107b433bd0 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.151 1998/03/05 00:43:09 wessels Exp $ + * $Id: tools.cc,v 1.152 1998/04/01 03:26:44 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -800,6 +800,19 @@ dlinkAdd(void *data, dlink_node * m, dlink_list * list) list->tail = m; } +void +dlinkAddTail(void *data, dlink_node * m, dlink_list * list) +{ + m->data = data; + m->next = NULL; + m->prev = list->tail; + if (list->tail) + list->tail->next = m; + list->tail = m; + if (list->head == NULL) + list->head = m; +} + void dlinkDelete(dlink_node * m, dlink_list * list) {