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
|
|
@ -21,43 +21,43 @@
|
|||
#include "rnd.hpp"
|
||||
|
||||
int
|
||||
Policy::Rand::Action::operator()(const Branches::CPtr &branches_,
|
||||
Policy::Rand::Action::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = Policies::Action::all(branches_,fusepath_,paths_);
|
||||
if(rv == 0)
|
||||
RND::shrink_to_rand_elem(*paths_);
|
||||
RND::shrink_to_rand_elem(paths_);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
Policy::Rand::Create::operator()(const Branches::CPtr &branches_,
|
||||
Policy::Rand::Create::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = Policies::Create::all(branches_,fusepath_,paths_);
|
||||
if(rv == 0)
|
||||
RND::shrink_to_rand_elem(*paths_);
|
||||
RND::shrink_to_rand_elem(paths_);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
Policy::Rand::Search::operator()(const Branches::CPtr &branches_,
|
||||
Policy::Rand::Search::operator()(const Branches::Ptr &branches_,
|
||||
const char *fusepath_,
|
||||
StrVec *paths_) const
|
||||
std::vector<Branch*> &paths_) const
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = Policies::Search::all(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