]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed a bug with closing swapout files around the time we call
authorwessels <>
Sat, 22 May 1999 08:31:18 +0000 (08:31 +0000)
committerwessels <>
Sat, 22 May 1999 08:31:18 +0000 (08:31 +0000)
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.

src/store.cc
src/store_swapout.cc

index e8e64f2671b8821bd85124b60e06818d648c2fe6..7d10817f3faec2ca0b820f28a2c030b417a70a29 100644 (file)
@@ -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);
 }
 
 /*
index b31c905991dff62b14e4b8efd0ab5d4eea0f4349..94c3d70a2e74057ce8528dfe5394e099445beeb4 100644 (file)
@@ -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