summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_file_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rgw/rgw_file_int.h')
-rw-r--r--src/rgw/rgw_file_int.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/rgw/rgw_file_int.h b/src/rgw/rgw_file_int.h
index 0a1db645207..84eff1e252e 100644
--- a/src/rgw/rgw_file_int.h
+++ b/src/rgw/rgw_file_int.h
@@ -2298,6 +2298,8 @@ public:
std::string uri;
std::map<std::string, buffer::list> attrs;
RGWLibFS::BucketStats& bs;
+ real_time ctime;
+ bool name_matched = false;
RGWStatBucketRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user,
const std::string& _path,
@@ -2312,9 +2314,7 @@ public:
return (iter != attrs.end()) ? &(iter->second) : nullptr;
}
- real_time get_ctime() const {
- return bucket->get_creation_time();
- }
+ real_time get_ctime() { return ctime; }
bool only_bucket() override { return false; }
@@ -2342,22 +2342,26 @@ public:
return 0;
}
- virtual int get_params() {
- return 0;
+ int get_params(optional_yield) override { return 0; }
+
+ void complete() override {
+ // get_state() will no longer be there after execute_req()
+ // so save what we need from get_state()->bucket
+ ctime = get_state()->bucket->get_creation_time();
+ name_matched = get_state()->bucket->get_name().length() > 0;
+
+ RGWOp::complete();
}
void send_response() override {
- bucket->get_creation_time() = get_state()->bucket->get_info().creation_time;
bs.size = stats.size;
bs.size_rounded = stats.size_rounded;
- bs.creation_time = bucket->get_creation_time();
+ bs.creation_time = get_state()->bucket->get_info().creation_time;
bs.num_entries = stats.num_objects;
std::swap(attrs, get_state()->bucket_attrs);
}
- bool matched() {
- return (bucket->get_name().length() > 0);
- }
+ bool matched() { return name_matched; }
}; /* RGWStatBucketRequest */