support runtime setting of srcmounts. closes #12

This commit is contained in:
Antonio SJ Musumeci 2014-08-03 15:50:28 -04:00
parent 992e05e897
commit 7e9ccd0317
34 changed files with 538 additions and 149 deletions

View file

@ -33,7 +33,7 @@
#include "config.hpp"
#include "ugid.hpp"
#include "fs.hpp"
#include "assert.hpp"
#include "rwlock.hpp"
#include "xattr.hpp"
using std::string;
@ -79,13 +79,15 @@ namespace mergerfs
removexattr(const char *fusepath,
const char *attrname)
{
const struct fuse_context *fc = fuse_get_context();
const config::Config &config = config::get();
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const config::Config &config = config::get();
if(fusepath == config.controlfile)
return -ENOTSUP;
const struct fuse_context *fc = fuse_get_context();
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _removexattr(*config.action,
config.srcmounts,
fusepath,