mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-22 07:56:32 -05:00
rework policy code
This commit is contained in:
parent
345d0bbdc4
commit
aab90b0503
35 changed files with 983 additions and 991 deletions
|
|
@ -38,13 +38,13 @@ using mergerfs::Policy;
|
|||
|
||||
static
|
||||
int
|
||||
_rmdir(const Policy::Action::Func searchFunc,
|
||||
const vector<string> &srcmounts,
|
||||
const string fusepath)
|
||||
_rmdir(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())
|
||||
|
|
@ -52,7 +52,7 @@ _rmdir(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 &= ::rmdir(i->full.c_str());
|
||||
|
|
@ -76,7 +76,7 @@ namespace mergerfs
|
|||
if(fusepath == config.controlfile)
|
||||
return -ENOTDIR;
|
||||
|
||||
return _rmdir(config.policy.action,
|
||||
return _rmdir(*config.action,
|
||||
config.srcmounts,
|
||||
fusepath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue