]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/KeyValueStore: only support bitwise sort
authorSage Weil <sage@redhat.com>
Mon, 13 Jul 2015 14:52:42 +0000 (10:52 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 14:16:00 +0000 (10:16 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/KeyValueStore.cc
src/os/KeyValueStore.h

index 4b3cf71579b05a516305d78f3c0885c2f0bac0ce..a72cbf2cb40362ce0da0c836fc3cfc8b1fdaefe8 100644 (file)
@@ -2444,7 +2444,7 @@ int KeyValueStore::_collection_remove_recursive(const coll_t &cid,
   vector<ghobject_t> objects;
   ghobject_t max;
   while (!max.is_max()) {
-    r = collection_list(cid, max, ghobject_t::get_max(), 300, &objects, &max);
+    r = collection_list(cid, max, ghobject_t::get_max(), true, 300, &objects, &max);
     if (r < 0)
       goto out;
 
@@ -2496,17 +2496,19 @@ bool KeyValueStore::collection_empty(coll_t c)
 }
 
 int KeyValueStore::collection_list(coll_t c, ghobject_t start,
-                                  ghobject_t end, int max,
+                                  ghobject_t end, bool sort_bitwise, int max,
                                   vector<ghobject_t> *ls, ghobject_t *next)
 {
-  if ( max < 0)
-      return -EINVAL;
+  if (!sort_bitwise)
+    return -EOPNOTSUPP;
+
+  if (max < 0)
+    return -EINVAL;
 
   if (start.is_max())
-      return 0;
+    return 0;
 
   int r = backend->list_objects(c, start, end, max, ls, next);
-
   return r;
 }
 
@@ -2789,7 +2791,7 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
     ghobject_t next, current;
     int move_size = 0;
     while (1) {
-      collection_list(cid, current, ghobject_t::get_max(),
+      collection_list(cid, current, ghobject_t::get_max(), true,
                      get_ideal_list_max(), &objects, &next);
 
       dout(20) << __func__ << cid << "objects size: " << objects.size()
@@ -2820,7 +2822,7 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
     vector<ghobject_t> objects;
     ghobject_t next;
     while (1) {
-      collection_list(cid, next, ghobject_t::get_max(),
+      collection_list(cid, next, ghobject_t::get_max(), true,
                      get_ideal_list_max(), &objects, &next);
       if (objects.empty())
         break;
@@ -2836,7 +2838,7 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem,
 
     next = ghobject_t();
     while (1) {
-      collection_list(dest, next, ghobject_t::get_max(),
+      collection_list(dest, next, ghobject_t::get_max(), true,
                      get_ideal_list_max(), &objects, &next);
       if (objects.empty())
         break;
index 7220cc35013cf1e585fbf0bad68cbb407a4ed578..ca4e09cd186da2c4255b6c507a9eafd72b0c679e 100644 (file)
@@ -619,7 +619,7 @@ class KeyValueStore : public ObjectStore,
   bool collection_exists(coll_t c);
   bool collection_empty(coll_t c);
   int collection_list(coll_t c, ghobject_t start, ghobject_t end,
-                     int max,
+                     bool sort_bitwise, int max,
                      vector<ghobject_t> *ls, ghobject_t *next);
   int collection_version_current(coll_t c, uint32_t *version);