diff --git a/src/config.cpp b/src/config.cpp index 2f7c495b..7339808e 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -63,10 +63,13 @@ namespace l IFERT("mount"); IFERT("nullrw"); IFERT("pid"); + IFERT("pin-threads"); + IFERT("process-thread-count"); + IFERT("read-thread-count"); IFERT("readdirplus"); + IFERT("scheduling-priority"); IFERT("threads"); IFERT("version"); - IFERT("scheduling-priority"); return false; } @@ -118,9 +121,11 @@ Config::Config() symlinkify_timeout(3600), fuse_read_thread_count(-1), fuse_process_thread_count(-1), + fuse_pin_threads("false"), version(MERGERFS_VERSION), writeback_cache(false), - xattr(XAttr::ENUM::PASSTHROUGH) + xattr(XAttr::ENUM::PASSTHROUGH), + _initialized(false) { _map["async_read"] = &async_read; _map["auto_cache"] = &auto_cache; @@ -176,6 +181,7 @@ Config::Config() _map["nfsopenhack"] = &nfsopenhack; _map["nullrw"] = &nullrw; _map["pid"] = &pid; + _map["pin-threads"] = &fuse_pin_threads; _map["posix_acl"] = &posix_acl; _map["readahead"] = &readahead; // _map["readdir"] = &readdir; @@ -287,7 +293,7 @@ int Config::set(const std::string &key_, const std::string &value_) { - if(l::readonly(key_)) + if(_initialized && l::readonly(key_)) return -EROFS; return set_raw(key_,value_); @@ -362,6 +368,12 @@ Config::from_file(const std::string &filepath_, return rv; } +void +Config::finish_initializing() +{ + _initialized = true; +} + std::ostream& operator<<(std::ostream &os_, const Config &c_) diff --git a/src/config.hpp b/src/config.hpp index 40b98d0a..ab2270b2 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -146,11 +146,18 @@ public: ConfigUINT64 symlinkify_timeout; ConfigINT fuse_read_thread_count; ConfigINT fuse_process_thread_count; + ConfigSTR fuse_pin_threads; ConfigSTR version; ConfigBOOL writeback_cache; XAttr xattr; +private: + bool _initialized; + +public: + void finish_initializing(); + public: friend std::ostream& operator<<(std::ostream &s, const Config &c); diff --git a/src/option_parser.cpp b/src/option_parser.cpp index e18fe1dd..b459eb53 100644 --- a/src/option_parser.cpp +++ b/src/option_parser.cpp @@ -82,6 +82,7 @@ set_fuse_threads(Config::Write &cfg_, { set_kv_option("read-thread-count",cfg_->fuse_read_thread_count.to_string(),args_); set_kv_option("process-thread-count",cfg_->fuse_process_thread_count.to_string(),args_); + set_kv_option("pin-threads",cfg_->fuse_pin_threads.to_string(),args_); } static @@ -135,7 +136,7 @@ should_ignore(const std::string &key_) "splice_move", "splice_read", "splice_write", - "use_ino" + "use_ino", }; return (IGNORED_KEYS.find(key_) != IGNORED_KEYS.end()); @@ -431,5 +432,7 @@ namespace options set_fsname(cfg,args_); set_subtype(args_); set_fuse_threads(cfg,args_); + + cfg->finish_initializing(); } }