Skip to content

Commit f980890

Browse files
committed
rgw/rados: remove duplicated RGWRados::cls_bucket_head()
Signed-off-by: Casey Bodley <cbodley@redhat.com>
1 parent 22f5e50 commit f980890

File tree

3 files changed

+4
-35
lines changed

3 files changed

+4
-35
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9410,7 +9410,8 @@ int RGWRados::get_bucket_stats(const DoutPrefixProvider *dpp,
94109410
{
94119411
vector<rgw_bucket_dir_header> headers;
94129412
map<int, string> bucket_instance_ids;
9413-
int r = cls_bucket_head(dpp, bucket_info, idx_layout, shard_id, headers, &bucket_instance_ids);
9413+
int r = svc.bi_rados->cls_bucket_head(dpp, bucket_info, idx_layout, shard_id,
9414+
&headers, &bucket_instance_ids, y);
94149415
if (r < 0) {
94159416
return r;
94169417
}
@@ -10996,33 +10997,6 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,
1099610997
return 0;
1099710998
} // RGWRados::check_disk_state
1099810999

10999-
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)
11000-
{
11001-
librados::IoCtx index_pool;
11002-
map<int, string> oids;
11003-
map<int, struct rgw_cls_list_ret> list_results;
11004-
int r = svc.bi_rados->open_bucket_index(dpp, bucket_info, shard_id, idx_layout, &index_pool, &oids, bucket_instance_ids);
11005-
if (r < 0) {
11006-
ldpp_dout(dpp, 20) << "cls_bucket_head: open_bucket_index() returned "
11007-
<< r << dendl;
11008-
return r;
11009-
}
11010-
11011-
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
11012-
r = CLSRGWIssueGetDirHeader(index_pool, oids, list_results, cct->_conf->rgw_bucket_index_max_aio)();
11013-
if (r < 0) {
11014-
ldpp_dout(dpp, 20) << "cls_bucket_head: CLSRGWIssueGetDirHeader() returned "
11015-
<< r << dendl;
11016-
return r;
11017-
}
11018-
11019-
map<int, struct rgw_cls_list_ret>::iterator iter = list_results.begin();
11020-
for(; iter != list_results.end(); ++iter) {
11021-
headers.push_back(std::move(iter->second.dir.header));
11022-
}
11023-
return 0;
11024-
}
11025-
1102611000
int RGWRados::cls_bucket_head_async(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info,
1102711001
const rgw::bucket_index_layout_generation& idx_layout, int shard_id,
1102811002
boost::intrusive_ptr<RGWGetDirHeader_CB> cb, int *num_aio)

src/rgw/driver/rados/rgw_rados.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,11 +1535,6 @@ int restore_obj_from_cloud(RGWLCCloudTierCtx& tier_ctx,
15351535
rgw_obj_index_key *last_entry,
15361536
optional_yield y,
15371537
RGWBucketListNameFilter force_check_filter = {});
1538-
int cls_bucket_head(const DoutPrefixProvider *dpp,
1539-
const RGWBucketInfo& bucket_info,
1540-
const rgw::bucket_index_layout_generation& idx_layout,
1541-
int shard_id, std::vector<rgw_bucket_dir_header>& headers,
1542-
std::map<int, std::string> *bucket_instance_ids = NULL);
15431538
int cls_bucket_head_async(const DoutPrefixProvider *dpp,
15441539
const RGWBucketInfo& bucket_info,
15451540
const rgw::bucket_index_layout_generation& idx_layout,

src/rgw/services/svc_bi_rados.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class RGWSI_BucketIndex_RADOS : public RGWSI_BucketIndex
6666
uint64_t gen_id, const std::string& obj_key,
6767
std::string* bucket_obj, int* shard_id);
6868

69+
public:
70+
6971
int cls_bucket_head(const DoutPrefixProvider *dpp,
7072
const RGWBucketInfo& bucket_info,
7173
const rgw::bucket_index_layout_generation& idx_layout,
@@ -74,8 +76,6 @@ class RGWSI_BucketIndex_RADOS : public RGWSI_BucketIndex
7476
std::map<int, std::string> *bucket_instance_ids,
7577
optional_yield y);
7678

77-
public:
78-
7979
librados::Rados* rados{nullptr};
8080

8181
struct Svc {

0 commit comments

Comments
 (0)