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:
Antonio SJ Musumeci 2019-09-24 10:27:46 -04:00
parent 8d989777f8
commit 54c41c4994
90 changed files with 3292 additions and 2619 deletions

View file

@ -19,7 +19,6 @@
#include "fileinfo.hpp"
#include "fs_base_write.hpp"
#include "fs_movefile.hpp"
#include "rwlock.hpp"
#include "ugid.hpp"
#include <string>
@ -92,14 +91,12 @@ namespace l
rv = func_(fi->fd,buf_,count_,offset_);
if(l::out_of_space(-rv))
{
const fuse_context *fc = fuse_get_context();
const Config &config = Config::get(fc);
const Config &config = Config::ro();
if(config.moveonenospc)
{
vector<string> paths;
const ugid::Set ugid(0,0);
const rwlock::ReadGuard readlock(&config.branches_lock);
config.branches.to_paths(paths);