Re: /bzr/squid3/trunk/ r11103: Bootstrapped

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Tue, 07 Dec 2010 12:35:05 -0700

On 12/06/2010 06:11 PM, Automatic source maintenance wrote:
> ------------------------------------------------------------
> revno: 11103
> committer: Automatic source maintenance<squidadm_at_squid-cache.org>
> branch nick: trunk
> timestamp: Mon 2010-12-06 18:11:16 -0700
> message:
> Bootstrapped
> modified:
> doc/release-notes/release-3.2.sgml
> src/SwapDir.cc
> src/SwapDir.h
> src/store_dir.cc

What kind of automated bootstrapping modifies release notes,
SwapDir::optionObjectSizeParse, and other code?

Should this commit be reverted?

Thank you,

Alex.

> === modified file 'src/SwapDir.cc'
> --- a/src/SwapDir.cc 2010-12-04 01:41:43 +0000
> +++ b/src/SwapDir.cc 2010-12-07 01:11:16 +0000
> @@ -159,7 +159,7 @@
> {
> ConfigOptionVector *result = new ConfigOptionVector;
> result->options.push_back(new ConfigOptionAdapter<SwapDir>(*const_cast<SwapDir *>(this), &SwapDir::optionReadOnlyParse, &SwapDir::optionReadOnlyDump));
> - result->options.push_back(new ConfigOptionAdapter<SwapDir>(*const_cast<SwapDir *>(this), &SwapDir::optionMaxSizeParse, &SwapDir::optionMaxSizeDump));
> + result->options.push_back(new ConfigOptionAdapter<SwapDir>(*const_cast<SwapDir *>(this), &SwapDir::optionObjectSizeParse, &SwapDir::optionObjectSizeDump));
> return result;
> }
>
> @@ -236,9 +236,14 @@
> }
>
> bool
> -SwapDir::optionMaxSizeParse(char const *option, const char *value, int isaReconfig)
> +SwapDir::optionObjectSizeParse(char const *option, const char *value, int isaReconfig)
> {
> - if (strcmp(option, "max-size") != 0)
> + int64_t *val;
> + if (strcmp(option, "max-size") == 0) {
> + val = &max_objsize;
> + } else if (strcmp(option, "min-size") == 0) {
> + val = &min_objsize;
> + } else
> return false;
>
> if (!value)
> @@ -246,17 +251,20 @@
>
> int64_t size = strtoll(value, NULL, 10);
>
> - if (isaReconfig && max_objsize != size)
> - debugs(3, 1, "Cache dir '" << path << "' max object size now " << size);
> + if (isaReconfig && *val != size)
> + debugs(3, 1, "Cache dir '" << path << "' object " << option << " now " << size);
>
> - max_objsize = size;
> + *val = size;
>
> return true;
> }
>
> void
> -SwapDir::optionMaxSizeDump(StoreEntry * e) const
> +SwapDir::optionObjectSizeDump(StoreEntry * e) const
> {
> + if (min_objsize != -1)
> + storeAppendPrintf(e, " min-size=%"PRId64, min_objsize);
> +
> if (max_objsize != -1)
> storeAppendPrintf(e, " max-size=%"PRId64, max_objsize);
> }
>
> === modified file 'src/SwapDir.h'
> --- a/src/SwapDir.h 2010-12-04 01:41:43 +0000
> +++ b/src/SwapDir.h 2010-12-07 01:11:16 +0000
> @@ -113,7 +113,7 @@
> {
>
> public:
> - SwapDir(char const *aType) : theType (aType), cur_size(0), max_size(0), max_objsize (-1), cleanLog(NULL) {
> + SwapDir(char const *aType) : theType (aType), cur_size(0), max_size(0), min_objsize(-1), max_objsize(-1), cleanLog(NULL) {
> fs.blksize = 1024;
> path = NULL;
> }
> @@ -148,8 +148,8 @@
> private:
> bool optionReadOnlyParse(char const *option, const char *value, int reconfiguring);
> void optionReadOnlyDump(StoreEntry * e) const;
> - bool optionMaxSizeParse(char const *option, const char *value, int reconfiguring);
> - void optionMaxSizeDump(StoreEntry * e) const;
> + bool optionObjectSizeParse(char const *option, const char *value, int reconfiguring);
> + void optionObjectSizeDump(StoreEntry * e) const;
> char const *theType;
>
> public:
> @@ -157,6 +157,7 @@
> uint64_t max_size; ///< maximum allocatable size of the storage area
> char *path;
> int index; /* This entry's index into the swapDirs array */
> + int64_t min_objsize;
> int64_t max_objsize;
> RemovalPolicy *repl;
> int removals;
>
> === modified file 'src/store_dir.cc'
> --- a/src/store_dir.cc 2010-12-04 01:41:43 +0000
> +++ b/src/store_dir.cc 2010-12-07 01:11:16 +0000
> @@ -146,35 +146,30 @@
> #endif
> }
>
> -/*
> +/**
> * Determine whether the given directory can handle this object
> * size
> *
> * Note: if the object size is -1, then the only swapdirs that
> - * will return true here are ones that have max_obj_size = -1,
> + * will return true here are ones that have min and max unset,
> * ie any-sized-object swapdirs. This is a good thing.
> */
> bool
> SwapDir::objectSizeIsAcceptable(int64_t objsize) const
> {
> - /*
> - * If the swapdir's max_obj_size is -1, then it definitely can
> - */
> -
> - if (max_objsize == -1)
> + // If the swapdir has no range limits, then it definitely can
> + if (min_objsize == -1 && max_objsize == -1)
> return true;
>
> /*
> - * If the object size is -1, then if the storedir isn't -1 we
> - * can't store it
> + * If the object size is -1 and the storedir has limits we
> + * can't store it there.
> */
> - if ((objsize == -1) && (max_objsize != -1))
> + if (objsize == -1)
> return false;
>
> - /*
> - * Else, make sure that the max object size is larger than objsize
> - */
> - return max_objsize > objsize;
> + // Else, make sure that the object size will fit.
> + return min_objsize <= objsize && max_objsize > objsize;
> }
>
>
>
Received on Tue Dec 07 2010 - 19:35:30 MST

This archive was generated by hypermail 2.2.0 : Wed Dec 08 2010 - 12:00:03 MST