Loading ifs/include/preload/preload_context.hpp +4 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ class PreloadContext { std::vector<std::string> mountdir_components_; std::string mountdir_; std::string daemon_addr_str_; bool initialized_; bool interception_enabled_; public: static PreloadContext* getInstance() { Loading Loading @@ -91,8 +91,9 @@ class PreloadContext { std::shared_ptr<Distributor> distributor() const; const std::shared_ptr<FsConfig>& fs_conf() const; void initialized(const bool& flag); bool initialized() const; void enable_interception(); void disable_interception(); bool interception_enabled() const; }; Loading ifs/src/preload/intcp_functions.cpp +84 −84 File changed.Preview size limit exceeded, changes collapsed. Show changes ifs/src/preload/preload.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ void init_preload() { } else { CTX->log()->info("{}() mountdir '{}' loaded", __func__, CTX->mountdir()); } CTX->initialized(true); CTX->enable_interception(); CTX->log()->debug("{}() exit", __func__); } Loading @@ -211,6 +211,7 @@ void init_preload() { * Called last when preload library is used with the LD_PRELOAD environment variable */ void destroy_preload() { CTX->disable_interception(); if (ld_margo_rpc_id == nullptr) { CTX->log()->debug("{}() No services in preload library used. Nothing to shut down.", __func__); return; Loading ifs/src/preload/preload_context.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ RelativizeStatus PreloadContext::relativize_fd_path(int dirfd, bool resolve_last_link) const { // Relativize path should be called only after the library constructor has been executed assert(initialized_); assert(interception_enabled_); // If we run the constructor we also already setup the mountdir assert(!mountdir_.empty()); Loading Loading @@ -100,7 +100,7 @@ RelativizeStatus PreloadContext::relativize_fd_path(int dirfd, bool PreloadContext::relativize_path(const char * raw_path, std::string& relative_path, bool resolve_last_link) const { // Relativize path should be called only after the library constructor has been executed assert(initialized_); assert(interception_enabled_); // If we run the constructor we also already setup the mountdir assert(!mountdir_.empty()); Loading Loading @@ -136,10 +136,15 @@ const std::shared_ptr<FsConfig>& PreloadContext::fs_conf() const { return fs_conf_; } void PreloadContext::initialized(const bool& flag) { initialized_ = flag; void PreloadContext::enable_interception() { interception_enabled_ = true; } bool PreloadContext::initialized() const { return initialized_; void PreloadContext::disable_interception() { interception_enabled_ = false; } bool PreloadContext::interception_enabled() const { return interception_enabled_; } Loading
ifs/include/preload/preload_context.hpp +4 −3 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ class PreloadContext { std::vector<std::string> mountdir_components_; std::string mountdir_; std::string daemon_addr_str_; bool initialized_; bool interception_enabled_; public: static PreloadContext* getInstance() { Loading Loading @@ -91,8 +91,9 @@ class PreloadContext { std::shared_ptr<Distributor> distributor() const; const std::shared_ptr<FsConfig>& fs_conf() const; void initialized(const bool& flag); bool initialized() const; void enable_interception(); void disable_interception(); bool interception_enabled() const; }; Loading
ifs/src/preload/intcp_functions.cpp +84 −84 File changed.Preview size limit exceeded, changes collapsed. Show changes
ifs/src/preload/preload.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ void init_preload() { } else { CTX->log()->info("{}() mountdir '{}' loaded", __func__, CTX->mountdir()); } CTX->initialized(true); CTX->enable_interception(); CTX->log()->debug("{}() exit", __func__); } Loading @@ -211,6 +211,7 @@ void init_preload() { * Called last when preload library is used with the LD_PRELOAD environment variable */ void destroy_preload() { CTX->disable_interception(); if (ld_margo_rpc_id == nullptr) { CTX->log()->debug("{}() No services in preload library used. Nothing to shut down.", __func__); return; Loading
ifs/src/preload/preload_context.cpp +11 −6 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ RelativizeStatus PreloadContext::relativize_fd_path(int dirfd, bool resolve_last_link) const { // Relativize path should be called only after the library constructor has been executed assert(initialized_); assert(interception_enabled_); // If we run the constructor we also already setup the mountdir assert(!mountdir_.empty()); Loading Loading @@ -100,7 +100,7 @@ RelativizeStatus PreloadContext::relativize_fd_path(int dirfd, bool PreloadContext::relativize_path(const char * raw_path, std::string& relative_path, bool resolve_last_link) const { // Relativize path should be called only after the library constructor has been executed assert(initialized_); assert(interception_enabled_); // If we run the constructor we also already setup the mountdir assert(!mountdir_.empty()); Loading Loading @@ -136,10 +136,15 @@ const std::shared_ptr<FsConfig>& PreloadContext::fs_conf() const { return fs_conf_; } void PreloadContext::initialized(const bool& flag) { initialized_ = flag; void PreloadContext::enable_interception() { interception_enabled_ = true; } bool PreloadContext::initialized() const { return initialized_; void PreloadContext::disable_interception() { interception_enabled_ = false; } bool PreloadContext::interception_enabled() const { return interception_enabled_; }