]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/bucket: remove unused 'meta backend ctx' arguments
authorCasey Bodley <cbodley@redhat.com>
Sun, 3 Dec 2023 17:06:01 +0000 (12:06 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 12 Sep 2024 20:54:58 +0000 (16:54 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_bucket.cc
src/rgw/driver/rados/rgw_bucket.h
src/rgw/services/svc_bucket.h
src/rgw/services/svc_bucket_sobj.cc
src/rgw/services/svc_bucket_sobj.h
src/rgw/services/svc_bucket_sync.h
src/rgw/services/svc_bucket_sync_sobj.cc
src/rgw/services/svc_bucket_sync_sobj.h

index 6bb1e9572daa38c709cc017bf9ebb78599581054..75db3ea71a09a4751715aff3b52ce7c28cb8c02b 100644 (file)
@@ -2206,9 +2206,7 @@ public:
     real_time mtime;
     map<string, bufferlist> attrs;
 
-    RGWSI_Bucket_EP_Ctx ctx(op->ctx());
-
-    int ret = svc.bucket->read_bucket_entrypoint_info(ctx, entry, &be, &ot, &mtime, &attrs, y, dpp);
+    int ret = svc.bucket->read_bucket_entrypoint_info(entry, &be, &ot, &mtime, &attrs, y, dpp);
     if (ret < 0)
       return ret;
 
@@ -2232,9 +2230,7 @@ public:
 
     real_time orig_mtime;
 
-    RGWSI_Bucket_EP_Ctx ctx(op->ctx());
-
-    int ret = svc.bucket->read_bucket_entrypoint_info(ctx, entry, &be, &objv_tracker, &orig_mtime, nullptr, y, dpp);
+    int ret = svc.bucket->read_bucket_entrypoint_info(entry, &be, &objv_tracker, &orig_mtime, nullptr, y, dpp);
     if (ret < 0)
       return ret;
 
@@ -2248,7 +2244,7 @@ public:
       ldpp_dout(dpp, -1) << "could not unlink bucket=" << entry << " owner=" << be.owner << dendl;
     }
 
-    ret = svc.bucket->remove_bucket_entrypoint_info(ctx, entry, &objv_tracker, y, dpp);
+    ret = svc.bucket->remove_bucket_entrypoint_info(entry, &objv_tracker, y, dpp);
     if (ret < 0) {
       ldpp_dout(dpp, -1) << "could not delete bucket=" << entry << dendl;
     }
@@ -2320,7 +2316,7 @@ int RGWMetadataHandlerPut_Bucket::put_checked(const DoutPrefixProvider *dpp)
 
   RGWSI_Bucket_EP_Ctx ctx(op->ctx());
 
-  return bhandler->svc.bucket->store_bucket_entrypoint_info(ctx, entry,
+  return bhandler->svc.bucket->store_bucket_entrypoint_info(entry,
                                                            be,
                                                            false,
                                                            mtime,
@@ -2518,8 +2514,6 @@ public:
                 optional_yield y, const DoutPrefixProvider *dpp) override {
     auto cct = svc.bucket->ctx();
 
-    RGWSI_Bucket_EP_Ctx ctx(op->ctx());
-
     ldpp_dout(dpp, 5) << "SKIP: bucket removal is not allowed on archive zone: bucket:" << entry << " ... proceeding to rename" << dendl;
 
     string tenant_name, bucket_name;
@@ -2534,7 +2528,7 @@ public:
 
     RGWBucketEntryPoint be;
     map<string, bufferlist> attrs;
-    int ret = svc.bucket->read_bucket_entrypoint_info(ctx, entry, &be, &objv_tracker, &mtime, &attrs, y, dpp);
+    int ret = svc.bucket->read_bucket_entrypoint_info(entry, &be, &objv_tracker, &mtime, &attrs, y, dpp);
     if (ret < 0) {
         return ret;
     }
@@ -2598,7 +2592,7 @@ public:
     RGWObjVersionTracker ot;
     ot.generate_new_write_ver(cct);
 
-    ret = svc.bucket->store_bucket_entrypoint_info(ctx, RGWSI_Bucket::get_entrypoint_meta_key(new_be.bucket),
+    ret = svc.bucket->store_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(new_be.bucket),
                                                    new_be, true, mtime, &attrs, nullptr, y, dpp);
     if (ret < 0) {
       ldpp_dout(dpp, 0) << "ERROR: failed to put new bucket entrypoint for bucket=" << new_be.bucket << " ret=" << ret << dendl;
@@ -2625,8 +2619,7 @@ public:
     // whether it was a newly created bucket entrypoint ...  in which case we
     // should ignore the error and move forward, or whether it is a higher version
     // of the same bucket instance ... in which we should retry
-    ret = svc.bucket->remove_bucket_entrypoint_info(ctx,
-                                                    RGWSI_Bucket::get_entrypoint_meta_key(be.bucket),
+    ret = svc.bucket->remove_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(be.bucket),
                                                     &objv_tracker,
                                                     y,
                                                     dpp);
@@ -2676,20 +2669,6 @@ public:
 };
 
 class RGWBucketInstanceMetadataHandler : public RGWBucketInstanceMetadataHandlerBase {
-  int read_bucket_instance_entry(RGWSI_Bucket_BI_Ctx& ctx,
-                                 const string& entry,
-                                 RGWBucketCompleteInfo *bi,
-                                 ceph::real_time *pmtime,
-                                 optional_yield y,
-                                 const DoutPrefixProvider *dpp) {
-    return svc.bucket->read_bucket_instance_info(ctx,
-                                                 entry,
-                                                 &bi->info,
-                                                 pmtime, &bi->attrs,
-                                                 y,
-                                                 dpp);
-  }
-
 public:
   struct Svc {
     RGWSI_Zone *zone{nullptr};
@@ -2730,9 +2709,7 @@ public:
     RGWBucketCompleteInfo bci;
     real_time mtime;
 
-    RGWSI_Bucket_BI_Ctx ctx(op->ctx());
-
-    int ret = svc.bucket->read_bucket_instance_info(ctx, entry, &bci.info, &mtime, &bci.attrs, y, dpp);
+    int ret = svc.bucket->read_bucket_instance_info(entry, &bci.info, &mtime, &bci.attrs, y, dpp);
     if (ret < 0)
       return ret;
 
@@ -2752,14 +2729,13 @@ public:
                 optional_yield y, const DoutPrefixProvider *dpp) override {
     RGWBucketCompleteInfo bci;
 
-    RGWSI_Bucket_BI_Ctx ctx(op->ctx());
-
-    int ret = read_bucket_instance_entry(ctx, entry, &bci, nullptr, y, dpp);
+    int ret = svc.bucket->read_bucket_instance_info(entry, &bci.info, nullptr,
+                                                    &bci.attrs, y, dpp);
     if (ret < 0 && ret != -ENOENT)
       return ret;
 
     ret = svc.bucket->remove_bucket_instance_info(
-        ctx, entry, bci.info, &bci.info.objv_tracker, y, dpp);
+        entry, bci.info, &bci.info.objv_tracker, y, dpp);
     if (ret < 0)
       return ret;
     ret = update_bucket_topic_mappings(dpp, &bci, /*current_bci=*/nullptr,
@@ -2767,18 +2743,6 @@ public:
     // update_bucket_topic_mapping error is swallowed.
     return 0;
   }
-
-  int call(std::function<int(RGWSI_Bucket_BI_Ctx& ctx)> f) {
-    return call(nullopt, f);
-  }
-
-  int call(std::optional<RGWSI_MetaBackend_CtxParams> bectx_params,
-           std::function<int(RGWSI_Bucket_BI_Ctx& ctx)> f) {
-    return be_handler->call(bectx_params, [&](RGWSI_MetaBackend_Handler::Op *op) {
-      RGWSI_Bucket_BI_Ctx ctx(op->ctx());
-      return f(ctx);
-    });
-  }
 };
 
 class RGWMetadataHandlerPut_BucketInstance : public RGWMetadataHandlerPut_SObj
@@ -2918,10 +2882,7 @@ int RGWMetadataHandlerPut_BucketInstance::put_checked(const DoutPrefixProvider *
   auto mtime = obj->get_mtime();
   auto pattrs = obj->get_pattrs();
 
-  RGWSI_Bucket_BI_Ctx ctx(op->ctx());
-
-  return bihandler->svc.bucket->store_bucket_instance_info(ctx,
-                                                         entry,
+  return bihandler->svc.bucket->store_bucket_instance_info(entry,
                                                          info,
                                                          orig_info,
                                                          false,
@@ -3036,32 +2997,20 @@ void RGWBucketCtl::init(RGWUserCtl *user_ctl,
     });
 }
 
-int RGWBucketCtl::call(std::function<int(RGWSI_Bucket_X_Ctx& ctx)> f) {
-  return bm_handler->call([&](RGWSI_Bucket_EP_Ctx& ep_ctx) {
-    return bmi_handler->call([&](RGWSI_Bucket_BI_Ctx& bi_ctx) {
-      RGWSI_Bucket_X_Ctx ctx{ep_ctx, bi_ctx};
-      return f(ctx);
-    });
-  });
-}
-
 int RGWBucketCtl::read_bucket_entrypoint_info(const rgw_bucket& bucket,
                                               RGWBucketEntryPoint *info,
                                               optional_yield y, const DoutPrefixProvider *dpp,
                                               const Bucket::GetParams& params)
 {
-  return bm_handler->call(params.bectx_params, [&](RGWSI_Bucket_EP_Ctx& ctx) {
-    return svc.bucket->read_bucket_entrypoint_info(ctx,
-                                                   RGWSI_Bucket::get_entrypoint_meta_key(bucket),
-                                                   info,
-                                                   params.objv_tracker,
-                                                   params.mtime,
-                                                   params.attrs,
-                                                  y,
-                                                   dpp,
-                                                   params.cache_info,
-                                                   params.refresh_version);
-  });
+  return svc.bucket->read_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(bucket),
+                                                 info,
+                                                 params.objv_tracker,
+                                                 params.mtime,
+                                                 params.attrs,
+                                                 y,
+                                                 dpp,
+                                                 params.cache_info,
+                                                 params.refresh_version);
 }
 
 int RGWBucketCtl::store_bucket_entrypoint_info(const rgw_bucket& bucket,
@@ -3070,17 +3019,14 @@ int RGWBucketCtl::store_bucket_entrypoint_info(const rgw_bucket& bucket,
                                                const DoutPrefixProvider *dpp,
                                                const Bucket::PutParams& params)
 {
-  return bm_handler->call([&](RGWSI_Bucket_EP_Ctx& ctx) {
-    return svc.bucket->store_bucket_entrypoint_info(ctx,
-                                                    RGWSI_Bucket::get_entrypoint_meta_key(bucket),
-                                                    info,
-                                                    params.exclusive,
-                                                    params.mtime,
-                                                    params.attrs,
-                                                    params.objv_tracker,
-                                                    y,
-                                                    dpp);
-  });
+  return svc.bucket->store_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(bucket),
+                                                  info,
+                                                  params.exclusive,
+                                                  params.mtime,
+                                                  params.attrs,
+                                                  params.objv_tracker,
+                                                  y,
+                                                  dpp);
 }
 
 int RGWBucketCtl::remove_bucket_entrypoint_info(const rgw_bucket& bucket,
@@ -3088,13 +3034,10 @@ int RGWBucketCtl::remove_bucket_entrypoint_info(const rgw_bucket& bucket,
                                                 const DoutPrefixProvider *dpp,
                                                 const Bucket::RemoveParams& params)
 {
-  return bm_handler->call([&](RGWSI_Bucket_EP_Ctx& ctx) {
-    return svc.bucket->remove_bucket_entrypoint_info(ctx,
-                                                     RGWSI_Bucket::get_entrypoint_meta_key(bucket),
-                                                     params.objv_tracker,
-                                                    y,
-                                                     dpp);
-  });
+  return svc.bucket->remove_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(bucket),
+                                                   params.objv_tracker,
+                                                   y,
+                                                   dpp);
 }
 
 int RGWBucketCtl::read_bucket_instance_info(const rgw_bucket& bucket,
@@ -3103,18 +3046,14 @@ int RGWBucketCtl::read_bucket_instance_info(const rgw_bucket& bucket,
                                             const DoutPrefixProvider *dpp,
                                             const BucketInstance::GetParams& params)
 {
-  int ret = bmi_handler->call(params.bectx_params, [&](RGWSI_Bucket_BI_Ctx& ctx) {
-    return svc.bucket->read_bucket_instance_info(ctx,
-                                                 RGWSI_Bucket::get_bi_meta_key(bucket),
-                                                 info,
-                                                 params.mtime,
-                                                 params.attrs,
-                                                y,
-                                                 dpp,
-                                                 params.cache_info,
-                                                 params.refresh_version);
-  });
-
+  int ret = svc.bucket->read_bucket_instance_info(RGWSI_Bucket::get_bi_meta_key(bucket),
+                                                  info,
+                                                  params.mtime,
+                                                  params.attrs,
+                                                  y,
+                                                  dpp,
+                                                  params.cache_info,
+                                                  params.refresh_version);
   if (ret < 0) {
     return ret;
   }
@@ -3150,17 +3089,13 @@ int RGWBucketCtl::read_bucket_info(const rgw_bucket& bucket,
     b = &ep->bucket;
   }
 
-  int ret = bmi_handler->call(params.bectx_params, [&](RGWSI_Bucket_BI_Ctx& ctx) {
-    return svc.bucket->read_bucket_instance_info(ctx,
-                                                 RGWSI_Bucket::get_bi_meta_key(*b),
-                                                 info,
-                                                 params.mtime,
-                                                 params.attrs,
-                                                y, dpp,
-                                                 params.cache_info,
-                                                 params.refresh_version);
-  });
-
+  int ret = svc.bucket->read_bucket_instance_info(RGWSI_Bucket::get_bi_meta_key(*b),
+                                                  info,
+                                                  params.mtime,
+                                                  params.attrs,
+                                                  y, dpp,
+                                                  params.cache_info,
+                                                  params.refresh_version);
   if (ret < 0) {
     return ret;
   }
@@ -3172,19 +3107,17 @@ int RGWBucketCtl::read_bucket_info(const rgw_bucket& bucket,
   return 0;
 }
 
-int RGWBucketCtl::do_store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                                const rgw_bucket& bucket,
-                                                RGWBucketInfo& info,
-                                                optional_yield y,
-                                                const DoutPrefixProvider *dpp,
-                                                const BucketInstance::PutParams& params)
+int RGWBucketCtl::store_bucket_instance_info(const rgw_bucket& bucket,
+                                            RGWBucketInfo& info,
+                                            optional_yield y,
+                                            const DoutPrefixProvider *dpp,
+                                            const BucketInstance::PutParams& params)
 {
   if (params.objv_tracker) {
     info.objv_tracker = *params.objv_tracker;
   }
 
-  return svc.bucket->store_bucket_instance_info(ctx,
-                                                RGWSI_Bucket::get_bi_meta_key(bucket),
+  return svc.bucket->store_bucket_instance_info(RGWSI_Bucket::get_bi_meta_key(bucket),
                                                 info,
                                                 params.orig_info,
                                                 params.exclusive,
@@ -3194,17 +3127,6 @@ int RGWBucketCtl::do_store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
                                                 dpp);
 }
 
-int RGWBucketCtl::store_bucket_instance_info(const rgw_bucket& bucket,
-                                            RGWBucketInfo& info,
-                                            optional_yield y,
-                                            const DoutPrefixProvider *dpp,
-                                            const BucketInstance::PutParams& params)
-{
-  return bmi_handler->call([&](RGWSI_Bucket_BI_Ctx& ctx) {
-    return do_store_bucket_instance_info(ctx, bucket, info, y, dpp, params);
-  });
-}
-
 int RGWBucketCtl::remove_bucket_instance_info(const rgw_bucket& bucket,
                                               RGWBucketInfo& info,
                                               optional_yield y,
@@ -3215,18 +3137,14 @@ int RGWBucketCtl::remove_bucket_instance_info(const rgw_bucket& bucket,
     info.objv_tracker = *params.objv_tracker;
   }
 
-  return bmi_handler->call([&](RGWSI_Bucket_BI_Ctx& ctx) {
-    return svc.bucket->remove_bucket_instance_info(ctx,
-                                                   RGWSI_Bucket::get_bi_meta_key(bucket),
-                                                   info,
-                                                   &info.objv_tracker,
-                                                   y,
-                                                   dpp);
-  });
+  return svc.bucket->remove_bucket_instance_info(RGWSI_Bucket::get_bi_meta_key(bucket),
+                                                 info,
+                                                 &info.objv_tracker,
+                                                 y,
+                                                 dpp);
 }
 
-int RGWBucketCtl::do_store_linked_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
-                                              RGWBucketInfo& info,
+int RGWBucketCtl::do_store_linked_bucket_info(RGWBucketInfo& info,
                                               RGWBucketInfo *orig_info,
                                               bool exclusive, real_time mtime,
                                               obj_version *pep_objv,
@@ -3236,8 +3154,7 @@ int RGWBucketCtl::do_store_linked_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
 {
   bool create_head = !info.has_instance_obj || create_entry_point;
 
-  int ret = svc.bucket->store_bucket_instance_info(ctx.bi,
-                                                   RGWSI_Bucket::get_bi_meta_key(info.bucket),
+  int ret = svc.bucket->store_bucket_instance_info(RGWSI_Bucket::get_bi_meta_key(info.bucket),
                                                    info,
                                                    orig_info,
                                                    exclusive,
@@ -3264,22 +3181,17 @@ int RGWBucketCtl::do_store_linked_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
       *pep_objv = ot.write_version;
     }
   }
-  ret = svc.bucket->store_bucket_entrypoint_info(ctx.ep,
-                                                 RGWSI_Bucket::get_entrypoint_meta_key(info.bucket),
-                                                 entry_point,
-                                                 exclusive,
-                                                 mtime,
-                                                 pattrs,
-                                                 &ot,
-                                                y,
-                                                 dpp);
-  if (ret < 0)
-    return ret;
-
-  return 0;
+  return svc.bucket->store_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(info.bucket),
+                                                  entry_point,
+                                                  exclusive,
+                                                  mtime,
+                                                  pattrs,
+                                                  &ot,
+                                                  y,
+                                                  dpp);
 }
-int RGWBucketCtl::convert_old_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
-                                          const rgw_bucket& bucket,
+
+int RGWBucketCtl::convert_old_bucket_info(const rgw_bucket& bucket,
                                           optional_yield y,
                                           const DoutPrefixProvider *dpp)
 {
@@ -3292,8 +3204,7 @@ int RGWBucketCtl::convert_old_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
 
   ldpp_dout(dpp, 10) << "RGWRados::convert_old_bucket_info(): bucket=" << bucket << dendl;
 
-  int ret = svc.bucket->read_bucket_entrypoint_info(ctx.ep,
-                                                    RGWSI_Bucket::get_entrypoint_meta_key(bucket),
+  int ret = svc.bucket->read_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(bucket),
                                                     &entry_point, &ot, &ep_mtime, &attrs, y, dpp);
   if (ret < 0) {
     ldpp_dout(dpp, 0) << "ERROR: get_bucket_entrypoint_info() returned " << ret << " bucket=" << bucket << dendl;
@@ -3309,7 +3220,7 @@ int RGWBucketCtl::convert_old_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
 
   ot.generate_new_write_ver(cct);
 
-  ret = do_store_linked_bucket_info(ctx, info, nullptr, false, ep_mtime, &ot.write_version, &attrs, true, y, dpp);
+  ret = do_store_linked_bucket_info(info, nullptr, false, ep_mtime, &ot.write_version, &attrs, true, y, dpp);
   if (ret < 0) {
     ldpp_dout(dpp, 0) << "ERROR: failed to put_linked_bucket_info(): " << ret << dendl;
     return ret;
@@ -3324,43 +3235,24 @@ int RGWBucketCtl::set_bucket_instance_attrs(RGWBucketInfo& bucket_info,
                                             optional_yield y,
                                             const DoutPrefixProvider *dpp)
 {
-  return call([&](RGWSI_Bucket_X_Ctx& ctx) {
-    rgw_bucket& bucket = bucket_info.bucket;
-
-    if (!bucket_info.has_instance_obj) {
-      /* an old bucket object, need to convert it */
-        int ret = convert_old_bucket_info(ctx, bucket, y, dpp);
-        if (ret < 0) {
-          ldpp_dout(dpp, 0) << "ERROR: failed converting old bucket info: " << ret << dendl;
-          return ret;
-        }
-    }
-
-    return do_store_bucket_instance_info(ctx.bi,
-                                         bucket,
-                                         bucket_info,
-                                         y,
-                                         dpp,
-                                         BucketInstance::PutParams().set_attrs(&attrs)
-                                                                    .set_objv_tracker(objv_tracker)
-                                                                    .set_orig_info(&bucket_info));
-    });
-}
+  rgw_bucket& bucket = bucket_info.bucket;
 
+  if (!bucket_info.has_instance_obj) {
+    /* an old bucket object, need to convert it */
+      int ret = convert_old_bucket_info(bucket, y, dpp);
+      if (ret < 0) {
+        ldpp_dout(dpp, 0) << "ERROR: failed converting old bucket info: " << ret << dendl;
+        return ret;
+      }
+  }
 
-int RGWBucketCtl::link_bucket(librados::Rados& rados,
-                              const rgw_owner& owner,
-                              const rgw_bucket& bucket,
-                              ceph::real_time creation_time,
-                             optional_yield y,
-                              const DoutPrefixProvider *dpp,
-                              bool update_entrypoint,
-                              rgw_ep_info *pinfo)
-{
-  return bm_handler->call([&](RGWSI_Bucket_EP_Ctx& ctx) {
-    return do_link_bucket(ctx, rados, owner, bucket, creation_time,
-                          update_entrypoint, pinfo, y, dpp);
-  });
+  return store_bucket_instance_info(bucket,
+                                    bucket_info,
+                                    y,
+                                    dpp,
+                                    BucketInstance::PutParams().set_attrs(&attrs)
+                                                               .set_objv_tracker(objv_tracker)
+                                                               .set_orig_info(&bucket_info));
 }
 
 static rgw_raw_obj get_owner_buckets_obj(RGWSI_User* svc_user,
@@ -3377,15 +3269,14 @@ static rgw_raw_obj get_owner_buckets_obj(RGWSI_User* svc_user,
       }), owner);
 }
 
-int RGWBucketCtl::do_link_bucket(RGWSI_Bucket_EP_Ctx& ctx,
-                                 librados::Rados& rados,
-                                 const rgw_owner& owner,
-                                 const rgw_bucket& bucket,
-                                 ceph::real_time creation_time,
-                                 bool update_entrypoint,
-                                 rgw_ep_info *pinfo,
-                                optional_yield y,
-                                 const DoutPrefixProvider *dpp)
+int RGWBucketCtl::link_bucket(librados::Rados& rados,
+                              const rgw_owner& owner,
+                              const rgw_bucket& bucket,
+                              ceph::real_time creation_time,
+                             optional_yield y,
+                              const DoutPrefixProvider *dpp,
+                              bool update_entrypoint,
+                              rgw_ep_info *pinfo)
 {
   int ret;
 
@@ -3401,8 +3292,7 @@ int RGWBucketCtl::do_link_bucket(RGWSI_Bucket_EP_Ctx& ctx,
       ep = pinfo->ep;
       pattrs = &pinfo->attrs;
     } else {
-      ret = svc.bucket->read_bucket_entrypoint_info(ctx,
-                                                    meta_key,
+      ret = svc.bucket->read_bucket_entrypoint_info(meta_key,
                                                     &ep, &rot,
                                                     nullptr, &attrs,
                                                     y, dpp);
@@ -3433,14 +3323,14 @@ int RGWBucketCtl::do_link_bucket(RGWSI_Bucket_EP_Ctx& ctx,
   ep.owner = owner;
   ep.bucket = bucket;
   ret = svc.bucket->store_bucket_entrypoint_info(
-    ctx, meta_key, ep, false, real_time(), pattrs, &rot, y, dpp);
+    meta_key, ep, false, real_time(), pattrs, &rot, y, dpp);
   if (ret < 0)
     goto done_err;
 
   return 0;
 
 done_err:
-  int r = do_unlink_bucket(ctx, rados, owner, bucket, true, y, dpp);
+  int r = unlink_bucket(rados, owner, bucket, y, dpp, true);
   if (r < 0) {
     ldpp_dout(dpp, 0) << "ERROR: failed unlinking bucket on error cleanup: "
                            << cpp_strerror(-r) << dendl;
@@ -3451,19 +3341,6 @@ done_err:
 int RGWBucketCtl::unlink_bucket(librados::Rados& rados, const rgw_owner& owner,
                                 const rgw_bucket& bucket, optional_yield y,
                                 const DoutPrefixProvider *dpp, bool update_entrypoint)
-{
-  return bm_handler->call([&](RGWSI_Bucket_EP_Ctx& ctx) {
-    return do_unlink_bucket(ctx, rados, owner, bucket, update_entrypoint, y, dpp);
-  });
-}
-
-int RGWBucketCtl::do_unlink_bucket(RGWSI_Bucket_EP_Ctx& ctx,
-                                   librados::Rados& rados,
-                                   const rgw_owner& owner,
-                                   const rgw_bucket& bucket,
-                                   bool update_entrypoint,
-                                  optional_yield y,
-                                   const DoutPrefixProvider *dpp)
 {
   const auto& buckets_obj = get_owner_buckets_obj(svc.user, svc.zone, owner);
   int ret = rgwrados::buckets::remove(dpp, y, rados, buckets_obj, bucket);
@@ -3479,7 +3356,7 @@ int RGWBucketCtl::do_unlink_bucket(RGWSI_Bucket_EP_Ctx& ctx,
   RGWObjVersionTracker ot;
   map<string, bufferlist> attrs;
   string meta_key = RGWSI_Bucket::get_entrypoint_meta_key(bucket);
-  ret = svc.bucket->read_bucket_entrypoint_info(ctx, meta_key, &ep, &ot, nullptr, &attrs, y, dpp);
+  ret = svc.bucket->read_bucket_entrypoint_info(meta_key, &ep, &ot, nullptr, &attrs, y, dpp);
   if (ret == -ENOENT)
     return 0;
   if (ret < 0)
@@ -3494,7 +3371,7 @@ int RGWBucketCtl::do_unlink_bucket(RGWSI_Bucket_EP_Ctx& ctx,
   }
 
   ep.linked = false;
-  return svc.bucket->store_bucket_entrypoint_info(ctx, meta_key, ep, false, real_time(), &attrs, &ot, y, dpp);
+  return svc.bucket->store_bucket_entrypoint_info(meta_key, ep, false, real_time(), &attrs, &ot, y, dpp);
 }
 
 int RGWBucketCtl::read_bucket_stats(const rgw_bucket& bucket,
@@ -3502,17 +3379,13 @@ int RGWBucketCtl::read_bucket_stats(const rgw_bucket& bucket,
                                     optional_yield y,
                                     const DoutPrefixProvider *dpp)
 {
-  return call([&](RGWSI_Bucket_X_Ctx& ctx) {
-    return svc.bucket->read_bucket_stats(ctx, bucket, result, y, dpp);
-  });
+  return svc.bucket->read_bucket_stats(bucket, result, y, dpp);
 }
 
 int RGWBucketCtl::read_buckets_stats(std::vector<RGWBucketEnt>& buckets,
                                      optional_yield y, const DoutPrefixProvider *dpp)
 {
-  return call([&](RGWSI_Bucket_X_Ctx& ctx) {
-    return svc.bucket->read_buckets_stats(ctx, buckets, y, dpp);
-  });
+  return svc.bucket->read_buckets_stats(buckets, y, dpp);
 }
 
 int RGWBucketCtl::sync_owner_stats(const DoutPrefixProvider *dpp,
@@ -3550,9 +3423,7 @@ int RGWBucketCtl::get_sync_policy_handler(std::optional<rgw_zone_id> zone,
                                           optional_yield y,
                                           const DoutPrefixProvider *dpp)
 {
-  int r = call([&](RGWSI_Bucket_X_Ctx& ctx) {
-    return svc.bucket_sync->get_policy_handler(ctx, zone, bucket, phandler, y, dpp);
-  });
+  int r = svc.bucket_sync->get_policy_handler(zone, bucket, phandler, y, dpp);
   if (r < 0) {
     ldpp_dout(dpp, 20) << __func__ << "(): failed to get policy handler for bucket=" << bucket << " (r=" << r << ")" << dendl;
     return r;
index 6bbfba93df2155dfbb3f801590732d851a3d0b21..a84fb870ea46dd77c1b2e6d7cb06265d3af43a52 100644 (file)
@@ -447,8 +447,6 @@ class RGWBucketCtl {
   RGWSI_Bucket_BE_Handler bucket_be_handler; /* bucket backend handler */
   RGWSI_BucketInstance_BE_Handler bi_be_handler; /* bucket instance backend handler */
 
-  int call(std::function<int(RGWSI_Bucket_X_Ctx& ctx)> f);
-
 public:
   RGWBucketCtl(RGWSI_Zone *zone_svc,
                RGWSI_Bucket *bucket_svc,
@@ -736,20 +734,11 @@ public:
                           const DoutPrefixProvider *dpp);
 
 private:
-  int convert_old_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
-                              const rgw_bucket& bucket,
+  int convert_old_bucket_info(const rgw_bucket& bucket,
                               optional_yield y,
                               const DoutPrefixProvider *dpp);
 
-  int do_store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                    const rgw_bucket& bucket,
-                                    RGWBucketInfo& info,
-                                    optional_yield y,
-                                    const DoutPrefixProvider *dpp,
-                                    const BucketInstance::PutParams& params);
-
-  int do_store_linked_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
-                                  RGWBucketInfo& info,
+  int do_store_linked_bucket_info(RGWBucketInfo& info,
                                   RGWBucketInfo *orig_info,
                                   bool exclusive, real_time mtime,
                                   obj_version *pep_objv,
@@ -757,25 +746,6 @@ private:
                                   bool create_entry_point,
                                  optional_yield,
                                   const DoutPrefixProvider *dpp);
-
-  int do_link_bucket(RGWSI_Bucket_EP_Ctx& ctx,
-                     librados::Rados& rados,
-                     const rgw_owner& owner,
-                     const rgw_bucket& bucket,
-                     ceph::real_time creation_time,
-                     bool update_entrypoint,
-                     rgw_ep_info *pinfo,
-                    optional_yield y,
-                     const DoutPrefixProvider *dpp);
-
-  int do_unlink_bucket(RGWSI_Bucket_EP_Ctx& ctx,
-                       librados::Rados& rados,
-                       const rgw_owner& owner,
-                       const rgw_bucket& bucket,
-                       bool update_entrypoint,
-                      optional_yield y,
-                       const DoutPrefixProvider *dpp);
-
 };
 
 bool rgw_find_bucket_by_id(const DoutPrefixProvider *dpp, CephContext *cct, rgw::sal::Driver* driver, const std::string& marker,
index 5963c54171fbca683806154c086aa8560bea9acb..06ac2eb0866119323ded709eb59362505dfbfccd 100644 (file)
@@ -33,8 +33,7 @@ public:
   virtual RGWSI_Bucket_BE_Handler& get_ep_be_handler() = 0;
   virtual RGWSI_BucketInstance_BE_Handler& get_bi_be_handler() = 0;
 
-  virtual int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                          const std::string& key,
+  virtual int read_bucket_entrypoint_info(const std::string& key,
                                           RGWBucketEntryPoint *entry_point,
                                           RGWObjVersionTracker *objv_tracker,
                                           real_time *pmtime,
@@ -44,8 +43,7 @@ public:
                                           rgw_cache_entry_info *cache_info = nullptr,
                                           boost::optional<obj_version> refresh_version = boost::none) = 0;
 
-  virtual int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                   const std::string& key,
+  virtual int store_bucket_entrypoint_info(const std::string& key,
                                    RGWBucketEntryPoint& info,
                                    bool exclusive,
                                    real_time mtime,
@@ -54,14 +52,12 @@ public:
                                    optional_yield y,
                                    const DoutPrefixProvider *dpp) = 0;
 
-  virtual int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                    const std::string& key,
+  virtual int remove_bucket_entrypoint_info(const std::string& key,
                                     RGWObjVersionTracker *objv_tracker,
                                     optional_yield y,
                                     const DoutPrefixProvider *dpp) = 0;
 
-  virtual int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                const std::string& key,
+  virtual int read_bucket_instance_info(const std::string& key,
                                 RGWBucketInfo *info,
                                 real_time *pmtime,
                                 std::map<std::string, bufferlist> *pattrs,
@@ -70,8 +66,7 @@ public:
                                 rgw_cache_entry_info *cache_info = nullptr,
                                 boost::optional<obj_version> refresh_version = boost::none) = 0;
 
-  virtual int read_bucket_info(RGWSI_Bucket_X_Ctx& ep_ctx,
-                       const rgw_bucket& bucket,
+  virtual int read_bucket_info(const rgw_bucket& bucket,
                        RGWBucketInfo *info,
                        real_time *pmtime,
                        std::map<std::string, bufferlist> *pattrs,
@@ -79,8 +74,7 @@ public:
                        optional_yield y,
                        const DoutPrefixProvider *dpp) = 0;
 
-  virtual int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                 const std::string& key,
+  virtual int store_bucket_instance_info(const std::string& key,
                                  RGWBucketInfo& info,
                                  std::optional<RGWBucketInfo *> orig_info, /* nullopt: orig_info was not fetched,
                                                                               nullptr: orig_info was not found (new bucket instance */
@@ -90,21 +84,18 @@ public:
                                  optional_yield y,
                                  const DoutPrefixProvider *dpp) = 0;
 
-  virtual int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                  const std::string& key,
+  virtual int remove_bucket_instance_info(const std::string& key,
                                  const RGWBucketInfo& bucket_info,
                                   RGWObjVersionTracker *objv_tracker,
                                   optional_yield y,
                                   const DoutPrefixProvider *dpp) = 0;
 
-  virtual int read_bucket_stats(RGWSI_Bucket_X_Ctx& ctx,
-                        const rgw_bucket& bucket,
+  virtual int read_bucket_stats(const rgw_bucket& bucket,
                         RGWBucketEnt *ent,
                         optional_yield y,
                         const DoutPrefixProvider *dpp) = 0;
 
-  virtual int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx,
-                                 std::vector<RGWBucketEnt>& buckets,
+  virtual int read_buckets_stats(std::vector<RGWBucketEnt>& buckets,
                                  optional_yield y,
                                  const DoutPrefixProvider *dpp) = 0;
 };
index 6ee1669d65e23b22da68b1bfe96f29f3aa53b68b..0a9ddda8295e286119f5b498324537a4dd87a9b3 100644 (file)
@@ -214,8 +214,7 @@ int RGWSI_Bucket_SObj::do_start(optional_yield, const DoutPrefixProvider *dpp)
   return 0;
 }
 
-int RGWSI_Bucket_SObj::read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                                   const string& key,
+int RGWSI_Bucket_SObj::read_bucket_entrypoint_info(const string& key,
                                                    RGWBucketEntryPoint *entry_point,
                                                    RGWObjVersionTracker *objv_tracker,
                                                    real_time *pmtime,
@@ -244,8 +243,7 @@ int RGWSI_Bucket_SObj::read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
   return 0;
 }
 
-int RGWSI_Bucket_SObj::store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                                    const string& key,
+int RGWSI_Bucket_SObj::store_bucket_entrypoint_info(const string& key,
                                                     RGWBucketEntryPoint& info,
                                                     bool exclusive,
                                                     real_time mtime,
@@ -262,8 +260,7 @@ int RGWSI_Bucket_SObj::store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
                             objv_tracker, mtime, y, pattrs);
 }
 
-int RGWSI_Bucket_SObj::remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                                     const string& key,
+int RGWSI_Bucket_SObj::remove_bucket_entrypoint_info(const string& key,
                                                      RGWObjVersionTracker *objv_tracker,
                                                      optional_yield y,
                                                      const DoutPrefixProvider *dpp)
@@ -272,8 +269,7 @@ int RGWSI_Bucket_SObj::remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
   return rgw_delete_system_obj(dpp, svc.sysobj, pool, key, objv_tracker, y);
 }
 
-int RGWSI_Bucket_SObj::read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                                 const string& key,
+int RGWSI_Bucket_SObj::read_bucket_instance_info(const string& key,
                                                  RGWBucketInfo *info,
                                                  real_time *pmtime, map<string, bufferlist> *pattrs,
                                                  optional_yield y,
@@ -304,9 +300,8 @@ int RGWSI_Bucket_SObj::read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
   bucket_info_cache_entry e;
   rgw_cache_entry_info ci;
 
-  int ret = do_read_bucket_instance_info(ctx, key,
-                                  &e.info, &e.mtime, &e.attrs,
-                                  &ci, refresh_version, y, dpp);
+  int ret = do_read_bucket_instance_info(key, &e.info, &e.mtime, &e.attrs,
+                                         &ci, refresh_version, y, dpp);
   *info = e.info;
 
   if (ret < 0) {
@@ -343,8 +338,7 @@ int RGWSI_Bucket_SObj::read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
   return 0;
 }
 
-int RGWSI_Bucket_SObj::do_read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                                    const string& key,
+int RGWSI_Bucket_SObj::do_read_bucket_instance_info(const string& key,
                                                     RGWBucketInfo *info,
                                                     real_time *pmtime, map<string, bufferlist> *pattrs,
                                                     rgw_cache_entry_info *cache_info,
@@ -374,8 +368,7 @@ int RGWSI_Bucket_SObj::do_read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
   return 0;
 }
 
-int RGWSI_Bucket_SObj::read_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
-                                        const rgw_bucket& bucket,
+int RGWSI_Bucket_SObj::read_bucket_info(const rgw_bucket& bucket,
                                         RGWBucketInfo *info,
                                         real_time *pmtime,
                                         map<string, bufferlist> *pattrs,
@@ -386,11 +379,8 @@ int RGWSI_Bucket_SObj::read_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
   rgw_cache_entry_info cache_info;
 
   if (!bucket.bucket_id.empty()) {
-    return read_bucket_instance_info(ctx.bi, get_bi_meta_key(bucket),
-                                     info,
-                                     pmtime, pattrs,
-                                     y,
-                                     dpp,
+    return read_bucket_instance_info(get_bi_meta_key(bucket), info,
+                                     pmtime, pattrs, y, dpp,
                                      &cache_info, refresh_version);
   }
 
@@ -423,10 +413,8 @@ int RGWSI_Bucket_SObj::read_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
   real_time ep_mtime;
   RGWObjVersionTracker ot;
   rgw_cache_entry_info entry_cache_info;
-  int ret = read_bucket_entrypoint_info(ctx.ep, bucket_entry,
-                                        &entry_point, &ot, &ep_mtime, pattrs,
-                                        y,
-                                        dpp,
+  int ret = read_bucket_entrypoint_info(bucket_entry, &entry_point, &ot,
+                                        &ep_mtime, pattrs, y, dpp,
                                         &entry_cache_info, refresh_version);
   if (ret < 0) {
     /* only init these fields */
@@ -455,10 +443,8 @@ int RGWSI_Bucket_SObj::read_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
 
   bucket_info_cache_entry e;
 
-  ret = read_bucket_instance_info(ctx.bi, get_bi_meta_key(entry_point.bucket),
-                                  &e.info, &e.mtime, &e.attrs,
-                                  y,
-                                  dpp,
+  ret = read_bucket_instance_info(get_bi_meta_key(entry_point.bucket),
+                                  &e.info, &e.mtime, &e.attrs, y, dpp,
                                   &cache_info, refresh_version);
   *info = e.info;
   if (ret < 0) {
@@ -489,8 +475,7 @@ int RGWSI_Bucket_SObj::read_bucket_info(RGWSI_Bucket_X_Ctx& ctx,
 }
 
 
-int RGWSI_Bucket_SObj::store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                                  const string& key,
+int RGWSI_Bucket_SObj::store_bucket_instance_info(const string& key,
                                                   RGWBucketInfo& info,
                                                   std::optional<RGWBucketInfo *> orig_info,
                                                   bool exclusive,
@@ -512,12 +497,8 @@ int RGWSI_Bucket_SObj::store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
      * we're here because orig_info wasn't passed in
      * we don't have info about what was there before, so need to fetch first
      */
-    int r  = read_bucket_instance_info(ctx,
-                                       key,
-                                       &shared_bucket_info,
-                                       nullptr, nullptr,
-                                       y,
-                                       dpp,
+    int r  = read_bucket_instance_info(key, &shared_bucket_info,
+                                       nullptr, nullptr, y, dpp,
                                        nullptr, boost::none);
     if (r < 0) {
       if (r != -ENOENT) {
@@ -567,8 +548,7 @@ int RGWSI_Bucket_SObj::store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
   return ret;
 }
 
-int RGWSI_Bucket_SObj::remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                                   const string& key,
+int RGWSI_Bucket_SObj::remove_bucket_instance_info(const string& key,
                                                    const RGWBucketInfo& info,
                                                    RGWObjVersionTracker *objv_tracker,
                                                    optional_yield y,
@@ -613,14 +593,13 @@ int RGWSI_Bucket_SObj::read_bucket_stats(const RGWBucketInfo& bucket_info,
   return 0;
 }
 
-int RGWSI_Bucket_SObj::read_bucket_stats(RGWSI_Bucket_X_Ctx& ctx,
-                                         const rgw_bucket& bucket,
+int RGWSI_Bucket_SObj::read_bucket_stats(const rgw_bucket& bucket,
                                          RGWBucketEnt *ent,
                                          optional_yield y,
                                          const DoutPrefixProvider *dpp)
 {
   RGWBucketInfo bucket_info;
-  int ret = read_bucket_info(ctx, bucket, &bucket_info, nullptr, nullptr, boost::none, y, dpp);
+  int ret = read_bucket_info(bucket, &bucket_info, nullptr, nullptr, boost::none, y, dpp);
   if (ret < 0) {
     return ret;
   }
@@ -628,13 +607,12 @@ int RGWSI_Bucket_SObj::read_bucket_stats(RGWSI_Bucket_X_Ctx& ctx,
   return read_bucket_stats(bucket_info, ent, y, dpp);
 }
 
-int RGWSI_Bucket_SObj::read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx,
-                                          std::vector<RGWBucketEnt>& buckets,
+int RGWSI_Bucket_SObj::read_buckets_stats(std::vector<RGWBucketEnt>& buckets,
                                           optional_yield y,
                                           const DoutPrefixProvider *dpp)
 {
   for (auto& ent : buckets) {
-    int r = read_bucket_stats(ctx, ent.bucket, &ent, y, dpp);
+    int r = read_bucket_stats(ent.bucket, &ent, y, dpp);
     if (r < 0) {
       ldpp_dout(dpp, 0) << "ERROR: " << __func__ << "(): read_bucket_stats returned r=" << r << dendl;
       return r;
index 9b95ca18fa4bd38d347d8c59b0870ad423b2a532..60f109197438c9e2afe819ceb2fc81da4d0aa7de 100644 (file)
@@ -53,8 +53,7 @@ class RGWSI_Bucket_SObj : public RGWSI_Bucket
 
   int do_start(optional_yield, const DoutPrefixProvider *dpp) override;
 
-  int do_read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                   const std::string& key,
+  int do_read_bucket_instance_info(const std::string& key,
                                    RGWBucketInfo *info,
                                    real_time *pmtime,
                                    std::map<std::string, bufferlist> *pattrs,
@@ -102,8 +101,7 @@ public:
            RGWSI_Bucket_Sync *_bucket_sync_svc);
 
 
-  int read_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                  const std::string& key,
+  int read_bucket_entrypoint_info(const std::string& key,
                                   RGWBucketEntryPoint *entry_point,
                                   RGWObjVersionTracker *objv_tracker,
                                   real_time *pmtime,
@@ -113,8 +111,7 @@ public:
                                   rgw_cache_entry_info *cache_info = nullptr,
                                   boost::optional<obj_version> refresh_version = boost::none) override;
 
-  int store_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                   const std::string& key,
+  int store_bucket_entrypoint_info(const std::string& key,
                                    RGWBucketEntryPoint& info,
                                    bool exclusive,
                                    real_time mtime,
@@ -123,14 +120,12 @@ public:
                                    optional_yield y,
                                    const DoutPrefixProvider *dpp) override;
 
-  int remove_bucket_entrypoint_info(RGWSI_Bucket_EP_Ctx& ctx,
-                                    const std::string& key,
+  int remove_bucket_entrypoint_info(const std::string& key,
                                     RGWObjVersionTracker *objv_tracker,
                                     optional_yield y,
                                     const DoutPrefixProvider *dpp) override;
 
-  int read_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                const std::string& key,
+  int read_bucket_instance_info(const std::string& key,
                                 RGWBucketInfo *info,
                                 real_time *pmtime,
                                 std::map<std::string, bufferlist> *pattrs,
@@ -139,8 +134,7 @@ public:
                                 rgw_cache_entry_info *cache_info = nullptr,
                                 boost::optional<obj_version> refresh_version = boost::none) override;
 
-  int read_bucket_info(RGWSI_Bucket_X_Ctx& ep_ctx,
-                       const rgw_bucket& bucket,
+  int read_bucket_info(const rgw_bucket& bucket,
                        RGWBucketInfo *info,
                        real_time *pmtime,
                        std::map<std::string, bufferlist> *pattrs,
@@ -148,8 +142,7 @@ public:
                        optional_yield y,
                        const DoutPrefixProvider *dpp) override;
 
-  int store_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                 const std::string& key,
+  int store_bucket_instance_info(const std::string& key,
                                  RGWBucketInfo& info,
                                  std::optional<RGWBucketInfo *> orig_info, /* nullopt: orig_info was not fetched,
                                                                               nullptr: orig_info was not found (new bucket instance */
@@ -159,21 +152,18 @@ public:
                                  optional_yield y,
                                  const DoutPrefixProvider *dpp) override;
 
-  int remove_bucket_instance_info(RGWSI_Bucket_BI_Ctx& ctx,
-                                  const std::string& key,
+  int remove_bucket_instance_info(const std::string& key,
                                   const RGWBucketInfo& bucket_info,
                                   RGWObjVersionTracker *objv_tracker,
                                   optional_yield y,
                                   const DoutPrefixProvider *dpp) override;
 
-  int read_bucket_stats(RGWSI_Bucket_X_Ctx& ctx,
-                        const rgw_bucket& bucket,
+  int read_bucket_stats(const rgw_bucket& bucket,
                         RGWBucketEnt *ent,
                         optional_yield y,
                         const DoutPrefixProvider *dpp) override;
 
-  int read_buckets_stats(RGWSI_Bucket_X_Ctx& ctx,
-                         std::vector<RGWBucketEnt>& buckets,
+  int read_buckets_stats(std::vector<RGWBucketEnt>& buckets,
                          optional_yield y,
                          const DoutPrefixProvider *dpp) override;
 };
index 37dada55ecd83bfedd7a64f7fa3971afb1d4da81..29b2c4936127f16c6b91eed8049168713cea92ef 100644 (file)
@@ -30,8 +30,7 @@ class RGWSI_Bucket_Sync : public RGWServiceInstance
 public:
   RGWSI_Bucket_Sync(CephContext *cct) : RGWServiceInstance(cct) {}
 
-  virtual int get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
-                                 std::optional<rgw_zone_id> zone,
+  virtual int get_policy_handler(std::optional<rgw_zone_id> zone,
                                  std::optional<rgw_bucket> bucket,
                                  RGWBucketSyncPolicyHandlerRef *handler,
                                  optional_yield y,
index ea3398a3f48c93662e88b838ffcf4e3e77064028..cc77ece29aab9296e78c18d1e4dd17ca976e0c35 100644 (file)
@@ -70,8 +70,7 @@ int RGWSI_Bucket_Sync_SObj::do_start(optional_yield, const DoutPrefixProvider *d
   return 0;
 }
 
-void RGWSI_Bucket_Sync_SObj::get_hint_entities(RGWSI_Bucket_X_Ctx& ctx,
-                                               const std::set<rgw_zone_id>& zones,
+void RGWSI_Bucket_Sync_SObj::get_hint_entities(const std::set<rgw_zone_id>& zones,
                                                const std::set<rgw_bucket>& buckets,
                                                std::set<rgw_sync_bucket_entity> *hint_entities,
                                                optional_yield y, const DoutPrefixProvider *dpp)
@@ -82,7 +81,7 @@ void RGWSI_Bucket_Sync_SObj::get_hint_entities(RGWSI_Bucket_X_Ctx& ctx,
 
   for (auto& b : buckets) {
     RGWBucketInfo hint_bucket_info;
-    int ret = svc.bucket_sobj->read_bucket_info(ctx, b, &hint_bucket_info,
+    int ret = svc.bucket_sobj->read_bucket_info(b, &hint_bucket_info,
                                                 nullptr, nullptr, boost::none,
                                                 y, dpp);
     if (ret < 0) {
@@ -100,8 +99,7 @@ void RGWSI_Bucket_Sync_SObj::get_hint_entities(RGWSI_Bucket_X_Ctx& ctx,
   }
 }
 
-int RGWSI_Bucket_Sync_SObj::resolve_policy_hints(RGWSI_Bucket_X_Ctx& ctx,
-                                                 rgw_sync_bucket_entity& self_entity,
+int RGWSI_Bucket_Sync_SObj::resolve_policy_hints(rgw_sync_bucket_entity& self_entity,
                                                  RGWBucketSyncPolicyHandlerRef& handler,
                                                  RGWBucketSyncPolicyHandlerRef& zone_policy_handler,
                                                  std::map<optional_zone_bucket, RGWBucketSyncPolicyHandlerRef>& temp_map,
@@ -119,8 +117,8 @@ int RGWSI_Bucket_Sync_SObj::resolve_policy_hints(RGWSI_Bucket_X_Ctx& ctx,
 
   std::set<rgw_sync_bucket_entity> hint_entities;
 
-  get_hint_entities(ctx, source_zones, handler->get_source_hints(), &hint_entities, y, dpp);
-  get_hint_entities(ctx, target_zones, handler->get_target_hints(), &hint_entities, y, dpp);
+  get_hint_entities(source_zones, handler->get_source_hints(), &hint_entities, y, dpp);
+  get_hint_entities(target_zones, handler->get_target_hints(), &hint_entities, y, dpp);
 
   std::set<rgw_sync_bucket_pipe> resolved_sources;
   std::set<rgw_sync_bucket_pipe> resolved_dests;
@@ -140,7 +138,7 @@ int RGWSI_Bucket_Sync_SObj::resolve_policy_hints(RGWSI_Bucket_X_Ctx& ctx,
     if (iter != temp_map.end()) {
       hint_bucket_handler = iter->second;
     } else {
-      int r = do_get_policy_handler(ctx, zid, hint_bucket, temp_map, &hint_bucket_handler, y, dpp);
+      int r = do_get_policy_handler(zid, hint_bucket, temp_map, &hint_bucket_handler, y, dpp);
       if (r < 0) {
         ldpp_dout(dpp, 20) << "could not get bucket sync policy handler for hint bucket=" << hint_bucket << " ... skipping" << dendl;
         continue;
@@ -158,8 +156,7 @@ int RGWSI_Bucket_Sync_SObj::resolve_policy_hints(RGWSI_Bucket_X_Ctx& ctx,
   return 0;
 }
 
-int RGWSI_Bucket_Sync_SObj::do_get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
-                                                  std::optional<rgw_zone_id> zone,
+int RGWSI_Bucket_Sync_SObj::do_get_policy_handler(std::optional<rgw_zone_id> zone,
                                                   std::optional<rgw_bucket> _bucket,
                                                   std::map<optional_zone_bucket, RGWBucketSyncPolicyHandlerRef>& temp_map,
                                                   RGWBucketSyncPolicyHandlerRef *handler,
@@ -175,8 +172,7 @@ int RGWSI_Bucket_Sync_SObj::do_get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
 
   if (bucket.bucket_id.empty()) {
     RGWBucketEntryPoint ep_info;
-    int ret = svc.bucket_sobj->read_bucket_entrypoint_info(ctx.ep,
-                                                           RGWSI_Bucket::get_entrypoint_meta_key(bucket),
+    int ret = svc.bucket_sobj->read_bucket_entrypoint_info(RGWSI_Bucket::get_entrypoint_meta_key(bucket),
                                                            &ep_info,
                                                            nullptr, /* objv_tracker */
                                                            nullptr, /* mtime */
@@ -217,8 +213,7 @@ int RGWSI_Bucket_Sync_SObj::do_get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
   RGWBucketInfo bucket_info;
   map<string, bufferlist> attrs;
 
-  int r = svc.bucket_sobj->read_bucket_instance_info(ctx.bi,
-                                                     bucket_key,
+  int r = svc.bucket_sobj->read_bucket_instance_info(bucket_key,
                                                      &bucket_info,
                                                      nullptr,
                                                      &attrs,
@@ -250,7 +245,7 @@ int RGWSI_Bucket_Sync_SObj::do_get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
 
   rgw_sync_bucket_entity self_entity(zone.value_or(svc.zone->zone_id()), bucket);
 
-  r = resolve_policy_hints(ctx, self_entity,
+  r = resolve_policy_hints(self_entity,
                            e.handler,
                            zone_policy_handler,
                            temp_map, y, dpp);
@@ -268,15 +263,14 @@ int RGWSI_Bucket_Sync_SObj::do_get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
   return 0;
 }
 
-int RGWSI_Bucket_Sync_SObj::get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
-                                               std::optional<rgw_zone_id> zone,
+int RGWSI_Bucket_Sync_SObj::get_policy_handler(std::optional<rgw_zone_id> zone,
                                                std::optional<rgw_bucket> _bucket,
                                                RGWBucketSyncPolicyHandlerRef *handler,
                                                optional_yield y,
                                                const DoutPrefixProvider *dpp)
 {
   std::map<optional_zone_bucket, RGWBucketSyncPolicyHandlerRef> temp_map;
-  return do_get_policy_handler(ctx, zone, _bucket, temp_map, handler, y, dpp);
+  return do_get_policy_handler(zone, _bucket, temp_map, handler, y, dpp);
 }
 
 static bool diff_sets(std::set<rgw_bucket>& orig_set,
index 779df7b996ca61a49e34684abda14d29a36eb316..bf7f3e527390cf0432c5944615d9fcd9bc179454 100644 (file)
@@ -63,20 +63,17 @@ class RGWSI_Bucket_Sync_SObj : public RGWSI_Bucket_Sync
     }
   };
 
-  void get_hint_entities(RGWSI_Bucket_X_Ctx& ctx,
-                         const std::set<rgw_zone_id>& zone_names,
+  void get_hint_entities(const std::set<rgw_zone_id>& zone_names,
                          const std::set<rgw_bucket>& buckets,
                          std::set<rgw_sync_bucket_entity> *hint_entities,
                          optional_yield y, const DoutPrefixProvider *);
-  int resolve_policy_hints(RGWSI_Bucket_X_Ctx& ctx,
-                           rgw_sync_bucket_entity& self_entity,
+  int resolve_policy_hints(rgw_sync_bucket_entity& self_entity,
                            RGWBucketSyncPolicyHandlerRef& handler,
                            RGWBucketSyncPolicyHandlerRef& zone_policy_handler,
                            std::map<optional_zone_bucket, RGWBucketSyncPolicyHandlerRef>& temp_map,
                            optional_yield y,
                            const DoutPrefixProvider *dpp);
-  int do_get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
-                            std::optional<rgw_zone_id> zone,
+  int do_get_policy_handler(std::optional<rgw_zone_id> zone,
                             std::optional<rgw_bucket> _bucket,
                             std::map<optional_zone_bucket, RGWBucketSyncPolicyHandlerRef>& temp_map,
                             RGWBucketSyncPolicyHandlerRef *handler,
@@ -99,8 +96,7 @@ public:
             RGWSI_Bucket_SObj *_bucket_sobj_svc);
 
 
-  int get_policy_handler(RGWSI_Bucket_X_Ctx& ctx,
-                         std::optional<rgw_zone_id> zone,
+  int get_policy_handler(std::optional<rgw_zone_id> zone,
                          std::optional<rgw_bucket> bucket,
                          RGWBucketSyncPolicyHandlerRef *handler,
                          optional_yield y,