mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 06:56:27 -05:00
rework policy code
This commit is contained in:
parent
345d0bbdc4
commit
aab90b0503
35 changed files with 983 additions and 991 deletions
|
|
@ -40,15 +40,15 @@ using mergerfs::Policy;
|
|||
|
||||
static
|
||||
int
|
||||
_removexattr(const Policy::Action::Func searchFunc,
|
||||
const vector<string> &srcmounts,
|
||||
const string fusepath,
|
||||
const char *attrname)
|
||||
_removexattr(const fs::SearchFunc searchFunc,
|
||||
const vector<string> &srcmounts,
|
||||
const string fusepath,
|
||||
const char *attrname)
|
||||
{
|
||||
#ifndef WITHOUT_XATTR
|
||||
int rv;
|
||||
int error;
|
||||
vector<fs::Path> paths;
|
||||
fs::PathVector paths;
|
||||
|
||||
searchFunc(srcmounts,fusepath,paths);
|
||||
if(paths.empty())
|
||||
|
|
@ -56,7 +56,7 @@ _removexattr(const Policy::Action::Func searchFunc,
|
|||
|
||||
rv = -1;
|
||||
error = 0;
|
||||
for(vector<fs::Path>::const_iterator
|
||||
for(fs::PathVector::const_iterator
|
||||
i = paths.begin(), ei = paths.end(); i != ei; ++i)
|
||||
{
|
||||
rv &= ::lremovexattr(i->full.c_str(),attrname);
|
||||
|
|
@ -84,7 +84,7 @@ namespace mergerfs
|
|||
if(fusepath == config.controlfile)
|
||||
return -ENOTSUP;
|
||||
|
||||
return _removexattr(config.policy.action,
|
||||
return _removexattr(*config.action,
|
||||
config.srcmounts,
|
||||
fusepath,
|
||||
attrname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue