]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/repl/lru/store_repl_lru.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / repl / lru / store_repl_lru.cc
index 853eb58bc6c291419da23581426b802906776fe5..86e2c39fd244d1bfa40dca852fb059728f38a252 100644 (file)
@@ -1,7 +1,5 @@
 
 /*
- * $Id: store_repl_lru.cc,v 1.22 2007/04/25 11:30:19 adrian Exp $
- *
  * DEBUG: none          LRU Removal Policy
  * AUTHOR: Henrik Nordstrom
  *
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
  *  (at your option) any later version.
- *  
+ *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
- *  
+ *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
  */
 
 #include "squid.h"
-#include "Store.h"
 #include "MemObject.h"
 #include "SquidTime.h"
+#include "Store.h"
 
 REMOVALPOLICYCREATE createRemovalPolicy_lru;
 
-struct LruPolicyData
-{
+struct LruPolicyData {
     void setPolicyNode (StoreEntry *, void *) const;
     RemovalPolicy *policy;
     dlink_list list;
@@ -89,8 +86,7 @@ LruPolicyData::setPolicyNode (StoreEntry *entry, void *value) const
 
 typedef struct _LruNode LruNode;
 
-struct _LruNode
-{
+struct _LruNode {
     /* Note: the dlink_node MUST be the first member of the LruNode
      * structure. This member is later pointer typecasted to LruNode *.
      */
@@ -137,7 +133,7 @@ lru_remove(RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node)
 
     dlinkDelete(&lru_node->node, &lru->list);
 
-    lru_node_pool->free(lru_node);
+    lru_node_pool->freeOne(lru_node);
 
     lru->count -= 1;
 }
@@ -161,8 +157,7 @@ lru_referenced(RemovalPolicy * policy, const StoreEntry * entry,
 
 typedef struct _LruWalkData LruWalkData;
 
-struct _LruWalkData
-{
+struct _LruWalkData {
     LruNode *current;
 };
 
@@ -213,8 +208,7 @@ lru_walkInit(RemovalPolicy * policy)
 
 typedef struct _LruPurgeData LruPurgeData;
 
-struct _LruPurgeData
-{
+struct _LruPurgeData {
     LruNode *current;
     LruNode *start;
 };
@@ -248,12 +242,12 @@ try_again:
 
     if (entry->locked()) {
         /* Shit, it is locked. we can't return this one */
-        walker->locked++;
+        ++ walker->locked;
         dlinkAddTail(entry, &lru_node->node, &lru->list);
         goto try_again;
     }
 
-    lru_node_pool->free(lru_node);
+    lru_node_pool->freeOne(lru_node);
     lru->count -= 1;
     lru->setPolicyNode(entry, NULL);
     return entry;