diff --git a/src/impl/autotierfs/fuseOps/fusePassthrough.cpp b/src/impl/autotierfs/fuseOps/fusePassthrough.cpp index 68a420d4..8a02a667 100644 --- a/src/impl/autotierfs/fuseOps/fusePassthrough.cpp +++ b/src/impl/autotierfs/fuseOps/fusePassthrough.cpp @@ -25,21 +25,15 @@ #include "fuseOps.hpp" #include "config.hpp" #include "alert.hpp" - -namespace Global{ - fs::path config_path_; - fs::path mount_point_; - ConfigOverrides config_overrides_; -} +#include "tierEngine.hpp" FusePassthrough::FusePassthrough(const fs::path &config_path, const ConfigOverrides &config_overrides){ - Global::config_path_ = config_path; - Global::config_overrides_ = config_overrides; + fuse_ops::autotier_ptr = new TierEngine(config_path, config_overrides); } // methods int FusePassthrough::mount_fs(fs::path mountpoint, char *fuse_opts){ - Global::mount_point_ = mountpoint; // global + fuse_ops::autotier_ptr->mount_point(mountpoint); Logging::log.message("Mounting filesystem", 2); static const struct fuse_operations at_oper = { .getattr = fuse_ops::getattr, diff --git a/src/impl/autotierfs/fuseOps/init.cpp b/src/impl/autotierfs/fuseOps/init.cpp index 7a285ed0..6b951c66 100644 --- a/src/impl/autotierfs/fuseOps/init.cpp +++ b/src/impl/autotierfs/fuseOps/init.cpp @@ -30,6 +30,8 @@ extern "C" { } namespace fuse_ops{ + TierEngine *autotier_ptr; + void *init(struct fuse_conn_info *conn, struct fuse_config *cfg){ (void) conn; cfg->use_ino = 1; @@ -49,11 +51,7 @@ namespace fuse_ops{ FusePriv *priv = new FusePriv; - priv->autotier_ = new TierEngine(Global::config_path_, Global::config_overrides_); - - priv->mount_point_ = Global::mount_point_; - - priv->autotier_->mount_point(Global::mount_point_); + priv->autotier_ = autotier_ptr; for(std::list::iterator tptr = priv->autotier_->get_tiers().begin(); tptr != priv->autotier_->get_tiers().end(); ++tptr) priv->tiers_.push_back(&(*tptr)); diff --git a/src/incl/fuseOps.hpp b/src/incl/fuseOps.hpp index a6862d4b..f576c5f9 100644 --- a/src/incl/fuseOps.hpp +++ b/src/incl/fuseOps.hpp @@ -102,6 +102,8 @@ namespace l{ } namespace fuse_ops{ + extern TierEngine *autotier_ptr; + int getattr(const char *path, struct stat *stbuf, struct fuse_file_info *fi); int readlink(const char *path, char *buf, size_t size);