]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG,PG: adapt collection_list* users to PGBackend interface
authorSamuel Just <sam.just@inktank.com>
Tue, 17 Sep 2013 17:12:11 +0000 (10:12 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 4 Oct 2013 20:50:09 +0000 (13:50 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/ReplicatedPG.cc

index f21bb66f0e4de543837e7b3402f2d24185897d0a..e962ff6462714a0b225efec5f315176137085c17 100644 (file)
@@ -1996,8 +1996,7 @@ void PG::upgrade(ObjectStore *store, const interval_set<snapid_t> &snapcolls)
       hobject_t cur;
       vector<hobject_t> objects;
       while (1) {
-       int r = store->collection_list_partial(
-         cid,
+       int r = get_pgbackend()->objects_list_partial(
          cur,
          store->get_ideal_list_min(),
          store->get_ideal_list_max(),
@@ -2045,8 +2044,7 @@ void PG::upgrade(ObjectStore *store, const interval_set<snapid_t> &snapcolls)
   while (1) {
     dout(1) << "Updating snap_mapper from main collection, "
            << done << " objects done" << dendl;
-    int r = store->collection_list_partial(
-      cid,
+    int r = get_pgbackend()->objects_list_partial(
       cur,
       store->get_ideal_list_min(),
       store->get_ideal_list_max(),
@@ -3038,9 +3036,9 @@ int PG::build_scrub_map_chunk(
 
   // objects
   vector<hobject_t> ls;
-  int ret = osd->store->collection_list_range(coll, start, end, 0, &ls);
+  int ret = get_pgbackend()->objects_list_range(start, end, 0, &ls);
   if (ret < 0) {
-    dout(5) << "collection_list_range error: " << ret << dendl;
+    dout(5) << "objects_list_range error: " << ret << dendl;
     return ret;
   }
 
@@ -3560,11 +3558,13 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
           hobject_t start = scrubber.start;
           while (!boundary_found) {
             vector<hobject_t> objects;
-            ret = osd->store->collection_list_partial(coll, start,
-                                                      cct->_conf->osd_scrub_chunk_min,
-                                                     cct->_conf->osd_scrub_chunk_max,
-                                                     0,
-                                                      &objects, &scrubber.end);
+            ret = get_pgbackend()->objects_list_partial(
+             start,
+             cct->_conf->osd_scrub_chunk_min,
+             cct->_conf->osd_scrub_chunk_max,
+             0,
+             &objects,
+             &scrubber.end);
             assert(ret >= 0);
 
             // in case we don't find a boundary: start again at the end
index cc156a16e972c62d7be814aee592106f2cf2912c..646b01c47c7a8e30e16ff632e073fe39c3c19f41 100644 (file)
@@ -639,12 +639,13 @@ void ReplicatedPG::do_pg_op(OpRequestRef op)
        hobject_t next;
        hobject_t current = response.handle;
        osr->flush();
-       int r = osd->store->collection_list_partial(coll, current,
-                                                   list_size,
-                                                   list_size,
-                                                   snapid,
-                                                   &sentries,
-                                                   &next);
+       int r = pgbackend->objects_list_partial(
+         current,
+         list_size,
+         list_size,
+         snapid,
+         &sentries,
+         &next);
        if (r != 0) {
          result = -EINVAL;
          break;
@@ -8209,8 +8210,7 @@ void ReplicatedPG::scan_range(
 
   vector<hobject_t> ls;
   ls.reserve(max);
-  int r = osd->store->collection_list_partial(coll, bi->begin, min, max,
-                                             0, &ls, &bi->end);
+  int r = pgbackend->objects_list_partial(bi->begin, min, max, 0, &ls, &bi->end);
   assert(r >= 0);
   dout(10) << " got " << ls.size() << " items, next " << bi->end << dendl;
   dout(20) << ls << dendl;
@@ -8225,7 +8225,7 @@ void ReplicatedPG::scan_range(
       dout(20) << "  " << *p << " " << obc->obs.oi.version << dendl;
     } else {
       bufferlist bl;
-      int r = osd->store->getattr(coll, *p, OI_ATTR, bl);
+      int r = pgbackend->objects_get_attr(*p, OI_ATTR, &bl);
       assert(r >= 0);
       object_info_t oi(bl);
       bi->objects[*p] = oi.version;