mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-19 22:46:34 -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
|
|
@ -19,7 +19,6 @@
|
|||
#include "fs_base_readlink.hpp"
|
||||
#include "fs_base_stat.hpp"
|
||||
#include "fs_path.hpp"
|
||||
#include "rwlock.hpp"
|
||||
#include "symlinkify.hpp"
|
||||
#include "ugid.hpp"
|
||||
|
||||
|
|
@ -74,7 +73,7 @@ namespace l
|
|||
|
||||
static
|
||||
int
|
||||
readlink_core(const string *basepath_,
|
||||
readlink_core(const string &basepath_,
|
||||
const char *fusepath_,
|
||||
char *buf_,
|
||||
const size_t size_,
|
||||
|
|
@ -103,9 +102,9 @@ namespace l
|
|||
const time_t symlinkify_timeout_)
|
||||
{
|
||||
int rv;
|
||||
vector<const string*> basepaths;
|
||||
vector<string> basepaths;
|
||||
|
||||
rv = searchFunc_(branches_,fusepath_,minfreespace_,basepaths);
|
||||
rv = searchFunc_(branches_,fusepath_,minfreespace_,&basepaths);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
||||
|
|
@ -121,12 +120,11 @@ namespace FUSE
|
|||
char *buf_,
|
||||
size_t size_)
|
||||
{
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const Config &config = Config::get(fc);
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
const rwlock::ReadGuard readlock(&config.branches_lock);
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const Config &config = Config::ro();
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
|
||||
return l::readlink(config.readlink,
|
||||
return l::readlink(config.func.readlink.policy,
|
||||
config.branches,
|
||||
config.minfreespace,
|
||||
fusepath_,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue