]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: hermetize soft thresholds of RGWQuotaInfo.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 2 May 2016 13:23:43 +0000 (15:23 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 30 May 2016 09:33:51 +0000 (11:33 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_quota.h

index d95128841e7197f1b6514dc1a5cda5f782da9e32..43f22dfabb109a7c1af645071a8124f856e2eff3 100644 (file)
@@ -24,14 +24,27 @@ class RGWRados;
 class JSONObj;
 
 struct RGWQuotaInfo {
+  template<class T> friend class RGWQuotaCache;
+protected:
+  /* The quota thresholds after which comparing against cached storage stats
+   * is disallowed. Those fields may be accessed only by the RGWQuotaCache.
+   * They are not intended as tunables but rather as a mean to store results
+   * of repeating calculations in the quota cache subsystem. */
+  int64_t max_size_soft_threshold;
+  int64_t max_objs_soft_threshold;
+
+public:
   int64_t max_size_kb;
   int64_t max_objects;
   bool enabled;
-  int64_t max_size_soft_threshold;
-  int64_t max_objs_soft_threshold;
 
-  RGWQuotaInfo() : max_size_kb(-1), max_objects(-1), enabled(false),
-                   max_size_soft_threshold(-1), max_objs_soft_threshold(-1) {}
+  RGWQuotaInfo()
+    : max_size_soft_threshold(-1),
+      max_objs_soft_threshold(-1),
+      max_size_kb(-1),
+      max_objects(-1),
+      enabled(false) {
+  }
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);