config: rework global config, remove rwlock, make branches RCU like

Also added unit tests. Should have done separately but found a number of bugs.
This commit is contained in:
Antonio SJ Musumeci 2020-12-19 15:06:08 -05:00
parent 2e4c6c5fd1
commit 538467b86d
327 changed files with 6691 additions and 3036 deletions

View file

@ -20,10 +20,11 @@
#include "fs_close.hpp"
#include "fs_fadvise.hpp"
#include <fuse.h>
#include "fuse.h"
#include <string>
namespace l
{
static
@ -52,12 +53,9 @@ namespace FUSE
int
release(const fuse_file_info_t *ffi_)
{
const Config &config = Config::ro();
Config::Read cfg;
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);
if(config.open_cache.timeout)
config.open_cache.cleanup(10);
return l::release(fi,config.dropcacheonclose);
return l::release(fi,cfg->dropcacheonclose);
}
}