]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
only close "stuck" swapout files in STORE_OK state if there is
authorwessels <>
Sun, 6 Sep 1998 23:11:34 +0000 (23:11 +0000)
committerwessels <>
Sun, 6 Sep 1998 23:11:34 +0000 (23:11 +0000)
not a write already queued

src/store_swapout.cc

index aaca72f8514deac29af38959d1118748a108dc9e..e1bee483d9b096e835bf8699399427a31fc87649 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.27 1998/09/06 16:20:05 wessels Exp $
+ * $Id: store_swapout.cc,v 1.28 1998/09/06 17:11:34 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -43,7 +43,7 @@ typedef struct swapout_ctrl_t {
 
 static FOCB storeSwapOutFileOpened;
 static off_t storeSwapOutObjectBytesOnDisk(const MemObject *);
-static int storeSwapOutAble(const StoreEntry *e);
+static int storeSwapOutAble(const StoreEntry * e);
 
 /* start swapping object to disk */
 void
@@ -186,11 +186,14 @@ storeCheckSwapOut(StoreEntry * e)
     debug(20, 3) ("storeCheckSwapOut: swapout_size = %d\n",
        (int) swapout_size);
     if (swapout_size == 0) {
-       if (e->store_status == STORE_OK) {
+       if (e->store_status == STORE_OK && !storeSwapOutWriteQueued(mem)) {
            debug(20, 1) ("storeCheckSwapOut: nothing to write for STORE_OK\n");
-           storeUnlinkFileno(e->swap_file_number);
-           storeDirMapBitReset(e->swap_file_number);
-           e->swap_file_number = -1;
+           debug(20, 1) ("\t%s\n", storeUrl(e));
+           if (e->swap_file_number > -1) {
+               storeUnlinkFileno(e->swap_file_number);
+               storeDirMapBitReset(e->swap_file_number);
+               e->swap_file_number = -1;
+           }
            e->swap_status = SWAPOUT_NONE;
            storeSwapOutFileClose(e);
        }