]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/notifications: make the interfaces const when possible 45842/head
authoryuval Lifshitz <ylifshit@redhat.com>
Sun, 10 Apr 2022 13:22:45 +0000 (16:22 +0300)
committeryuval Lifshitz <ylifshit@redhat.com>
Sun, 10 Apr 2022 13:22:45 +0000 (16:22 +0300)
Signed-off-by: yuval Lifshitz <ylifshit@redhat.com>
src/rgw/rgw_notify.cc
src/rgw/rgw_notify.h

index aa02cf85aac164bda6621eda009ca22afc78ae0d..211efd044206b9b6b55e97521420c5ba305d8c03 100644 (file)
@@ -936,7 +936,7 @@ int publish_commit(rgw::sal::Object* obj,
   return 0;
 }
 
-extern int publish_abort(reservation_t& res) {
+int publish_abort(reservation_t& res) {
   for (auto& topic : res.topics) {
     if (!topic.cfg.dest.persistent ||
        topic.res_id == cls_2pc_reservation::NO_ID) {
@@ -962,7 +962,7 @@ extern int publish_abort(reservation_t& res) {
 
 reservation_t::reservation_t(const DoutPrefixProvider* _dpp,
                             rgw::sal::RadosStore* _store,
-                            req_state* _s,
+                            const req_state* _s,
                             rgw::sal::Object* _object,
                             rgw::sal::Object* _src_object,
                             const std::string* _object_name) :
@@ -982,9 +982,9 @@ reservation_t::reservation_t(const DoutPrefixProvider* _dpp,
                             rgw::sal::Object* _object,
                             rgw::sal::Object* _src_object,
                             rgw::sal::Bucket* _bucket,
-                            std::string& _user_id,
-                            std::string& _user_tenant,
-                            std::string& _req_id,
+                            const std::string& _user_id,
+                            const std::string& _user_tenant,
+                            const std::string& _req_id,
                             optional_yield y) :
     dpp(_dpp), store(_store), s(nullptr), size(0) /* XXX */,
     object(_object), src_object(_src_object), bucket(_bucket),
index 88c85340b9754e693e4ed32b5ed84cd3f19cbb7a..60c79e7f70f76ecbf974a213f2913e48672dbc02 100644 (file)
@@ -47,13 +47,13 @@ struct reservation_t {
            cls_2pc_reservation::id_t _res_id) :
       configurationId(_configurationId), cfg(_cfg), res_id(_res_id) {}
 
-    std::string configurationId;
-    rgw_pubsub_topic cfg;
+    const std::string configurationId;
+    const rgw_pubsub_topic cfg;
     // res_id is reset after topic is committed/aborted
     cls_2pc_reservation::id_t res_id;
   };
 
-  const DoutPrefixProvider* dpp;
+  const DoutPrefixProvider* const dpp;
   std::vector<topic_t> topics;
   rgw::sal::RadosStore* const store;
   const req_state* const s;
@@ -62,17 +62,17 @@ struct reservation_t {
   rgw::sal::Object* const src_object; // may differ from object
   rgw::sal::Bucket* const bucket;
   const std::string* const object_name;
-  boost::optional<RGWObjTags&> tagset;
+  boost::optional<const RGWObjTags&> tagset;
   meta_map_t x_meta_map; // metadata cached by value
-  std::string user_id;
-  std::string user_tenant;
-  std::string req_id;
+  const std::string user_id;
+  const std::string user_tenant;
+  const std::string req_id;
   optional_yield yield;
 
   /* ctor for rgw_op callers */
   reservation_t(const DoutPrefixProvider* _dpp,
                rgw::sal::RadosStore* _store,
-               req_state* _s,
+               const req_state* _s,
                rgw::sal::Object* _object,
                rgw::sal::Object* _src_object,
                const std::string* _object_name);
@@ -83,9 +83,9 @@ struct reservation_t {
                rgw::sal::Object* _object,
                rgw::sal::Object* _src_object,
                rgw::sal::Bucket* _bucket,
-               std::string& _user_id,
-               std::string& _user_tenant,
-               std::string& _req_id,
+               const std::string& _user_id,
+               const std::string& _user_tenant,
+               const std::string& _req_id,
                optional_yield y);
 
   // dtor doing resource leak guarding
@@ -110,7 +110,7 @@ int publish_commit(rgw::sal::Object* obj,
         const DoutPrefixProvider *dpp);
 
 // cancel the reservation
-int publish_abort(const DoutPrefixProvider *dpp, reservation_t& reservation);
+int publish_abort(reservation_t& reservation);
 
 }