From: Sage Weil Date: Wed, 29 Apr 2015 23:33:42 +0000 (-0700) Subject: s/collection_list_impl/collection_list/ X-Git-Tag: v9.1.0~421^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e46a855e5f297d1aba401a3a91103a5a0945bf2a;p=ceph.git s/collection_list_impl/collection_list/ Signed-off-by: Sage Weil --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 0e0abe0e724a..6a85cd90cc35 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -4484,7 +4484,7 @@ int FileStore::_collection_remove_recursive(const coll_t &cid, vector objects; ghobject_t max; while (!max.is_max()) { - r = collection_list_impl(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max); + r = collection_list(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max); if (r < 0) return r; for (vector::iterator i = objects.begin(); @@ -4640,8 +4640,8 @@ bool FileStore::collection_empty(coll_t c) tracepoint(objectstore, collection_empty_exit, ret); return ret; } -int FileStore::collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, int max, - snapid_t seq, vector *ls, ghobject_t *next) +int FileStore::collection_list(coll_t c, ghobject_t start, ghobject_t end, int max, + snapid_t seq, vector *ls, ghobject_t *next) { if (start.is_max()) return 0; @@ -4680,7 +4680,7 @@ int FileStore::collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, if (start < sep) { dout(10) << __func__ << " first checking temp pool" << dendl; coll_t temp = c.get_temp(); - int r = collection_list_impl(temp, start, end, max, seq, ls, next); + int r = collection_list(temp, start, end, max, seq, ls, next); if (r < 0) return r; if (*next != ghobject_t::get_max()) @@ -5299,7 +5299,7 @@ int FileStore::_split_collection(coll_t cid, vector objects; ghobject_t next; while (1) { - collection_list_impl( + collection_list( cid, next, ghobject_t::get_max(), get_ideal_list_max(), 0, @@ -5318,7 +5318,7 @@ int FileStore::_split_collection(coll_t cid, } next = ghobject_t(); while (1) { - collection_list_impl( + collection_list( dest, next, ghobject_t::get_max(), get_ideal_list_max(), 0, diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 5f5e8ab69b83..7f0bbdb09ce2 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -617,7 +617,7 @@ public: const SequencerPosition &spos); // collections - int collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, int max, + int collection_list(coll_t c, ghobject_t start, ghobject_t end, int max, snapid_t seq, vector *ls, ghobject_t *next); int list_collections(vector& ls); int list_collections(vector& ls, bool include_temp); diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index b69833aaf8e0..e943c192a028 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_impl(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max); + r = collection_list(cid, max, ghobject_t::get_max(), 300, 0, &objects, &max); if (r < 0) goto out; @@ -2495,9 +2495,9 @@ bool KeyValueStore::collection_empty(coll_t c) return oids.empty(); } -int KeyValueStore::collection_list_impl(coll_t c, ghobject_t start, - ghobject_t end, int max, snapid_t seq, - vector *ls, ghobject_t *next) +int KeyValueStore::collection_list(coll_t c, ghobject_t start, + ghobject_t end, int max, snapid_t seq, + vector *ls, ghobject_t *next) { if ( max < 0) return -EINVAL; @@ -2789,8 +2789,8 @@ 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_impl(cid, current, ghobject_t::get_max(), - get_ideal_list_max(), 0, &objects, &next); + collection_list(cid, current, ghobject_t::get_max(), + get_ideal_list_max(), 0, &objects, &next); dout(20) << __func__ << cid << "objects size: " << objects.size() << dendl; @@ -2820,8 +2820,8 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem, vector objects; ghobject_t next; while (1) { - collection_list_impl(cid, next, ghobject_t::get_max(), - get_ideal_list_max(), 0, &objects, &next); + collection_list(cid, next, ghobject_t::get_max(), + get_ideal_list_max(), 0, &objects, &next); if (objects.empty()) break; @@ -2836,8 +2836,8 @@ int KeyValueStore::_split_collection(coll_t cid, uint32_t bits, uint32_t rem, next = ghobject_t(); while (1) { - collection_list_impl(dest, next, ghobject_t::get_max(), - get_ideal_list_max(), 0, &objects, &next); + collection_list(dest, next, ghobject_t::get_max(), + get_ideal_list_max(), 0, &objects, &next); if (objects.empty()) break; diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index 51078b63e0ba..de72c55083a8 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -618,9 +618,9 @@ class KeyValueStore : public ObjectStore, int list_collections(vector& ls); bool collection_exists(coll_t c); bool collection_empty(coll_t c); - int collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, - int max, snapid_t snap, - vector *ls, ghobject_t *next); + int collection_list(coll_t c, ghobject_t start, ghobject_t end, + int max, snapid_t snap, + vector *ls, ghobject_t *next); int collection_version_current(coll_t c, uint32_t *version); // omap (see ObjectStore.h for documentation) diff --git a/src/os/MemStore.cc b/src/os/MemStore.cc index 8b4b01d117db..8bfd0e80219f 100644 --- a/src/os/MemStore.cc +++ b/src/os/MemStore.cc @@ -421,9 +421,9 @@ bool MemStore::collection_empty(coll_t cid) return c->object_map.empty(); } -int MemStore::collection_list_impl(coll_t cid, ghobject_t start, ghobject_t end, - int max, snapid_t snap, - vector *ls, ghobject_t *next) +int MemStore::collection_list(coll_t cid, ghobject_t start, ghobject_t end, + int max, snapid_t snap, + vector *ls, ghobject_t *next) { CollectionRef c = get_collection(cid); if (!c) diff --git a/src/os/MemStore.h b/src/os/MemStore.h index 63e30b2f90c5..278396966831 100644 --- a/src/os/MemStore.h +++ b/src/os/MemStore.h @@ -306,9 +306,9 @@ public: int list_collections(vector& ls); bool collection_exists(coll_t c); bool collection_empty(coll_t c); - int collection_list_impl(coll_t cid, ghobject_t start, ghobject_t end, - int max, snapid_t snap, - vector *ls, ghobject_t *next); + int collection_list(coll_t cid, ghobject_t start, ghobject_t end, + int max, snapid_t snap, + vector *ls, ghobject_t *next); int omap_get( coll_t cid, ///< [in] Collection containing oid diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 441ba537feae..6da0e3a4ea7d 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -2040,8 +2040,8 @@ public: * @param next [out] next item sorts >= this value * @return zero on success, or negative error */ - virtual int collection_list_impl(coll_t c, ghobject_t start, ghobject_t end, int max, - snapid_t seq, vector *ls, ghobject_t *next) = 0; + virtual int collection_list(coll_t c, ghobject_t start, ghobject_t end, int max, + snapid_t seq, vector *ls, ghobject_t *next) = 0; /// OMAP /// Get omap contents diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 3334593a552c..787eb4d08213 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2506,9 +2506,9 @@ void OSD::clear_temp_objects() ghobject_t next; while (1) { vector objects; - store->collection_list_impl(*p, next, ghobject_t::get_max(), - store->get_ideal_list_max(), - 0, &objects, &next); + store->collection_list(*p, next, ghobject_t::get_max(), + store->get_ideal_list_max(), + 0, &objects, &next); if (objects.empty()) break; vector::iterator q; @@ -2546,7 +2546,7 @@ void OSD::recursive_remove_collection(ObjectStore *store, spg_t pgid, coll_t tmp SnapMapper mapper(&driver, 0, 0, 0, pgid.shard); vector objects; - store->collection_list_impl(tmp, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + store->collection_list(tmp, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); // delete them. unsigned removed = 0; @@ -4226,7 +4226,7 @@ bool remove_dir( ObjectStore::Transaction *t = new ObjectStore::Transaction; ghobject_t next; handle.reset_tp_timeout(); - store->collection_list_impl( + store->collection_list( coll, next, ghobject_t::get_max(), diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 4807a732deba..2937a988acfe 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -113,7 +113,7 @@ int PGBackend::objects_list_partial( int r = 0; while (!_next.is_max() && ls->size() < (unsigned)min) { vector objects; - int r = store->collection_list_impl( + int r = store->collection_list( coll, _next, ghobject_t::get_max(), @@ -148,7 +148,7 @@ int PGBackend::objects_list_range( { assert(ls); vector objects; - int r = store->collection_list_impl( + int r = store->collection_list( coll, ghobject_t(start, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), ghobject_t(end, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), diff --git a/src/test/objectstore/FileStoreDiff.cc b/src/test/objectstore/FileStoreDiff.cc index a40437a522e8..af56806b7e9d 100644 --- a/src/test/objectstore/FileStoreDiff.cc +++ b/src/test/objectstore/FileStoreDiff.cc @@ -132,13 +132,13 @@ bool FileStoreDiff::diff_objects(FileStore *a_store, FileStore *b_store, coll_t int err; std::vector b_objects, a_objects; - err = b_store->collection_list_impl(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &b_objects, NULL); + err = b_store->collection_list(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &b_objects, NULL); if (err < 0) { dout(0) << "diff_objects list on verify coll " << coll.to_str() << " returns " << err << dendl; return true; } - err = a_store->collection_list_impl(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &a_objects, NULL); + err = a_store->collection_list(coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &a_objects, NULL); if (err < 0) { dout(0) << "diff_objects list on store coll " << coll.to_str() << " returns " << err << dendl; diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index fdf64b8164ed..8d3696da346a 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -282,8 +282,8 @@ TEST_P(StoreTest, SimpleListTest) { vector objects; ghobject_t next, current; while (!next.is_max()) { - int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 50, - 0, &objects, &next); + int r = store->collection_list(cid, current, ghobject_t::get_max(), 50, + 0, &objects, &next); ASSERT_EQ(r, 0); cout << " got " << objects.size() << " next " << next << std::endl; for (vector::iterator p = objects.begin(); p != objects.end(); @@ -366,8 +366,8 @@ TEST_P(StoreTest, MultipoolListTest) { vector objects; ghobject_t next, current; while (!next.is_max()) { - int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 50, - 0, &objects, &next); + int r = store->collection_list(cid, current, ghobject_t::get_max(), 50, + 0, &objects, &next); ASSERT_EQ(r, 0); cout << " got " << objects.size() << " next " << next << std::endl; for (vector::iterator p = objects.begin(); p != objects.end(); @@ -585,7 +585,7 @@ TEST_P(StoreTest, ManyObjectTest) { set listed; vector objects; - r = store->collection_list_impl(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); ASSERT_EQ(r, 0); cerr << "objects.size() is " << objects.size() << std::endl; @@ -599,7 +599,7 @@ TEST_P(StoreTest, ManyObjectTest) { ghobject_t start, next; objects.clear(); - r = store->collection_list_impl( + r = store->collection_list( cid, ghobject_t::get_max(), ghobject_t::get_max(), @@ -614,12 +614,12 @@ TEST_P(StoreTest, ManyObjectTest) { objects.clear(); listed.clear(); while (1) { - r = store->collection_list_impl(cid, start, - ghobject_t::get_max(), - 60, - 0, - &objects, - &next); + r = store->collection_list(cid, start, + ghobject_t::get_max(), + 60, + 0, + &objects, + &next); ASSERT_TRUE(sorted(objects)); ASSERT_EQ(r, 0); listed.insert(objects.begin(), objects.end()); @@ -1101,8 +1101,8 @@ public: ghobject_t next, current; while (1) { cerr << "scanning..." << std::endl; - int r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 100, - 0, &objects, &next); + int r = store->collection_list(cid, current, ghobject_t::get_max(), 100, + 0, &objects, &next); ASSERT_EQ(r, 0); ASSERT_TRUE(sorted(objects)); objects_set.insert(objects.begin(), objects.end()); @@ -1117,7 +1117,7 @@ public: ASSERT_GT(available_objects.count(*i), (unsigned)0); } - int r = store->collection_list_impl(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + int r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); ASSERT_EQ(r, 0); objects_set2.insert(objects.begin(), objects.end()); ASSERT_EQ(objects_set2.size(), available_objects.size()); @@ -1313,7 +1313,7 @@ TEST_P(StoreTest, HashCollisionTest) { } } vector objects; - r = store->collection_list_impl(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); ASSERT_EQ(r, 0); set listed(objects.begin(), objects.end()); cerr << "listed.size() is " << listed.size() << " and created.size() is " << created.size() << std::endl; @@ -1322,7 +1322,7 @@ TEST_P(StoreTest, HashCollisionTest) { listed.clear(); ghobject_t current, next; while (1) { - r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 60, + r = store->collection_list(cid, current, ghobject_t::get_max(), 60, 0, &objects, &next); ASSERT_EQ(r, 0); ASSERT_TRUE(sorted(objects)); @@ -1408,7 +1408,7 @@ TEST_P(StoreTest, ScrubTest) { } vector objects; - r = store->collection_list_impl(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); ASSERT_EQ(r, 0); set listed(objects.begin(), objects.end()); cerr << "listed.size() is " << listed.size() << " and created.size() is " << created.size() << std::endl; @@ -1417,8 +1417,8 @@ TEST_P(StoreTest, ScrubTest) { listed.clear(); ghobject_t current, next; while (1) { - r = store->collection_list_impl(cid, current, ghobject_t::get_max(), 60, - 0, &objects, &next); + r = store->collection_list(cid, current, ghobject_t::get_max(), 60, + 0, &objects, &next); ASSERT_EQ(r, 0); ASSERT_TRUE(sorted(objects)); for (vector::iterator i = objects.begin(); @@ -1706,7 +1706,7 @@ void colsplittest( ObjectStore::Transaction t; vector objects; - r = store->collection_list_impl(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); ASSERT_EQ(r, 0); ASSERT_EQ(objects.size(), num_objects); for (vector::iterator i = objects.begin(); @@ -1717,7 +1717,7 @@ void colsplittest( } objects.clear(); - r = store->collection_list_impl(tid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + r = store->collection_list(tid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); ASSERT_EQ(r, 0); ASSERT_EQ(objects.size(), num_objects); for (vector::iterator i = objects.begin(); @@ -1925,7 +1925,7 @@ TEST_P(StoreTest, BigRGWObjectName) { { vector objects; - r = store->collection_list_impl(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); + r = store->collection_list(cid, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &objects, 0); ASSERT_EQ(r, 0); ASSERT_EQ(objects.size(), 1u); ASSERT_EQ(objects[0], oid2); diff --git a/src/test/objectstore/workload_generator.cc b/src/test/objectstore/workload_generator.cc index 04bb906ce416..ae0a83423d91 100644 --- a/src/test/objectstore/workload_generator.cc +++ b/src/test/objectstore/workload_generator.cc @@ -353,7 +353,7 @@ void WorkloadGenerator::do_destroy_collection(ObjectStore::Transaction *t, m_nr_runs.set(0); entry->m_osr.flush(); vector ls; - m_store->collection_list_impl(entry->m_coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &ls, NULL); + m_store->collection_list(entry->m_coll, ghobject_t(), ghobject_t::get_max(), INT_MAX, 0, &ls, NULL); dout(2) << __func__ << " coll " << entry->m_coll << " (" << ls.size() << " objects)" << dendl; diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 734c04d86abe..f76e795846e3 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -79,14 +79,14 @@ int _action_on_all_objects_in_pg(ObjectStore *store, coll_t coll, action_on_obje ghobject_t next; while (!next.is_max()) { vector list; - int r = store->collection_list_impl( - coll, - next, - ghobject_t::get_max(), - LIST_AT_A_TIME, - 0, - &list, - &next); + int r = store->collection_list( + coll, + next, + ghobject_t::get_max(), + LIST_AT_A_TIME, + 0, + &list, + &next); if (r < 0) { cerr << "Error listing collection: " << coll << ", " << cpp_strerror(r) << std::endl; @@ -412,7 +412,7 @@ void remove_coll(ObjectStore *store, const coll_t &coll) cout << "remove_coll " << coll << std::endl; while (!next.is_max()) { vector objects; - r = store->collection_list_impl(coll, next, ghobject_t::get_max(), 300, 0, + r = store->collection_list(coll, next, ghobject_t::get_max(), 300, 0, &objects, &next); if (r < 0) goto out; @@ -700,7 +700,7 @@ int ObjectStoreTool::export_files(ObjectStore *store, coll_t coll) while (!next.is_max()) { vector objects; - int r = store->collection_list_impl(coll, next, ghobject_t::get_max(), 300, 0, + int r = store->collection_list(coll, next, ghobject_t::get_max(), 300, 0, &objects, &next); if (r < 0) return r;