summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_lua.cc
diff options
context:
space:
mode:
authorAli Maredia <amaredia@redhat.com>2021-01-30 06:47:55 +0100
committerAli Maredia <amaredia@redhat.com>2021-05-04 22:28:11 +0200
commit6cfc2ce2ce669e139acb682898c53c5602075e31 (patch)
tree27e7deee0a5a6fc3775c5e4009c74fd7decf9917 /src/rgw/rgw_lua.cc
parentMerge pull request #41152 from linuxbox2/wip-restore-rgw-lua (diff)
downloadceph-6cfc2ce2ce669e139acb682898c53c5602075e31.tar.xz
ceph-6cfc2ce2ce669e139acb682898c53c5602075e31.zip
rgw: add DPP's to logging for most ops
This commit contains the following major changes: - Most log output lines for major ops now have DoutPrefixProviders. - Create new macro ldpp_subdout. This macro is meant as a replacement for lsubdout for headerfiles that do not define the rgw subsys. - Changes to RGWObjManifest begin and end iterators. - Make it so that rgw_dencoder.cc should only contain the logic related to encoding. Also add dpp to ldouts and lderr's already using req_state and replace sync_env/env->dpp's with dpp's Signed-off-by: Ali Maredia <amaredia@redhat.com> Signed-off-by: Kalpesh Pandya <kapandya@redhat.com> Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_lua.cc')
-rw-r--r--src/rgw/rgw_lua.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rgw/rgw_lua.cc b/src/rgw/rgw_lua.cc
index 384ef2787c4..7d5ba3635ed 100644
--- a/src/rgw/rgw_lua.cc
+++ b/src/rgw/rgw_lua.cc
@@ -90,8 +90,8 @@ const std::string PACKAGE_LIST_OBJECT_NAME = "lua_package_allowlist";
namespace bp = boost::process;
-int add_package(rgw::sal::Store* store, optional_yield y, const std::string& package_name, bool allow_compilation) {
- // verify that luarocks can load this oackage
+int add_package(const DoutPrefixProvider *dpp, rgw::sal::Store* store, optional_yield y, const std::string& package_name, bool allow_compilation) {
+ // verify that luarocks can load this package
const auto p = bp::search_path("luarocks");
if (p.empty()) {
return -ECHILD;
@@ -123,7 +123,7 @@ int add_package(rgw::sal::Store* store, optional_yield y, const std::string& pac
std::map<std::string, bufferlist> new_package{{package_name, empty_bl}};
librados::ObjectWriteOperation op;
op.omap_set(new_package);
- ret = rgw_rados_operate(*(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
+ ret = rgw_rados_operate(dpp, *(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
PACKAGE_LIST_OBJECT_NAME, &op, y);
if (ret < 0) {
@@ -132,10 +132,10 @@ int add_package(rgw::sal::Store* store, optional_yield y, const std::string& pac
return 0;
}
-int remove_package(rgw::sal::Store* store, optional_yield y, const std::string& package_name) {
+int remove_package(const DoutPrefixProvider *dpp, rgw::sal::Store* 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(*(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
+ const auto ret = rgw_rados_operate(dpp, *(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
PACKAGE_LIST_OBJECT_NAME, &op, y);
if (ret < 0) {
@@ -145,7 +145,7 @@ int remove_package(rgw::sal::Store* store, optional_yield y, const std::string&
return 0;
}
-int list_packages(rgw::sal::Store* store, optional_yield y, packages_t& packages) {
+int list_packages(const DoutPrefixProvider *dpp, rgw::sal::Store* store, optional_yield y, packages_t& packages) {
constexpr auto max_chunk = 1024U;
std::string start_after;
bool more = true;
@@ -154,7 +154,7 @@ int list_packages(rgw::sal::Store* store, optional_yield y, packages_t& packages
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(*(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
+ const auto ret = rgw_rados_operate(dpp, *(static_cast<rgw::sal::RadosStore*>(store)->getRados()->get_lc_pool_ctx()),
PACKAGE_LIST_OBJECT_NAME, &op, nullptr, y);
if (ret < 0) {
@@ -167,7 +167,7 @@ int list_packages(rgw::sal::Store* store, optional_yield y, packages_t& packages
return 0;
}
-int install_packages(rgw::sal::Store* store, optional_yield y, packages_t& failed_packages, std::string& output) {
+int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Store* 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();
@@ -180,7 +180,7 @@ int install_packages(rgw::sal::Store* store, optional_yield y, packages_t& faile
}
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;