]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/PrioritizedQueue: buckets -> tokens
authorSage Weil <sage@inktank.com>
Mon, 21 Jan 2013 22:52:54 +0000 (14:52 -0800)
committerSage Weil <sage@inktank.com>
Tue, 22 Jan 2013 22:47:41 +0000 (14:47 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
src/common/PrioritizedQueue.h

index 9c27ddc3860ab6c2191470b3f69b2916d9d1a405..6ada06601246bbf8e9aee3df09fbd3d0f8a90060 100644 (file)
@@ -76,22 +76,22 @@ class PrioritizedQueue {
   struct SubQueue {
   private:
     map<K, list<pair<unsigned, T> > > q;
-    unsigned bucket;
+    unsigned tokens;
     int64_t size;
     typename map<K, list<pair<unsigned, T> > >::iterator cur;
   public:
     SubQueue(const SubQueue &other)
-      : q(other.q), bucket(other.bucket), size(other.size),
+      : q(other.q), tokens(other.tokens), size(other.size),
        cur(q.begin()) {}
-    SubQueue() : bucket(0), size(0), cur(q.begin()) {}
+    SubQueue() : tokens(0), size(0), cur(q.begin()) {}
     unsigned num_tokens() const {
-      return bucket;
+      return tokens;
     }
-    void put_tokens(unsigned tokens) {
-      bucket += tokens;
+    void put_tokens(unsigned t) {
+      tokens += t;
     }
-    void take_tokens(unsigned tokens) {
-      bucket -= tokens;
+    void take_tokens(unsigned t) {
+       tokens -= t;
     }
     void enqueue(K cl, unsigned cost, T item) {
       q[cl].push_back(make_pair(cost, item));