]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rados: remove duplicated RGWRados::cls_bucket_head()
authorCasey Bodley <cbodley@redhat.com>
Fri, 8 Nov 2024 00:04:53 +0000 (19:04 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 7 Apr 2025 17:14:29 +0000 (13:14 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_rados.cc
src/rgw/driver/rados/rgw_rados.h
src/rgw/services/svc_bi_rados.h

index 3b1bbadda65587af290a8b27e08973a4581e044b..09054e4b401155bcccac9055c983fb8063d034cf 100644 (file)
@@ -9410,7 +9410,8 @@ int RGWRados::get_bucket_stats(const DoutPrefixProvider *dpp,
 {
   vector<rgw_bucket_dir_header> headers;
   map<int, string> bucket_instance_ids;
-  int r = cls_bucket_head(dpp, bucket_info, idx_layout, shard_id, headers, &bucket_instance_ids);
+  int r = svc.bi_rados->cls_bucket_head(dpp, bucket_info, idx_layout, shard_id,
+                                        &headers, &bucket_instance_ids, y);
   if (r < 0) {
     return r;
   }
@@ -10996,33 +10997,6 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,
   return 0;
 } // RGWRados::check_disk_state
 
-int RGWRados::cls_bucket_head(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const rgw::bucket_index_layout_generation& idx_layout, int shard_id, vector<rgw_bucket_dir_header>& headers, map<int, string> *bucket_instance_ids)
-{
-  librados::IoCtx index_pool;
-  map<int, string> oids;
-  map<int, struct rgw_cls_list_ret> list_results;
-  int r = svc.bi_rados->open_bucket_index(dpp, bucket_info, shard_id, idx_layout, &index_pool, &oids, bucket_instance_ids);
-  if (r < 0) {
-    ldpp_dout(dpp, 20) << "cls_bucket_head: open_bucket_index() returned "
-                   << r << dendl;
-    return r;
-  }
-
-  maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
-  r = CLSRGWIssueGetDirHeader(index_pool, oids, list_results, cct->_conf->rgw_bucket_index_max_aio)();
-  if (r < 0) {
-    ldpp_dout(dpp, 20) << "cls_bucket_head: CLSRGWIssueGetDirHeader() returned "
-                   << r << dendl;
-    return r;
-  }
-
-  map<int, struct rgw_cls_list_ret>::iterator iter = list_results.begin();
-  for(; iter != list_results.end(); ++iter) {
-    headers.push_back(std::move(iter->second.dir.header));
-  }
-  return 0;
-}
-
 int RGWRados::cls_bucket_head_async(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info,
                                     const rgw::bucket_index_layout_generation& idx_layout, int shard_id,
                                     boost::intrusive_ptr<RGWGetDirHeader_CB> cb, int *num_aio)
index 9afe35be4c32969ce929067dc714e626dc46e657..13fde2926055f4218f6a2bc24fbd4787c071e5e2 100644 (file)
@@ -1535,11 +1535,6 @@ public:
                                rgw_obj_index_key *last_entry,
                                 optional_yield y,
                                RGWBucketListNameFilter force_check_filter = {});
-  int cls_bucket_head(const DoutPrefixProvider *dpp,
-                     const RGWBucketInfo& bucket_info,
-                     const rgw::bucket_index_layout_generation& idx_layout,
-                     int shard_id, std::vector<rgw_bucket_dir_header>& headers,
-                     std::map<int, std::string> *bucket_instance_ids = NULL);
   int cls_bucket_head_async(const DoutPrefixProvider *dpp,
                            const RGWBucketInfo& bucket_info,
                            const rgw::bucket_index_layout_generation& idx_layout,
index a4ecd8cd7f074516c0aa40a45e84e4d8ba476e79..ba9aee88ff868e0fc0787673607dc411cc8a0fd3 100644 (file)
@@ -66,6 +66,8 @@ class RGWSI_BucketIndex_RADOS : public RGWSI_BucketIndex
                               uint64_t gen_id, const std::string& obj_key,
                               std::string* bucket_obj, int* shard_id);
 
+public:
+
   int cls_bucket_head(const DoutPrefixProvider *dpp,
                      const RGWBucketInfo& bucket_info,
                       const rgw::bucket_index_layout_generation& idx_layout,
@@ -74,8 +76,6 @@ class RGWSI_BucketIndex_RADOS : public RGWSI_BucketIndex
                       std::map<int, std::string> *bucket_instance_ids,
                       optional_yield y);
 
-public:
-
   librados::Rados* rados{nullptr};
 
   struct Svc {