mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-29 11:26:44 -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_rmdir.hpp"
|
||||
#include "fs_path.hpp"
|
||||
#include "rv.hpp"
|
||||
#include "rwlock.hpp"
|
||||
#include "ugid.hpp"
|
||||
|
||||
#include <fuse.h>
|
||||
|
|
@ -35,7 +34,7 @@ namespace l
|
|||
{
|
||||
static
|
||||
int
|
||||
rmdir_loop_core(const string *basepath_,
|
||||
rmdir_loop_core(const string &basepath_,
|
||||
const char *fusepath_,
|
||||
const int error_)
|
||||
{
|
||||
|
|
@ -52,8 +51,8 @@ namespace l
|
|||
|
||||
static
|
||||
int
|
||||
rmdir_loop(const vector<const string*> &basepaths_,
|
||||
const char *fusepath_)
|
||||
rmdir_loop(const vector<string> &basepaths_,
|
||||
const char *fusepath_)
|
||||
{
|
||||
int error;
|
||||
|
||||
|
|
@ -74,9 +73,9 @@ namespace l
|
|||
const char *fusepath_)
|
||||
{
|
||||
int rv;
|
||||
vector<const string*> basepaths;
|
||||
vector<string> basepaths;
|
||||
|
||||
rv = actionFunc_(branches_,fusepath_,minfreespace_,basepaths);
|
||||
rv = actionFunc_(branches_,fusepath_,minfreespace_,&basepaths);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
||||
|
|
@ -89,12 +88,11 @@ namespace FUSE
|
|||
int
|
||||
rmdir(const char *fusepath_)
|
||||
{
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const Config &config = Config::get(fc);
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
const rwlock::ReadGuard readguard(&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::rmdir(config.rmdir,
|
||||
return l::rmdir(config.func.rmdir.policy,
|
||||
config.branches,
|
||||
config.minfreespace,
|
||||
fusepath_);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue