From 9795cea19c7ef6b94a1e001b89c757269deeafda Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 28 Nov 2016 14:21:27 -0500 Subject: [PATCH] os/ObjectStore: pass by ref to collection_list Signed-off-by: Sage Weil --- src/os/ObjectStore.h | 5 +++-- src/os/bluestore/BlueStore.cc | 4 ++-- src/os/bluestore/BlueStore.h | 8 ++++++-- src/os/filestore/FileStore.cc | 5 ++++- src/os/filestore/FileStore.h | 3 ++- src/os/kstore/KStore.cc | 6 +++--- src/os/kstore/KStore.h | 17 ++++++++++------- src/os/memstore/MemStore.cc | 4 +++- src/os/memstore/MemStore.h | 3 ++- 9 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 51a90950bae6c..87cc5aca3d5ea 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1829,11 +1829,12 @@ public: * @param next [out] next item sorts >= this value * @return zero on success, or negative error */ - virtual int collection_list(const coll_t& c, ghobject_t start, ghobject_t end, + virtual int collection_list(const coll_t& c, + const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next) = 0; virtual int collection_list(CollectionHandle &c, - ghobject_t start, ghobject_t end, + const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next) { return collection_list(c->get_cid(), start, end, sort_bitwise, max, ls, next); diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 57ec5df150135..5a6998a122f15 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5486,7 +5486,7 @@ int BlueStore::collection_bits(const coll_t& cid) } int BlueStore::collection_list( - const coll_t& cid, ghobject_t start, ghobject_t end, + const coll_t& cid, const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *pnext) { @@ -5497,7 +5497,7 @@ int BlueStore::collection_list( } int BlueStore::collection_list( - CollectionHandle &c_, ghobject_t start, ghobject_t end, + CollectionHandle &c_, const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *pnext) { diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 77dd98a66b6c1..bfac18f44bd31 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -1817,10 +1817,14 @@ public: int collection_empty(const coll_t& c, bool *empty) override; int collection_bits(const coll_t& c) override; - int collection_list(const coll_t& cid, ghobject_t start, ghobject_t end, + int collection_list(const coll_t& cid, + const ghobject_t& start, + const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next) override; - int collection_list(CollectionHandle &c, ghobject_t start, ghobject_t end, + int collection_list(CollectionHandle &c, + const ghobject_t& start, + const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next) override; diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 5be2c2c302626..d54634617dae4 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -4739,10 +4739,13 @@ int FileStore::collection_empty(const coll_t& c, bool *empty) tracepoint(objectstore, collection_empty_exit, *empty); return 0; } -int FileStore::collection_list(const coll_t& c, ghobject_t start, ghobject_t end, +int FileStore::collection_list(const coll_t& c, + const ghobject_t& orig_start, + const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next) { + ghobject_t start = orig_start; if (start.is_max()) return 0; diff --git a/src/os/filestore/FileStore.h b/src/os/filestore/FileStore.h index 9b88c28fbe955..300d6fd49136e 100644 --- a/src/os/filestore/FileStore.h +++ b/src/os/filestore/FileStore.h @@ -648,7 +648,8 @@ public: // collections using ObjectStore::collection_list; - int collection_list(const coll_t& c, ghobject_t start, ghobject_t end, + int collection_list(const coll_t& c, + const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next); int list_collections(vector& ls); diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index 57d2c20173537..625e4c0cd36d4 100755 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -1402,7 +1402,7 @@ int KStore::collection_empty(const coll_t& cid, bool *empty) } int KStore::collection_list( - const coll_t& cid, ghobject_t start, ghobject_t end, + const coll_t& cid, const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *pnext) { @@ -1413,7 +1413,7 @@ int KStore::collection_list( } int KStore::collection_list( - CollectionHandle &c_, ghobject_t start, ghobject_t end, + CollectionHandle &c_, const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *pnext) @@ -1435,7 +1435,7 @@ int KStore::collection_list( } int KStore::_collection_list( - Collection* c, ghobject_t start, ghobject_t end, + Collection* c, const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *pnext) { diff --git a/src/os/kstore/KStore.h b/src/os/kstore/KStore.h index aff25b70aa0a8..dac579d302ff2 100644 --- a/src/os/kstore/KStore.h +++ b/src/os/kstore/KStore.h @@ -393,7 +393,8 @@ private: uint64_t offset, bufferlist& bl); void _do_remove_stripe(TransContext *txc, OnodeRef o, uint64_t offset); - int _collection_list(Collection *c, ghobject_t start, ghobject_t end, + int _collection_list( + Collection *c, const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next); public: @@ -471,12 +472,14 @@ public: bool collection_exists(const coll_t& c); int collection_empty(const coll_t& c, bool *empty); - int collection_list(const coll_t& cid, ghobject_t start, ghobject_t end, - bool sort_bitwise, int max, - vector *ls, ghobject_t *next) override; - int collection_list(CollectionHandle &c, ghobject_t start, ghobject_t end, - bool sort_bitwise, int max, - vector *ls, ghobject_t *next) override; + int collection_list( + const coll_t& cid, const ghobject_t& start, const ghobject_t& end, + bool sort_bitwise, int max, + vector *ls, ghobject_t *next) override; + int collection_list( + CollectionHandle &c, const ghobject_t& start, const ghobject_t& end, + bool sort_bitwise, int max, + vector *ls, ghobject_t *next) override; using ObjectStore::omap_get; int omap_get( diff --git a/src/os/memstore/MemStore.cc b/src/os/memstore/MemStore.cc index c5f57eb327d76..fd1c1f2ceb359 100644 --- a/src/os/memstore/MemStore.cc +++ b/src/os/memstore/MemStore.cc @@ -459,7 +459,9 @@ int MemStore::collection_empty(const coll_t& cid, bool *empty) return 0; } -int MemStore::collection_list(const coll_t& cid, ghobject_t start, ghobject_t end, +int MemStore::collection_list(const coll_t& cid, + const ghobject_t& start, + const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next) { diff --git a/src/os/memstore/MemStore.h b/src/os/memstore/MemStore.h index d11ea35486512..5401c9e9d4bdd 100644 --- a/src/os/memstore/MemStore.h +++ b/src/os/memstore/MemStore.h @@ -326,7 +326,8 @@ public: bool collection_exists(const coll_t& c) override; int collection_empty(const coll_t& c, bool *empty) override; using ObjectStore::collection_list; - int collection_list(const coll_t& cid, ghobject_t start, ghobject_t end, + int collection_list(const coll_t& cid, + const ghobject_t& start, const ghobject_t& end, bool sort_bitwise, int max, vector *ls, ghobject_t *next) override; -- 2.39.5