]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish on cache_dir min-size port
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 7 Dec 2010 09:14:33 +0000 (02:14 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 7 Dec 2010 09:14:33 +0000 (02:14 -0700)
src/SwapDir.cc
src/SwapDir.h
src/cf.data.pre
src/store_dir.cc

index 49071206eedd19b8535bdc26755a678c99374220..b08f157b63decdb2fac0a3c784a7c3e35fc7be70 100644 (file)
@@ -262,7 +262,7 @@ SwapDir::optionObjectSizeParse(char const *option, const char *value, int isaRec
 void
 SwapDir::optionObjectSizeDump(StoreEntry * e) const
 {
-    if (min_objsize != -1)
+    if (min_objsize != 0)
         storeAppendPrintf(e, " min-size=%"PRId64, min_objsize);
 
     if (max_objsize != -1)
index 340ed30c548beb25a9925e345c7469ab0848f3bf..534106bbfa397dce7e1ab23feffd88807280e04a 100644 (file)
@@ -113,7 +113,7 @@ class SwapDir : public Store
 {
 
 public:
-    SwapDir(char const *aType) : theType (aType), cur_size(0), max_size(0), min_objsize(-1), max_objsize(-1), cleanLog(NULL) {
+    SwapDir(char const *aType) : theType (aType), cur_size(0), max_size(0), min_objsize(0), max_objsize(-1), cleanLog(NULL) {
         fs.blksize = 1024;
         path = NULL;
     }
index 12a48ea7ceac7c2838da46433491d7c97c048d4a..3aaa0b68ae2aa10a7f5464f8693dcb371f1323f8 100644 (file)
@@ -2714,6 +2714,11 @@ DOC_START
 
        no-store, no new objects should be stored to this cache_dir
 
+       min-size=n, refers to the min object size in bytes this cache_dir
+       will accept.  It's used to restrict a cache_dir to only store
+       large objects (e.g. aufs) while other storedirs are optimized
+       for smaller objects (e.g. COSS). Defaults to 0.
+
        max-size=n, refers to the max object size in bytes this cache_dir
        supports.  It is used to select the cache_dir to store the object.
        Note: To make optimal use of the max-size limits you should order
index cacf8fa1d0d87eaea05938f5451afac411c2c321..ce7523e22951a8654770342ee77e6f4c2af46436 100644 (file)
@@ -158,7 +158,7 @@ bool
 SwapDir::objectSizeIsAcceptable(int64_t objsize) const
 {
     // If the swapdir has no range limits, then it definitely can
-    if (min_objsize == -1 && max_objsize == -1)
+    if (min_objsize <= 0 && max_objsize == -1)
         return true;
 
     /*