mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-22 07:56:32 -05:00
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:
parent
2e4c6c5fd1
commit
538467b86d
327 changed files with 6691 additions and 3036 deletions
|
|
@ -21,16 +21,17 @@
|
|||
#include "fs_write.hpp"
|
||||
#include "ugid.hpp"
|
||||
|
||||
#include "fuse.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <fuse.h>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
typedef int (*WriteFunc)(const int,const void*,const size_t,const off_t);
|
||||
|
||||
|
||||
namespace l
|
||||
{
|
||||
static
|
||||
|
|
@ -85,13 +86,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue