mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Rework policies to return branches rather than path strings
This commit is contained in:
parent
7e084ea7db
commit
86b50d2d4e
86 changed files with 1259 additions and 3088 deletions
|
|
@ -81,16 +81,16 @@ namespace l
|
|||
|
||||
static
|
||||
int
|
||||
rmdir_loop(const StrVec &basepaths_,
|
||||
const char *fusepath_,
|
||||
const FollowSymlinks followsymlinks_)
|
||||
rmdir_loop(const std::vector<Branch*> &branches_,
|
||||
const char *fusepath_,
|
||||
const FollowSymlinks followsymlinks_)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = 0;
|
||||
for(size_t i = 0, ei = basepaths_.size(); i != ei; i++)
|
||||
for(auto &branch : branches_)
|
||||
{
|
||||
error = l::rmdir_core(basepaths_[i],fusepath_,followsymlinks_,error);
|
||||
error = l::rmdir_core(branch->path,fusepath_,followsymlinks_,error);
|
||||
}
|
||||
|
||||
return -error;
|
||||
|
|
@ -104,13 +104,13 @@ namespace l
|
|||
const char *fusepath_)
|
||||
{
|
||||
int rv;
|
||||
vector<string> basepaths;
|
||||
std::vector<Branch*> branches;
|
||||
|
||||
rv = actionFunc_(branches_,fusepath_,&basepaths);
|
||||
rv = actionFunc_(branches_,fusepath_,branches);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
||||
return l::rmdir_loop(basepaths,fusepath_,followsymlinks_);
|
||||
return l::rmdir_loop(branches,fusepath_,followsymlinks_);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue