mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-03 05:10:14 -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,7 +21,7 @@
|
|||
#include "policy_rv.hpp"
|
||||
#include "ugid.hpp"
|
||||
|
||||
#include <fuse.h>
|
||||
#include "fuse.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
@ -84,8 +84,8 @@ namespace l
|
|||
|
||||
static
|
||||
int
|
||||
removexattr(Policy::Func::Action actionFunc_,
|
||||
Policy::Func::Search searchFunc_,
|
||||
removexattr(const Policy::Action &actionFunc_,
|
||||
const Policy::Search &searchFunc_,
|
||||
const Branches &branches_,
|
||||
const char *fusepath_,
|
||||
const char *attrname_)
|
||||
|
|
@ -119,19 +119,20 @@ namespace FUSE
|
|||
removexattr(const char *fusepath_,
|
||||
const char *attrname_)
|
||||
{
|
||||
const Config &config = Config::ro();
|
||||
Config::Read cfg;
|
||||
|
||||
if(fusepath_ == config.controlfile)
|
||||
if(fusepath_ == CONTROLFILE)
|
||||
return -ENOATTR;
|
||||
if(config.xattr.to_int())
|
||||
return -config.xattr.to_int();
|
||||
|
||||
if(cfg->xattr.to_int())
|
||||
return -cfg->xattr.to_int();
|
||||
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
|
||||
return l::removexattr(config.func.removexattr.policy,
|
||||
config.func.getxattr.policy,
|
||||
config.branches,
|
||||
return l::removexattr(cfg->func.removexattr.policy,
|
||||
cfg->func.getxattr.policy,
|
||||
cfg->branches,
|
||||
fusepath_,
|
||||
attrname_);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue