]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: gc aio, replace lists with other types
authorYehuda Sadeh <yehuda@redhat.com>
Fri, 23 Feb 2018 16:43:16 +0000 (08:43 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 23 Feb 2018 16:43:16 +0000 (08:43 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_gc.cc

index 77fc70949b9c77d6dacd1b90ff3353ab37602b29..19d5b3ae9e0847199566dd48509c5d97ddd7b6a5 100644 (file)
@@ -143,15 +143,16 @@ class RGWGCIOManager {
     string tag;
   };
 
-  list<IO> ios;
-  map<int, std::list<string> > remove_tags;
+  deque<IO> ios;
+  vector<std::list<string> > remove_tags;
 
 #define MAX_AIO_DEFAULT 10
   size_t max_aio{MAX_AIO_DEFAULT};
 
 public:
   RGWGCIOManager(CephContext *_cct, RGWGC *_gc) : cct(_cct),
-                                                  gc(_gc) {
+                                                  gc(_gc),
+                                                  remove_tags(cct->_conf->rgw_gc_max_objs) {
     max_aio = cct->_conf->rgw_gc_max_concurrent_io;
   }
   ~RGWGCIOManager() {
@@ -245,8 +246,10 @@ done:
   }
 
   void flush_remove_tags() {
-    for (auto iter : remove_tags) {
-      flush_remove_tags(iter.first, iter.second);
+    int index = 0;
+    for (auto& rt : remove_tags) {
+      flush_remove_tags(index, rt);
+      ++index;
     }
   }
 };