#define dout_prefix *_dout << "AuthRegistry(" << this << ") "
using std::string;
+using namespace std::literals;
AuthRegistry::AuthRegistry(CephContext *cct)
: cct(cct)
}
}
-const char** AuthRegistry::get_tracked_conf_keys() const
+std::vector<std::string> AuthRegistry::get_tracked_keys() const noexcept
{
- static const char *keys[] = {
- "auth_supported",
- "auth_client_required",
- "auth_cluster_required",
- "auth_service_required",
- "ms_mon_cluster_mode",
- "ms_mon_service_mode",
- "ms_mon_client_mode",
- "ms_cluster_mode",
- "ms_service_mode",
- "ms_client_mode",
- "keyring",
- NULL
+ return {
+ "auth_supported"s,
+ "auth_client_required"s,
+ "auth_cluster_required"s,
+ "auth_service_required"s,
+ "ms_mon_cluster_mode"s,
+ "ms_mon_service_mode"s,
+ "ms_mon_client_mode"s,
+ "ms_cluster_mode"s,
+ "ms_service_mode"s,
+ "ms_client_mode"s,
+ "keyring"s
};
- return keys;
}
void AuthRegistry::handle_conf_change(
using namespace std::literals;
using namespace TOPNSPC::common;
+using namespace std::literals;
namespace bs = boost::system;
namespace ca = ceph::async;
cap_epoch_barrier = e;
}
-const char** Client::get_tracked_conf_keys() const
-{
-#define KEYS \
- "client_acl_type", \
- "client_cache_mid", \
- "client_cache_size", \
- "client_caps_release_delay", \
- "client_deleg_break_on_open", \
- "client_deleg_timeout", \
- "client_mount_timeout", \
- "client_oc_max_dirty", \
- "client_oc_max_dirty_age", \
- "client_oc_max_objects", \
- "client_oc_size", \
- "client_oc_target_dirty", \
- "client_permissions", \
+std::vector<std::string> Client::get_tracked_keys() const noexcept
+{
+ static constexpr auto as_sv = std::to_array<std::string_view>({
+ "client_acl_type",
+ "client_cache_mid",
+ "client_cache_size",
+ "client_caps_release_delay",
+ "client_deleg_break_on_open",
+ "client_deleg_timeout",
+ "client_mount_timeout",
+ "client_oc_max_dirty",
+ "client_oc_max_dirty_age",
+ "client_oc_max_objects",
+ "client_oc_size",
+ "client_oc_target_dirty",
+ "client_permissions",
"fuse_default_permissions"
-
- constexpr bool is_sorted = [] () constexpr {
- constexpr auto arr = std::to_array<std::string_view>({KEYS});
- for (unsigned long i = 0; i < arr.size()-1; ++i) {
- if (arr[i] > arr[i+1]) {
- return false;
- }
- }
- return true;
- }();
- static_assert(is_sorted, "keys are not sorted!");
-
- static char const* keys[] = {KEYS, nullptr};
-
- return keys;
+ });
+ static_assert(std::is_sorted(begin(as_sv), end(as_sv)));
+ return {begin(as_sv), end(as_sv)};
}
void Client::handle_conf_change(const ConfigProxy& conf,
int ll_register_callbacks2(struct ceph_client_callback_args *args);
std::pair<int, bool> test_dentry_handling(bool can_invalidate);
- const char** get_tracked_conf_keys() const override;
+ std::vector<std::string> get_tracked_keys() const noexcept override;
void handle_conf_change(const ConfigProxy& conf,
const std::set <std::string> &changed) override;
uint32_t get_deleg_timeout() { return deleg_timeout; }