From: Casey Bodley Date: Fri, 23 Nov 2018 16:50:36 +0000 (-0500) Subject: rgw: removed unused RGWRados::list_buckets_* X-Git-Tag: v14.1.0~751^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45a3dea5cda1fa79aee75cc35172f4e872a53fa0;p=ceph.git rgw: removed unused RGWRados::list_buckets_* Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index e6c78a5910bb..93ce2247ee43 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 29433b2b1cf3..5a9c142cfd05 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);