From cd457ce1f68d29038da8a743d1c08e8aac1babc6 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Sun, 6 Sep 1998 23:11:34 +0000 Subject: [PATCH] only close "stuck" swapout files in STORE_OK state if there is not a write already queued --- src/store_swapout.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/store_swapout.cc b/src/store_swapout.cc index aaca72f851..e1bee483d9 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -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); } -- 2.47.3