]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
From: Mark Treacy <mark@aone.com.au>
authorwessels <>
Tue, 19 Nov 1996 14:11:48 +0000 (14:11 +0000)
committerwessels <>
Tue, 19 Nov 1996 14:11:48 +0000 (14:11 +0000)
I was looking through store.c and noticed that storeSwapOutHandle()
would be calling storeSwapFullPath() much too frequently.  I've moved
the call to where it's needed in the infrequent case that the filename
is needed.

src/store.cc

index e0e537aa6b21cce53a69b54c8883ffa9f3749aa0..91772211604858358c057a950880f9549457d61e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.167 1996/11/15 17:26:22 wessels Exp $
+ * $Id: store.cc,v 1.168 1996/11/19 07:11:48 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -1211,7 +1211,6 @@ storeSwapLog(const StoreEntry * e)
 static void
 storeSwapOutHandle(int fd, int flag, StoreEntry * e)
 {
-    LOCAL_ARRAY(char, filename, SQUID_MAXPATHLEN);
     MemObject *mem = e->mem_obj;
 
     debug(20, 3, "storeSwapOutHandle: '%s'\n", e->key);
@@ -1220,8 +1219,6 @@ storeSwapOutHandle(int fd, int flag, StoreEntry * e)
        debug_trap("Someone is swapping out a bad entry");
        return;
     }
-    storeSwapFullPath(e->swap_file_number, filename);
-
     if (flag < 0) {
        debug(20, 1, "storeSwapOutHandle: SwapOut failure (err code = %d).\n",
            flag);
@@ -1230,7 +1227,7 @@ storeSwapOutHandle(int fd, int flag, StoreEntry * e)
        file_close(fd);
        if (e->swap_file_number != -1) {
            file_map_bit_reset(e->swap_file_number);
-           safeunlink(filename, 0);    /* remove it */
+           safeunlink(storeSwapFullPath(e->swap_file_number, NULL), 0);
            e->swap_file_number = -1;
        }
        storeRelease(e);