mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
rework policy code
This commit is contained in:
parent
345d0bbdc4
commit
aab90b0503
35 changed files with 983 additions and 991 deletions
|
|
@ -39,13 +39,13 @@ using mergerfs::Policy;
|
|||
|
||||
static
|
||||
int
|
||||
_unlink(const Policy::Action::Func searchFunc,
|
||||
const vector<string> &srcmounts,
|
||||
const string fusepath)
|
||||
_unlink(const fs::SearchFunc searchFunc,
|
||||
const vector<string> &srcmounts,
|
||||
const string fusepath)
|
||||
{
|
||||
int rv;
|
||||
int error;
|
||||
vector<fs::Path> paths;
|
||||
fs::PathVector paths;
|
||||
|
||||
searchFunc(srcmounts,fusepath,paths);
|
||||
if(paths.empty())
|
||||
|
|
@ -53,7 +53,7 @@ _unlink(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 &= ::unlink(i->full.c_str());
|
||||
|
|
@ -77,7 +77,7 @@ namespace mergerfs
|
|||
if(fusepath == config.controlfile)
|
||||
return -EPERM;
|
||||
|
||||
return _unlink(config.policy.action,
|
||||
return _unlink(*config.action,
|
||||
config.srcmounts,
|
||||
fusepath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue