From: Sage Weil Date: Mon, 13 Jul 2015 14:52:42 +0000 (-0400) Subject: os/KeyValueStore: only support bitwise sort X-Git-Tag: v9.1.0~346^2~59 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7d627398d141b064a0f6cce437bd9db576e64704;p=ceph.git os/KeyValueStore: only support bitwise sort Signed-off-by: Sage Weil --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 4b3cf71579b0..a72cbf2cb403 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -2444,7 +2444,7 @@ int KeyValueStore::_collection_remove_recursive(const coll_t &cid, vector 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 *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 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; diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index 7220cc35013c..ca4e09cd186d 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -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 *ls, ghobject_t *next); int collection_version_current(coll_t c, uint32_t *version);