]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Store Config.Store.avgObjectSize in bytes.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Wed, 27 Apr 2011 23:40:56 +0000 (03:40 +0400)
committerDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Wed, 27 Apr 2011 23:40:56 +0000 (03:40 +0400)
src/cf.data.pre
src/store_digest.cc
src/store_dir.cc

index ede2562c5d80b435dc9fe039a7aff5080dfb2271..baf71ef105526ab3fee7428a996b137c18994097 100644 (file)
@@ -4030,8 +4030,8 @@ DOC_START
 DOC_END
 
 NAME: store_avg_object_size
-COMMENT: (kbytes)
-TYPE: kb_int64_t
+COMMENT: (bytes)
+TYPE: b_int64_t
 DEFAULT: 13 KB
 LOC: Config.Store.avgObjectSize
 DOC_START
index 25cfda70c64633c0812c58ff20d3f4d4c98188a5..14649ab5f1c858fc2bc83cc459f1bfa99733ab85 100644 (file)
@@ -506,8 +506,8 @@ storeDigestCalcCap(void)
      * the bits are off). However, we do not have a formula to calculate the
      * number of _entries_ we want to pre-allocate for.
      */
-    const int hi_cap = (Store::Root().maxSize() >> 10) / Config.Store.avgObjectSize;
-    const int lo_cap = 1 + (Store::Root().currentSize() >> 10) / Config.Store.avgObjectSize;
+    const int hi_cap = Store::Root().maxSize() / Config.Store.avgObjectSize;
+    const int lo_cap = 1 + Store::Root().currentSize() / Config.Store.avgObjectSize;
     const int e_count = StoreEntry::inUseCount();
     int cap = e_count ? e_count :hi_cap;
     debugs(71, 2, "storeDigestCalcCap: have: " << e_count << ", want " << cap <<
index 833457e855a3f090fbb9491b3f309c64f6390384..dd4390491d851811df3f8abf02908f1a50503440 100644 (file)
@@ -871,7 +871,7 @@ StoreHashIndex::init()
     /* Calculate size of hash table (maximum currently 64k buckets).  */
     /* this is very bogus, its specific to the any Store maintaining an
      * in-core index, not global */
-    size_t buckets = ((Store::Root().maxSize() + Config.memMaxSize) >> 10) / Config.Store.avgObjectSize;
+    size_t buckets = (Store::Root().maxSize() + Config.memMaxSize) / Config.Store.avgObjectSize;
     debugs(20, 1, "Swap maxSize " << (Store::Root().maxSize() >> 10) <<
            " + " << ( Config.memMaxSize >> 10) << " KB, estimated " << buckets << " objects");
     buckets /= Config.Store.objectsPerBucket;