rework policy code

This commit is contained in:
Antonio SJ Musumeci 2014-05-27 21:21:45 -04:00
parent 345d0bbdc4
commit aab90b0503
35 changed files with 983 additions and 991 deletions

View file

@ -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);