From: wessels <> Date: Fri, 19 May 2006 23:05:18 +0000 (+0000) Subject: Fully deprecated storeUnlockObject(). Now everything directly uses X-Git-Tag: SQUID_3_0_PRE4~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97b5e68f6f6a7090e841289814027099a80e4e34;p=thirdparty%2Fsquid.git Fully deprecated storeUnlockObject(). Now everything directly uses the StoreEntry unlock() method. --- diff --git a/src/Server.cc b/src/Server.cc index b055066b83..a8e571bbb5 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -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); diff --git a/src/Store.h b/src/Store.h index 8fbf1f015a..d13aea3132 100644 --- a/src/Store.h +++ b/src/Store.h @@ -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); diff --git a/src/asn.cc b/src/asn.cc index a781969990..d32783ed3f 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -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); } diff --git a/src/cache_manager.cc b/src/cache_manager.cc index df5fab278e..f4c6fc0469 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -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); } diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 93b5074192..bcf5d1d47e 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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(); } } diff --git a/src/client_side_request.cc b/src/client_side_request.cc index ecee9fc1ff..23d2c057a5 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -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; diff --git a/src/errorpage.cc b/src/errorpage.cc index 0d6dd16730..dee998d8ec 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -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); } diff --git a/src/forward.cc b/src/forward.cc index 4c775e286c..12df4ed013 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -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; diff --git a/src/gopher.cc b/src/gopher.cc index d9cefb289f..3a890c3cbd 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -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); diff --git a/src/mime.cc b/src/mime.cc index eba924c09b..01e1f65513 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -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); } diff --git a/src/neighbors.cc b/src/neighbors.cc index 88f1a1ef13..922a1d620c 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -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); } diff --git a/src/net_db.cc b/src/net_db.cc index 8b8dadcda6..752daf973a 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -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); } diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 452f65fbaf..dc0ce2ba8a 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -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); diff --git a/src/peer_select.cc b/src/peer_select.cc index d84345a97a..aee93190a1 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -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; } diff --git a/src/repl/heap/store_repl_heap.cc b/src/repl/heap/store_repl_heap.cc index b24cb8f07d..20208eeb47 100644 --- a/src/repl/heap/store_repl_heap.cc +++ b/src/repl/heap/store_repl_heap.cc @@ -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); diff --git a/src/stat.cc b/src/stat.cc index b12702469a..430e186ec9 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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)) { diff --git a/src/store.cc b/src/store.cc index 39ac8d5207..ed8b1a8b69 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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++; } diff --git a/src/store_digest.cc b/src/store_digest.cc index cb642b5763..1561c5aeb1 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -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++; diff --git a/src/store_swapout.cc b/src/store_swapout.cc index d52cc66bfb..bcf6fd7042 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -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(); } /* diff --git a/src/tests/testCoss.cc b/src/tests/testCoss.cc index 6fe474ce6f..e691581294 100644 --- a/src/tests/testCoss.cc +++ b/src/tests/testCoss.cc @@ -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); diff --git a/src/tests/testNull.cc b/src/tests/testNull.cc index 74ca9f4532..6a073e13ed 100644 --- a/src/tests/testNull.cc +++ b/src/tests/testNull.cc @@ -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); diff --git a/src/tests/testUfs.cc b/src/tests/testUfs.cc index 2e8c74789a..e916ae5d9e 100644 --- a/src/tests/testUfs.cc +++ b/src/tests/testUfs.cc @@ -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); diff --git a/src/urn.cc b/src/urn.cc index 208af668ad..4a3b683866 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -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; diff --git a/src/wais.cc b/src/wais.cc index 983ec22d39..2f5646836e 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -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); diff --git a/src/whois.cc b/src/whois.cc index c07017165a..e8b0ddebd1 100644 --- a/src/whois.cc +++ b/src/whois.cc @@ -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); }