mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-21 23:46:26 -05:00
rework config management
* Add standard way to do str2val and val2str conversion * Add support for a config file * Add support for reading and writing settings via ioctl
This commit is contained in:
parent
8d989777f8
commit
54c41c4994
90 changed files with 3292 additions and 2619 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include "fs_path.hpp"
|
||||
#include "policy.hpp"
|
||||
#include "policy_error.hpp"
|
||||
#include "rwlock.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
@ -32,10 +33,12 @@ namespace ff
|
|||
{
|
||||
static
|
||||
int
|
||||
create(const Branches &branches_,
|
||||
const uint64_t minfreespace,
|
||||
vector<const string*> &paths)
|
||||
create(const Branches &branches_,
|
||||
const uint64_t minfreespace,
|
||||
vector<string> *paths)
|
||||
{
|
||||
rwlock::ReadGuard guard(&branches_.lock);
|
||||
|
||||
int rv;
|
||||
int error;
|
||||
fs::info_t info;
|
||||
|
|
@ -56,7 +59,7 @@ namespace ff
|
|||
if(info.spaceavail < minfreespace)
|
||||
error_and_continue(error,ENOSPC);
|
||||
|
||||
paths.push_back(&branch->path);
|
||||
paths->push_back(branch->path);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -70,7 +73,7 @@ Policy::Func::ff(const Category::Enum::Type type,
|
|||
const Branches &branches_,
|
||||
const char *fusepath,
|
||||
const uint64_t minfreespace,
|
||||
vector<const string*> &paths)
|
||||
vector<string> *paths)
|
||||
{
|
||||
if(type == Category::Enum::create)
|
||||
return ff::create(branches_,minfreespace,paths);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue