]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fully deprecated storeUnlockObject(). Now everything directly uses
authorwessels <>
Fri, 19 May 2006 23:05:18 +0000 (23:05 +0000)
committerwessels <>
Fri, 19 May 2006 23:05:18 +0000 (23:05 +0000)
the StoreEntry unlock() method.

25 files changed:
src/Server.cc
src/Store.h
src/asn.cc
src/cache_manager.cc
src/client_side_reply.cc
src/client_side_request.cc
src/errorpage.cc
src/forward.cc
src/gopher.cc
src/mime.cc
src/neighbors.cc
src/net_db.cc
src/peer_digest.cc
src/peer_select.cc
src/repl/heap/store_repl_heap.cc
src/stat.cc
src/store.cc
src/store_digest.cc
src/store_swapout.cc
src/tests/testCoss.cc
src/tests/testNull.cc
src/tests/testUfs.cc
src/urn.cc
src/wais.cc
src/whois.cc

index b055066b83a2a94f749cdd8dc47f57320a8eb96a..a8e571bbb5402d0cb6a2b047f41258430255ce20 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Server.cc,v 1.3 2006/02/17 18:10:59 wessels Exp $
+ * $Id: Server.cc,v 1.4 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG:
  * AUTHOR: Duane Wessels
@@ -51,7 +51,7 @@ ServerStateData::ServerStateData(FwdState *theFwdState)
 
 ServerStateData::~ServerStateData()
 {
-    storeUnlockObject(entry);
+    entry->unlock();
 
     HTTPMSGUNLOCK(request);
     HTTPMSGUNLOCK(reply);
index 8fbf1f015a9f88164f765ac818cdcc105248c41b..d13aea31323309a85919c609ce8a79f7bf2102f4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: Store.h,v 1.20 2006/05/03 14:04:44 robertc Exp $
+ * $Id: Store.h,v 1.21 2006/05/19 17:05:18 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -285,7 +285,6 @@ SQUIDCEXTERN void storeAbort(StoreEntry *);
 SQUIDCEXTERN void storeAppend(StoreEntry *, const char *, int);
 SQUIDCEXTERN void storeLockObject(StoreEntry *);
 SQUIDCEXTERN void storeRelease(StoreEntry *);
-SQUIDCEXTERN int storeUnlockObject(StoreEntry *);
 SQUIDCEXTERN void storeExpireNow(StoreEntry *);
 SQUIDCEXTERN void storeReleaseRequest(StoreEntry *);
 SQUIDCEXTERN void storeConfigure(void);
index a7819699904e40ab5c8a739173c8f70ea6fe686f..d32783ed3f1715afc6761a00dda4dacd243576cb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: asn.cc,v 1.105 2006/05/03 14:04:44 robertc Exp $
+ * $Id: asn.cc,v 1.106 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 53    AS Number handling
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -375,7 +375,7 @@ asStateFree(void *data)
     ASState *asState = (ASState *)data;
     debug(53, 3) ("asnStateFree: %s\n", storeUrl(asState->entry));
     storeUnregister(asState->sc, asState->entry, asState);
-    storeUnlockObject(asState->entry);
+    asState->entry->unlock();
     HTTPMSGUNLOCK(asState->request);
     cbdataFree(asState);
 }
index df5fab278ed517817e09b7944bb708f5fc6ba546..f4c6fc04692b6a19fa084b095c9d3a1af10bd47b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_manager.cc,v 1.40 2006/05/08 23:38:33 robertc Exp $
+ * $Id: cache_manager.cc,v 1.41 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 16    Cache Manager Objects
  * AUTHOR: Duane Wessels
@@ -238,7 +238,7 @@ cachemgrStateFree(cachemgrStateData * mgr)
     safe_free(mgr->action);
     safe_free(mgr->user_name);
     safe_free(mgr->passwd);
-    storeUnlockObject(mgr->entry);
+    mgr->entry->unlock();
     xfree(mgr);
 }
 
index 93b5074192b6afa7c26956c7dbd73c1423013a25..bcf5d1d47eb625b7f608cb1d651efd973857152d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_reply.cc,v 1.105 2006/05/08 23:38:33 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.106 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 88    Client-side Reply Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -136,7 +136,7 @@ clientReplyContext::removeStoreReference(store_client ** scp,
         *ep = NULL;
         storeUnregister(sc, e, this);
         *scp = NULL;
-        storeUnlockObject(e);
+        e->unlock();
     }
 }
 
index ecee9fc1ff668e2850a9f32d2515b5d82dc3fbd9..23d2c057a52cc2b7af390fe25cbc1484a2ad77f2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.66 2006/05/11 23:53:13 wessels Exp $
+ * $Id: client_side_request.cc,v 1.67 2006/05/19 17:05:18 wessels Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -1008,7 +1008,7 @@ void
 ClientHttpRequest::loggingEntry(StoreEntry *newEntry)
 {
     if (loggingEntry_)
-        storeUnlockObject(loggingEntry_);
+        loggingEntry_->unlock();
 
     loggingEntry_ = newEntry;
 
index 0d6dd16730082f8b29323d7a0df316e543105893..dee998d8ec0a0682d7a34eca22054395d4a381b1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.212 2006/05/08 23:38:33 robertc Exp $
+ * $Id: errorpage.cc,v 1.213 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -385,7 +385,7 @@ errorAppendEntry(StoreEntry * entry, ErrorState * err)
     entry->complete();
     storeNegativeCache(entry);
     storeReleaseRequest(entry);
-    storeUnlockObject(entry);
+    entry->unlock();
     errorStateFree(err);
 }
 
index 4c775e286cf1701a4c4948072355c83e07b2866f..12df4ed01384039a77080adba89892c939218a7f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.142 2006/05/08 23:38:33 robertc Exp $
+ * $Id: forward.cc,v 1.143 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -117,7 +117,7 @@ FwdState::~FwdState()
     if (err)
         errorStateFree(err);
 
-    storeUnlockObject(entry);
+    entry->unlock();
 
     entry = NULL;
 
index d9cefb289f2daee57c55333395398544e72904e2..3a890c3cbd4094ce809affa39c01ec9b76b9c94b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: gopher.cc,v 1.195 2006/05/08 23:38:33 robertc Exp $
+ * $Id: gopher.cc,v 1.196 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -127,7 +127,7 @@ gopherStateFree(int fdnotused, void *data)
         return;
 
     if (gopherState->entry) {
-        storeUnlockObject(gopherState->entry);
+        gopherState->entry->unlock();
     }
 
     HTTPMSGUNLOCK(gopherState->req);
index eba924c09b137787fff2cefc461a473eb1e758ee..01e1f655136cded51f053d1014e2a62fd425ccb8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mime.cc,v 1.126 2006/05/06 22:13:18 wessels Exp $
+ * $Id: mime.cc,v 1.127 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 25    MIME Parsing
  * AUTHOR: Harvest Derived
@@ -609,7 +609,7 @@ MimeIcon::created (StoreEntry *newEntry)
 
     debug(25, 3) ("Loaded icon %s\n", url);
 
-    storeUnlockObject(e);
+    e->unlock();
 
     memFree(buf, MEM_4K_BUF);
 }
index 88f1a1ef13ba774b238ebe315803aa0971d3b528..922a1d620c0461f9612340c37b83c026727b3883 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.335 2006/05/08 23:38:33 robertc Exp $
+ * $Id: neighbors.cc,v 1.336 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -1530,7 +1530,7 @@ peerCountMcastPeersDone(void *data)
     EBIT_SET(fake->flags, ENTRY_ABORTED);
     HTTPMSGUNLOCK(fake->mem_obj->request);
     storeReleaseRequest(fake);
-    storeUnlockObject(fake);
+    fake->unlock();
     HTTPMSGUNLOCK(psstate->request);
     cbdataFree(psstate);
 }
index 8b8dadcda60738d56df2d92f0303ef6dfc22fdab..752daf973a771881032327efb374b1ed4e75094b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: net_db.cc,v 1.187 2006/05/08 23:38:33 robertc Exp $
+ * $Id: net_db.cc,v 1.188 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 38    Network Measurement Database
  * AUTHOR: Duane Wessels
@@ -871,7 +871,7 @@ netdbExchangeDone(void *data)
     debug(38, 3) ("netdbExchangeDone: %s\n", storeUrl(ex->e));
     HTTPMSGUNLOCK(ex->r);
     storeUnregister(ex->sc, ex->e, ex);
-    storeUnlockObject(ex->e);
+    ex->e->unlock();
     cbdataReferenceDone(ex->p);
     cbdataFree(ex);
 }
index 452f65fbaf09c23a6d7c7a04238ce0b6d235cebe..dc0ce2ba8ae2ff9d32369f9bca10df99a93569f4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_digest.cc,v 1.113 2006/05/08 23:38:33 robertc Exp $
+ * $Id: peer_digest.cc,v 1.114 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 72    Peer Digest Routines
  * AUTHOR: Alex Rousskov
@@ -555,7 +555,7 @@ peerDigestFetchReply(void *data, char *buf, ssize_t size)
             /* get rid of 304 reply */
             storeUnregister(fetch->sc, fetch->entry, fetch);
 
-            storeUnlockObject(fetch->entry);
+            fetch->entry->unlock();
 
             fetch->entry = fetch->old_entry;
 
@@ -571,7 +571,7 @@ peerDigestFetchReply(void *data, char *buf, ssize_t size)
                 debug(72, 3) ("peerDigestFetchReply: got new digest, releasing old one\n");
                 storeUnregister(fetch->old_sc, fetch->old_entry, fetch);
                 storeReleaseRequest(fetch->old_entry);
-                storeUnlockObject(fetch->old_entry);
+                fetch->old_entry->unlock();
                 fetch->old_entry = NULL;
             }
         } else {
@@ -908,7 +908,7 @@ peerDigestFetchFinish(DigestFetchState * fetch, int err)
         debug(72, 2) ("peerDigestFetchFinish: deleting old entry\n");
         storeUnregister(fetch->old_sc, fetch->old_entry, fetch);
         storeReleaseRequest(fetch->old_entry);
-        storeUnlockObject(fetch->old_entry);
+        fetch->old_entry->unlock();
         fetch->old_entry = NULL;
     }
 
@@ -924,7 +924,7 @@ peerDigestFetchFinish(DigestFetchState * fetch, int err)
     /* unlock everything */
     storeUnregister(fetch->sc, fetch->entry, fetch);
 
-    storeUnlockObject(fetch->entry);
+    fetch->entry->unlock();
 
     HTTPMSGUNLOCK(fetch->request);
 
index d84345a97a6173b4815614ffcc8d821e0cdb615c..aee93190a1e19f911f8787dac9bec22b2cf1b3cc 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.138 2006/02/17 18:10:59 wessels Exp $
+ * $Id: peer_select.cc,v 1.139 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -114,7 +114,7 @@ peerSelectStateFree(ps_state * psstate)
 
     if (psstate->entry) {
         assert(psstate->entry->ping_status != PING_WAITING);
-        storeUnlockObject(psstate->entry);
+        psstate->entry->unlock();
         psstate->entry = NULL;
     }
 
index b24cb8f07dd907f3918ab804097ca5fab3b983e7..20208eeb47a3ca4fedbdd06dfb6325656ebfc7d3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_repl_heap.cc,v 1.18 2006/04/23 11:10:35 robertc Exp $
+ * $Id: store_repl_heap.cc,v 1.19 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section ?     HEAP based removal policies
  * AUTHOR: Henrik Nordstrom
@@ -266,7 +266,7 @@ heap_purgeDone(RemovalPurgeWalker * walker)
     while ((entry = (StoreEntry *)linklistShift(&heap_walker->locked_entries))) {
         heap_node *node = heap_insert(heap->theHeap, entry);
         heap->setPolicyNode(entry, node);
-        storeUnlockObject(entry);
+        entry->unlock();
     }
 
     safe_free(walker->_data);
index b12702469a4c55fd8f234636a87232977b315259..430e186ec9338cc4774522abafeeef7ac9618a7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stat.cc,v 1.392 2005/09/17 05:50:08 wessels Exp $
+ * $Id: stat.cc,v 1.393 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -346,11 +346,11 @@ statObjects(void *data)
 
     if (state->theSearch->isDone()) {
         state->sentry->complete();
-        storeUnlockObject(state->sentry);
+        state->sentry->unlock();
         cbdataFree(state);
         return;
     } else if (EBIT_TEST(state->sentry->flags, ENTRY_ABORTED)) {
-        storeUnlockObject(state->sentry);
+        state->sentry->unlock();
         cbdataFree(state);
         return;
     } else if (state->sentry->checkDeferRead(-1)) {
index 39ac8d520799755d9439fa59f073a9944d46f078..ed8b1a8b69290d1dcac41cf7d6e856578cfa6a30 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.589 2006/05/08 23:38:33 robertc Exp $
+ * $Id: store.cc,v 1.590 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -512,20 +512,13 @@ storeReleaseRequest(StoreEntry * e)
     storeSetPrivateKey(e);
 }
 
-/* DEPRECATED: please use e->unlock() */
-int
-storeUnlockObject(StoreEntry * e)
-{
-    return e->unlock();
-}
-
 /* unlock object, return -1 if object get released after unlock
  * otherwise lock_count */
 int
 StoreEntry::unlock()
 {
     lock_count--;
-    debug(20, 3) ("storeUnlockObject: key '%s' count=%d\n",
+    debug(20, 3) ("StoreEntry::unlock: key '%s' count=%d\n",
                   getMD5Text(), lock_count);
 
     if (lock_count)
@@ -764,7 +757,7 @@ storeSetPublicKey(StoreEntry * e)
             storeBufferFlush(pe);
             storeTimestampsSet(pe);
             pe->complete();
-            storeUnlockObject(pe);
+            pe->unlock();
         }
 
         newkey = storeKeyPublicByRequest(mem->request);
@@ -1186,7 +1179,7 @@ storeAbort(StoreEntry * e)
     /* Close any swapout file */
     storeSwapOutFileClose(e);
 
-    storeUnlockObject(e);       /* unlock */
+    e->unlock();       /* unlock */
 }
 
 /* Clear Memory storage to accommodate the given object len */
@@ -1309,7 +1302,7 @@ storeRelease(StoreEntry * e)
         if (e->swap_filen > -1) {
             /*
              * Fake a call to storeLockObject().  When rebuilding is done,
-             * we'll just call storeUnlockObject() on these.
+             * we'll just call e->unlock() on these.
              */
             e->lock_count++;
             e->setReleaseFlag();
@@ -1367,7 +1360,7 @@ storeLateRelease(void *unused)
             return;
         }
 
-        storeUnlockObject(e);
+        e->unlock();
         n++;
     }
 
index cb642b576364a8141ac438ba8b6d781d155e898d..1561c5aeb1bc73d1db97bc44838477e9a966329d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_digest.cc,v 1.65 2006/05/08 23:38:33 robertc Exp $
+ * $Id: store_digest.cc,v 1.66 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 71    Store Digest Manager
  * AUTHOR: Alex Rousskov
@@ -449,7 +449,7 @@ storeDigestRewriteFinish(StoreEntry * e)
                   (long int) e->expires, (int) (e->expires - squid_curtime));
     /* is this the write order? @?@ */
     e->mem_obj->unlinkRequest();
-    storeUnlockObject(e);
+    e->unlock();
     cbdataFree(sd_state.rewrite_lock);
     sd_state.rewrite_lock = NULL;
     sd_state.rewrite_count++;
index d52cc66bfb48887c8bca1872138984eb1f9048c1..bcf6fd7042a760857f6beab823cc53a57b292f2e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.101 2005/09/14 18:23:21 wessels Exp $
+ * $Id: store_swapout.cc,v 1.102 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -357,7 +357,7 @@ storeSwapOutFileClosed(void *data, int errflag, storeIOState * sio)
 
     debug(20, 3) ("storeSwapOutFileClosed: %s:%d\n", __FILE__, __LINE__);
     mem->swapout.sio = NULL;
-    storeUnlockObject(e);
+    e->unlock();
 }
 
 /*
index 6fe474ce6f7702ac07d8f3efe70fc6bf96a8fc3e..e691581294f8316254b3efe8dc4994885a2b25cf 100644 (file)
@@ -212,7 +212,7 @@ testCoss::testCossSearch()
         storeSwapOut(pe);
         CPPUNIT_ASSERT(pe->swap_dirn == 0);
         CPPUNIT_ASSERT(pe->swap_filen == 0);
-        storeUnlockObject(pe);
+        pe->unlock();
     }
 
     storeDirWriteCleanLogs(0);
index 74ca9f45322fe0257417eca4b002834e2395945a..6a073e13ed6282bf4a2b88c739bfbea845b22d37 100644 (file)
@@ -182,7 +182,7 @@ testNull::testNullSearch()
         storeSwapOut(pe);
         /* Null does not accept store entries */
         CPPUNIT_ASSERT(pe->swap_dirn == -1);
-        storeUnlockObject(pe);
+        pe->unlock();
     }
 
     storeDirWriteCleanLogs(0);
index 2e8c74789a5938371664c625c5cfe0a94800c928..e916ae5d9ee6b6a2de12159316f17be40955556a 100644 (file)
@@ -146,7 +146,7 @@ testUfs::testUfsSearch()
         storeSwapOut(pe);
         CPPUNIT_ASSERT(pe->swap_dirn == 0);
         CPPUNIT_ASSERT(pe->swap_filen == 0);
-        storeUnlockObject(pe);
+        pe->unlock();
     }
 
     storeDirWriteCleanLogs(0);
index 208af668ad295fd03410d79fa5154567044e6e77..4a3b6838660d1592f2df013dcd67f686db585e80 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: urn.cc,v 1.99 2006/05/08 23:38:33 robertc Exp $
+ * $Id: urn.cc,v 1.100 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 52    URN Parsing
  * AUTHOR: Kostas Anagnostakis
@@ -462,8 +462,8 @@ urnHandleReply(void *data, StoreIOBuffer result)
     storeUnregister(urnState->sc, urlres_e, urnState);
 
 error:
-    storeUnlockObject(urlres_e);
-    storeUnlockObject(urnState->entry);
+    urlres_e->unlock();
+    urnState->entry->unlock();
     HTTPMSGUNLOCK(urnState->request);
     HTTPMSGUNLOCK(urnState->urlres_r);
     delete urnState;
index 983ec22d39c8e180e4ec78e1b8ea12c395247331..2f5646836e52316b79b938a644a3757e0d8b4497 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.158 2006/05/08 23:38:33 robertc Exp $
+ * $Id: wais.cc,v 1.159 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -74,7 +74,7 @@ waisStateFree(int fdnotused, void *data)
     if (waisState == NULL)
         return;
 
-    storeUnlockObject(waisState->entry);
+    waisState->entry->unlock();
 
     HTTPMSGUNLOCK(waisState->request);
 
index c07017165aa41c71fee4bc68d3fc82d616b1a5ca..e8b0ddebd176a9008c1990f5439d9d858671505c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: whois.cc,v 1.33 2006/02/17 20:15:35 wessels Exp $
+ * $Id: whois.cc,v 1.34 2006/05/19 17:05:18 wessels Exp $
  *
  * DEBUG: section 75    WHOIS protocol
  * AUTHOR: Duane Wessels, Kostas Anagnostakis
@@ -196,6 +196,6 @@ whoisClose(int fd, void *data)
 {
     WhoisState *p = (WhoisState *)data;
     debug(75, 3) ("whoisClose: FD %d\n", fd);
-    storeUnlockObject(p->entry);
+    p->entry->unlock();
     cbdataFree(p);
 }