From 45a3dea5cda1fa79aee75cc35172f4e872a53fa0 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 23 Nov 2018 11:50:36 -0500 Subject: [PATCH] rgw: removed unused RGWRados::list_buckets_* Signed-off-by: Casey Bodley --- src/rgw/rgw_rados.cc | 62 -------------------------------------------- src/rgw/rgw_rados.h | 8 ------ 2 files changed, 70 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index e6c78a5910b..93ce2247ee4 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1755,68 +1755,6 @@ int RGWRados::open_bucket_index_ctx(const RGWBucketInfo& bucket_info, librados:: return 0; } -/** - * set up a bucket listing. - * handle is filled in. - * Returns 0 on success, -ERR# otherwise. - */ -int RGWRados::list_buckets_init(RGWAccessHandle *handle) -{ - try { - auto iter = root_pool_ctx.nobjects_begin(); - librados::NObjectIterator *state = new librados::NObjectIterator(iter); - *handle = (RGWAccessHandle)state; - return 0; - } catch (const std::system_error& e) { - int r = -e.code().value(); - ldout(cct, 10) << "nobjects_begin threw " << e.what() - << ", returning " << r << dendl; - return r; - } catch (const std::exception& e) { - ldout(cct, 10) << "nobjects_begin threw " << e.what() - << ", returning -5" << dendl; - return -EIO; - } -} - -/** - * get the next bucket in the listing. - * obj is filled in, - * handle is updated. - * returns 0 on success, -ERR# otherwise. - */ -int RGWRados::list_buckets_next(rgw_bucket_dir_entry& obj, RGWAccessHandle *handle) -{ - librados::NObjectIterator *state = (librados::NObjectIterator *)*handle; - - do { - if (*state == root_pool_ctx.nobjects_end()) { - delete state; - return -ENOENT; - } - - obj.key.name = (*state)->get_oid(); - if (obj.key.name[0] == '_') { - obj.key.name = obj.key.name.substr(1); - } - try { - (*state)++; - } catch (const std::system_error& e) { - int r = -e.code().value(); - ldout(cct, 10) << "nobjects_begin threw " << e.what() - << ", returning " << r << dendl; - return r; - } catch (const std::exception& e) { - ldout(cct, 10) << "nobjects_begin threw " << e.what() - << ", returning -5" << dendl; - return -EIO; - } - } while (obj.key.name[0] == '.'); /* skip all entries starting with '.' */ - - return 0; -} - - /**** logs ****/ struct log_list_state { diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 29433b2b1cf..5a9c142cfd0 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1421,14 +1421,6 @@ public: int register_to_service_map(const string& daemon_type, const map& meta); int update_service_map(std::map&& status); - /** set up a bucket listing. handle is filled in. */ - int list_buckets_init(RGWAccessHandle *handle); - /** - * get the next bucket in the listing. obj is filled in, - * handle is updated. - */ - int list_buckets_next(rgw_bucket_dir_entry& obj, RGWAccessHandle *handle); - /// list logs int log_list_init(const string& prefix, RGWAccessHandle *handle); int log_list_next(RGWAccessHandle handle, string *name); -- 2.39.5