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
|
|
@ -22,43 +22,43 @@
|
|||
|
||||
|
||||
int
|
||||
Policy::EPRand::Action::operator()(const Branches::CPtr &branches_,
|
||||
Policy::EPRand::Action::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = Policies::Action::epall(branches_,fusepath_,paths_);
|
||||
if(rv == 0)
|
||||
RND::shrink_to_rand_elem(*paths_);
|
||||
RND::shrink_to_rand_elem(paths_);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
Policy::EPRand::Create::operator()(const Branches::CPtr &branches_,
|
||||
Policy::EPRand::Create::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = Policies::Create::epall(branches_,fusepath_,paths_);
|
||||
if(rv == 0)
|
||||
RND::shrink_to_rand_elem(*paths_);
|
||||
RND::shrink_to_rand_elem(paths_);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
Policy::EPRand::Search::operator()(const Branches::CPtr &branches_,
|
||||
Policy::EPRand::Search::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = Policies::Search::epall(branches_,fusepath_,paths_);
|
||||
if(rv == 0)
|
||||
RND::shrink_to_rand_elem(*paths_);
|
||||
RND::shrink_to_rand_elem(paths_);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue