From: Amos Jeffries Date: Tue, 7 Dec 2010 09:14:33 +0000 (-0700) Subject: Polish on cache_dir min-size port X-Git-Tag: take1~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6662ffd4c1a3ee476c347308f434f4a1ddafa16;p=thirdparty%2Fsquid.git Polish on cache_dir min-size port --- diff --git a/src/SwapDir.cc b/src/SwapDir.cc index 49071206ee..b08f157b63 100644 --- a/src/SwapDir.cc +++ b/src/SwapDir.cc @@ -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) diff --git a/src/SwapDir.h b/src/SwapDir.h index 340ed30c54..534106bbfa 100644 --- a/src/SwapDir.h +++ b/src/SwapDir.h @@ -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; } diff --git a/src/cf.data.pre b/src/cf.data.pre index 12a48ea7ce..3aaa0b68ae 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 diff --git a/src/store_dir.cc b/src/store_dir.cc index cacf8fa1d0..ce7523e229 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -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; /*