config: rework global config, remove rwlock, make branches RCU like

Also added unit tests. Should have done separately but found a number of bugs.
This commit is contained in:
Antonio SJ Musumeci 2020-12-19 15:06:08 -05:00
parent 2e4c6c5fd1
commit 538467b86d
327 changed files with 6691 additions and 3036 deletions

View file

@ -31,6 +31,7 @@
using std::string;
using std::vector;
namespace l
{
static
@ -67,13 +68,13 @@ namespace l
int err_)
{
int rv;
const Config &config = Config::ro();
Config::Read cfg;
if(config.moveonenospc.enabled == false)
if(cfg->moveonenospc.enabled == false)
return err_;
rv = fs::movefile_as_root(config.moveonenospc.policy,
config.branches,
rv = fs::movefile_as_root(cfg->moveonenospc.policy,
cfg->branches,
fi_->fusepath,
&fi_->fd);
if(rv == -1)