From: wessels <> Date: Sat, 22 May 1999 08:31:18 +0000 (+0000) Subject: Fixed a bug with closing swapout files around the time we call X-Git-Tag: SQUID_3_0_PRE1~2186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d7313ac9ea6e1e1266f4bbbf9c2a18a95d728ec;p=thirdparty%2Fsquid.git Fixed a bug with closing swapout files around the time we call storeComplete(). Used to be that storeComplete() would call storeClose() if there was a swapout.sio structure. This was essentially the right thing to do, but kind of awkwardly implemented. A better choice is to have storeSwapOut() close objects that are in STORE_OK state and if inmem_hi == queued_offset. --- diff --git a/src/store.cc b/src/store.cc index e8e64f2671..7d10817f3f 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.499 1999/05/19 19:57:53 wessels Exp $ + * $Id: store.cc,v 1.500 1999/05/22 02:31:18 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -584,8 +584,6 @@ storeComplete(StoreEntry * e) #endif InvokeHandlers(e); storeSwapOut(e); - if (e->mem_obj->swapout.sio) - storeClose(e->mem_obj->swapout.sio); } /* diff --git a/src/store_swapout.cc b/src/store_swapout.cc index b31c905991..94c3d70a2e 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.cc,v 1.49 1999/05/19 21:57:51 wessels Exp $ + * $Id: store_swapout.cc,v 1.50 1999/05/22 02:31:20 wessels Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -136,13 +136,6 @@ storeSwapOut(StoreEntry * e) #if OLD_CODE if (e->store_status == STORE_OK) { debug(20, 1) ("storeSwapOut: nothing to write for STORE_OK\n"); - if (e->swap_file_number > -1) { - storeUnlink(e->swap_file_number); - storeDirMapBitReset(e->swap_file_number); - e->swap_file_number = -1; - } - e->swap_status = SWAPOUT_NONE; - storeReleaseRequest(e); storeSwapOutFileClose(e); } #endif @@ -195,6 +188,9 @@ storeSwapOut(StoreEntry * e) swap_buf_len, (int) mem->swapout.queue_offset); mem->swapout.queue_offset += swap_buf_len - hdr_len; storeWrite(mem->swapout.sio, swap_buf, swap_buf_len, -1, memFreeDISK); + if (e->store_status == STORE_OK) + if (mem->inmem_hi == mem->swapout.queue_offset) + storeSwapOutFileClose(e); } void