]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_lua.cc
import ceph pacific 16.2.5
[ceph.git] / ceph / src / rgw / rgw_lua.cc
index 5be70c8dda8919aa65eef0991a15edfa3fc29e88..987182c664645e17230fa6212f84299bb8185754 100644 (file)
@@ -97,7 +97,7 @@ int read_script(rgw::sal::RGWRadosStore* store, const std::string& tenant, optio
   return 0;
 }
 
-int write_script(rgw::sal::RGWRadosStore* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script)
+int write_script(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore* store, const std::string& tenant, optional_yield y, context ctx, const std::string& script)
 {
   RGWSysObjectCtx obj_ctx(store->svc()->sysobj->init_obj_ctx());
   RGWObjVersionTracker objv_tracker;
@@ -108,6 +108,7 @@ int write_script(rgw::sal::RGWRadosStore* store, const std::string& tenant, opti
   ceph::encode(script, bl);
 
   const auto rc = rgw_put_system_obj(
+      dpp,
       obj_ctx,
       obj.pool,
       obj.oid,
@@ -124,13 +125,14 @@ int write_script(rgw::sal::RGWRadosStore* store, const std::string& tenant, opti
   return 0;
 }
 
-int delete_script(rgw::sal::RGWRadosStore* store, const std::string& tenant, optional_yield y, context ctx)
+int delete_script(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore* store, const std::string& tenant, optional_yield y, context ctx)
 {
   RGWObjVersionTracker objv_tracker;
 
   rgw_raw_obj obj(store->svc()->zone->get_zone_params().log_pool, script_oid(ctx, tenant));
 
   const auto rc = rgw_delete_system_obj(
+      dpp,
       store->svc()->sysobj, 
       obj.pool,
       obj.oid,
@@ -150,7 +152,7 @@ const std::string PACKAGE_LIST_OBJECT_NAME = "lua_package_allowlist";
 
 namespace bp = boost::process;
 
-int add_package(rgw::sal::RGWRadosStore* store, optional_yield y, const std::string& package_name, bool allow_compilation) {
+int add_package(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore* store, optional_yield y, const std::string& package_name, bool allow_compilation) {
   // verify that luarocks can load this oackage
   const auto p = bp::search_path("luarocks");
   if (p.empty()) {
@@ -183,7 +185,7 @@ int add_package(rgw::sal::RGWRadosStore* store, optional_yield y, const std::str
   std::map<std::string, bufferlist> new_package{{package_name, empty_bl}};
   librados::ObjectWriteOperation op;
   op.omap_set(new_package);
-  ret = rgw_rados_operate(*(store->getRados()->get_lc_pool_ctx()), 
+  ret = rgw_rados_operate(dpp, *(store->getRados()->get_lc_pool_ctx()), 
       PACKAGE_LIST_OBJECT_NAME, &op, y);
 
   if (ret < 0) {
@@ -192,10 +194,10 @@ int add_package(rgw::sal::RGWRadosStore* store, optional_yield y, const std::str
   return 0;
 }
 
-int remove_package(rgw::sal::RGWRadosStore* store, optional_yield y, const std::string& package_name) {
+int remove_package(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore* store, optional_yield y, const std::string& package_name) {
   librados::ObjectWriteOperation op;
   op.omap_rm_keys(std::set<std::string>({package_name}));
-  const auto ret = rgw_rados_operate(*(store->getRados()->get_lc_pool_ctx()), 
+  const auto ret = rgw_rados_operate(dpp, *(store->getRados()->get_lc_pool_ctx()), 
     PACKAGE_LIST_OBJECT_NAME, &op, y);
 
   if (ret < 0) {
@@ -205,7 +207,7 @@ int remove_package(rgw::sal::RGWRadosStore* store, optional_yield y, const std::
   return 0;
 }
 
-int list_packages(rgw::sal::RGWRadosStore* store, optional_yield y, packages_t& packages) {
+int list_packages(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore* store, optional_yield y, packages_t& packages) {
   constexpr auto max_chunk = 1024U;
   std::string start_after;
   bool more = true;
@@ -214,7 +216,7 @@ int list_packages(rgw::sal::RGWRadosStore* store, optional_yield y, packages_t&
     librados::ObjectReadOperation op;
     packages_t packages_chunk;
     op.omap_get_keys2(start_after, max_chunk, &packages_chunk, &more, &rval);
-    const auto ret = rgw_rados_operate(*(store->getRados()->get_lc_pool_ctx()),
+    const auto ret = rgw_rados_operate(dpp, *(store->getRados()->get_lc_pool_ctx()),
       PACKAGE_LIST_OBJECT_NAME, &op, nullptr, y);
   
     if (ret < 0) {
@@ -227,7 +229,7 @@ int list_packages(rgw::sal::RGWRadosStore* store, optional_yield y, packages_t&
   return 0;
 }
 
-int install_packages(rgw::sal::RGWRadosStore* store, optional_yield y, packages_t& failed_packages, std::string& output) {
+int install_packages(const DoutPrefixProvider *dpp, rgw::sal::RGWRadosStore* store, optional_yield y, packages_t& failed_packages, std::string& output) {
   // luarocks directory cleanup
   boost::system::error_code ec;
   const auto& luarocks_path = store->get_luarocks_path();
@@ -240,7 +242,7 @@ int install_packages(rgw::sal::RGWRadosStore* store, optional_yield y, packages_
   }
 
   packages_t packages;
-  auto ret = list_packages(store, y, packages);
+  auto ret = list_packages(dpp, store, y, packages);
   if (ret == -ENOENT) {
     // allowlist is empty 
     return 0;