mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 15:06:33 -05:00
only return 1 branch for rand/eprand policies
This commit is contained in:
parent
6b3f703ba9
commit
0fffabfbe3
4 changed files with 22 additions and 14 deletions
|
|
@ -25,17 +25,20 @@ using std::string;
|
|||
using std::vector;
|
||||
|
||||
int
|
||||
Policy::Func::rand(const Category::Enum::Type type,
|
||||
Policy::Func::rand(const Category::Enum::Type type_,
|
||||
const Branches &branches_,
|
||||
const char *fusepath,
|
||||
const uint64_t minfreespace,
|
||||
vector<const string*> &paths)
|
||||
const char *fusepath_,
|
||||
const uint64_t minfreespace_,
|
||||
vector<const string*> &paths_)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = Policy::Func::all(type,branches_,fusepath,minfreespace,paths);
|
||||
rv = Policy::Func::all(type_,branches_,fusepath_,minfreespace_,paths_);
|
||||
if(rv == 0)
|
||||
std::random_shuffle(paths.begin(),paths.end());
|
||||
{
|
||||
std::random_shuffle(paths_.begin(),paths_.end());
|
||||
paths_.resize(1);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue