]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw:multisite: change raw 'RGWAioCompletionNotifier*' to intrusive_ptr for rgw_cr_rados
authorlu.shasha <lu.shasha@eisoo.com>
Tue, 11 Jul 2017 03:20:15 +0000 (11:20 +0800)
committerlu.shasha <lu.shasha@eisoo.com>
Wed, 12 Jul 2017 05:50:02 +0000 (13:50 +0800)
Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
src/rgw/rgw_cr_rados.cc
src/rgw/rgw_cr_rados.h

index cd83d8aa0b695ef87a9388ba1ba1d3f5289b1ac5..107d605158cdd26cf3f89bae7c2b3d3076c44726 100644 (file)
@@ -220,13 +220,6 @@ RGWRadosSetOmapKeysCR::RGWRadosSetOmapKeysCR(RGWRados *_store,
   s << "]";
 }
 
-RGWRadosSetOmapKeysCR::~RGWRadosSetOmapKeysCR()
-{
-  if (cn) {
-    cn->put();
-  }
-}
-
 int RGWRadosSetOmapKeysCR::send_request()
 {
   int r = store->get_raw_obj_ref(obj, &ref);
@@ -241,7 +234,6 @@ int RGWRadosSetOmapKeysCR::send_request()
   op.omap_set(entries);
 
   cn = stack->create_completion_notifier();
-  cn->get();
   return ref.ioctx.aio_operate(ref.oid, cn->completion(), &op);
 }
 
@@ -266,10 +258,6 @@ RGWRadosGetOmapKeysCR::RGWRadosGetOmapKeysCR(RGWRados *_store,
   set_description() << "set omap keys dest=" << obj << " marker=" << marker;
 }
 
-RGWRadosGetOmapKeysCR::~RGWRadosGetOmapKeysCR()
-{
-}
-
 int RGWRadosGetOmapKeysCR::send_request() {
   int r = store->get_raw_obj_ref(obj, &ref);
   if (r < 0) {
@@ -296,10 +284,6 @@ RGWRadosRemoveOmapKeysCR::RGWRadosRemoveOmapKeysCR(RGWRados *_store,
   set_description() << "remove omap keys dest=" << obj << " keys=" << keys;
 }
 
-RGWRadosRemoveOmapKeysCR::~RGWRadosRemoveOmapKeysCR()
-{
-}
-
 int RGWRadosRemoveOmapKeysCR::send_request() {
   int r = store->get_raw_obj_ref(obj, &ref);
   if (r < 0) {
@@ -701,19 +685,11 @@ RGWRadosTimelogAddCR::RGWRadosTimelogAddCR(RGWRados *_store, const string& _oid,
   entries.push_back(entry);
 }
 
-RGWRadosTimelogAddCR::~RGWRadosTimelogAddCR()
-{
-  if (cn) {
-    cn->put();
-  }
-}
-
 int RGWRadosTimelogAddCR::send_request()
 {
   set_status() << "sending request";
 
   cn = stack->create_completion_notifier();
-  cn->get();
   return store->time_log_add(oid, entries, cn->completion(), true);
 }
 
@@ -741,19 +717,11 @@ RGWRadosTimelogTrimCR::RGWRadosTimelogTrimCR(RGWRados *store,
       << " from_marker=" << from_marker << " to_marker=" << to_marker;
 }
 
-RGWRadosTimelogTrimCR::~RGWRadosTimelogTrimCR()
-{
-  if (cn) {
-    cn->put();
-  }
-}
-
 int RGWRadosTimelogTrimCR::send_request()
 {
   set_status() << "sending request";
 
   cn = stack->create_completion_notifier();
-  cn->get();
   return store->time_log_trim(oid, start_time, end_time, from_marker,
                               to_marker, cn->completion());
 }
index 100e200b8ea7a561f9bb1340c190fde93cce7def..faa179f8627676c3e4a2885151b58f2e7bd31cda 100644 (file)
@@ -396,15 +396,13 @@ class RGWRadosSetOmapKeysCR : public RGWSimpleCoroutine {
 
   rgw_raw_obj obj;
 
-  RGWAioCompletionNotifier *cn;
+  boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
 
 public:
   RGWRadosSetOmapKeysCR(RGWRados *_store,
                      const rgw_raw_obj& _obj,
                      map<string, bufferlist>& _entries);
 
-  ~RGWRadosSetOmapKeysCR() override;
-
   int send_request() override;
   int request_complete() override;
 };
@@ -421,7 +419,7 @@ class RGWRadosGetOmapKeysCR : public RGWSimpleCoroutine {
 
   rgw_raw_obj obj;
 
-  RGWAioCompletionNotifier *cn;
+  boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
 
 public:
   RGWRadosGetOmapKeysCR(RGWRados *_store,
@@ -429,8 +427,6 @@ public:
                      const string& _marker,
                      map<string, bufferlist> *_entries, int _max_entries);
 
-  ~RGWRadosGetOmapKeysCR() override;
-
   int send_request() override;
 
   int request_complete() override {
@@ -454,8 +450,6 @@ public:
                      const rgw_raw_obj& _obj,
                      const set<string>& _keys);
 
-  ~RGWRadosRemoveOmapKeysCR() override;
-
   int send_request() override;
 
   int request_complete() override;
@@ -1078,12 +1072,11 @@ class RGWRadosTimelogAddCR : public RGWSimpleCoroutine {
 
   string oid;
 
-  RGWAioCompletionNotifier *cn;
+  boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
 
 public:
   RGWRadosTimelogAddCR(RGWRados *_store, const string& _oid,
                        const cls_log_entry& entry);
-  ~RGWRadosTimelogAddCR() override;
 
   int send_request() override;
   int request_complete() override;
@@ -1091,7 +1084,7 @@ public:
 
 class RGWRadosTimelogTrimCR : public RGWSimpleCoroutine {
   RGWRados *store;
-  RGWAioCompletionNotifier *cn{nullptr};
+  boost::intrusive_ptr<RGWAioCompletionNotifier> cn;
  protected:
   std::string oid;
   real_time start_time;
@@ -1104,7 +1097,6 @@ class RGWRadosTimelogTrimCR : public RGWSimpleCoroutine {
                         const real_time& start_time, const real_time& end_time,
                         const std::string& from_marker,
                         const std::string& to_marker);
-  ~RGWRadosTimelogTrimCR() override;
 
   int send_request() override;
   int request_complete() override;