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
|
|
@ -35,9 +35,9 @@ namespace epff
|
|||
{
|
||||
static
|
||||
int
|
||||
create(const Branches::CPtr &branches_,
|
||||
create(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_)
|
||||
std::vector<Branch*> &paths_)
|
||||
{
|
||||
int rv;
|
||||
int error;
|
||||
|
|
@ -58,7 +58,7 @@ namespace epff
|
|||
if(info.spaceavail < branch.minfreespace())
|
||||
error_and_continue(error,ENOSPC);
|
||||
|
||||
paths_->push_back(branch.path);
|
||||
paths_.push_back(&branch);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -68,9 +68,9 @@ namespace epff
|
|||
|
||||
static
|
||||
int
|
||||
action(const Branches::CPtr &branches_,
|
||||
action(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_)
|
||||
std::vector<Branch*> &paths_)
|
||||
{
|
||||
int rv;
|
||||
int error;
|
||||
|
|
@ -89,7 +89,7 @@ namespace epff
|
|||
if(readonly)
|
||||
error_and_continue(error,EROFS);
|
||||
|
||||
paths_->push_back(branch.path);
|
||||
paths_.push_back(&branch);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -99,16 +99,16 @@ namespace epff
|
|||
|
||||
static
|
||||
int
|
||||
search(const Branches::CPtr &branches_,
|
||||
search(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_)
|
||||
std::vector<Branch*> &paths_)
|
||||
{
|
||||
for(auto &branch : *branches_)
|
||||
{
|
||||
if(!fs::exists(branch.path,fusepath_))
|
||||
continue;
|
||||
|
||||
paths_->push_back(branch.path);
|
||||
paths_.push_back(&branch);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -118,25 +118,25 @@ namespace epff
|
|||
}
|
||||
|
||||
int
|
||||
Policy::EPFF::Action::operator()(const Branches::CPtr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
Policy::EPFF::Action::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
return ::epff::action(branches_,fusepath_,paths_);
|
||||
}
|
||||
|
||||
int
|
||||
Policy::EPFF::Create::operator()(const Branches::CPtr &branches_,
|
||||
Policy::EPFF::Create::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
return ::epff::create(branches_,fusepath_,paths_);
|
||||
}
|
||||
|
||||
int
|
||||
Policy::EPFF::Search::operator()(const Branches::CPtr &branches_,
|
||||
Policy::EPFF::Search::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
return ::epff::search(branches_,fusepath_,paths_);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue