mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-01 20:36:37 -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
|
|
@ -22,12 +22,12 @@
|
|||
#include "symlinkify.hpp"
|
||||
#include "ugid.hpp"
|
||||
|
||||
#include <fuse.h>
|
||||
#include "fuse.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
|
||||
namespace l
|
||||
{
|
||||
|
|
@ -92,7 +92,7 @@ namespace l
|
|||
|
||||
static
|
||||
int
|
||||
readlink(Policy::Func::Search searchFunc_,
|
||||
readlink(const Policy::Search &searchFunc_,
|
||||
const Branches &branches_,
|
||||
const char *fusepath_,
|
||||
char *buf_,
|
||||
|
|
@ -101,7 +101,7 @@ namespace l
|
|||
const time_t symlinkify_timeout_)
|
||||
{
|
||||
int rv;
|
||||
vector<string> basepaths;
|
||||
StrVec basepaths;
|
||||
|
||||
rv = searchFunc_(branches_,fusepath_,&basepaths);
|
||||
if(rv == -1)
|
||||
|
|
@ -119,16 +119,16 @@ namespace FUSE
|
|||
char *buf_,
|
||||
size_t size_)
|
||||
{
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const Config &config = Config::ro();
|
||||
Config::Read cfg;
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
|
||||
return l::readlink(config.func.readlink.policy,
|
||||
config.branches,
|
||||
return l::readlink(cfg->func.readlink.policy,
|
||||
cfg->branches,
|
||||
fusepath_,
|
||||
buf_,
|
||||
size_,
|
||||
config.symlinkify,
|
||||
config.symlinkify_timeout);
|
||||
cfg->symlinkify,
|
||||
cfg->symlinkify_timeout);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue