add tagging branches RW/RO/NW

This allows users to tag a branch as readonly or not for writing regardless
of how the filesystem is mounted. Should simplify deployments and offer
more flexibility.
This commit is contained in:
Antonio SJ Musumeci 2018-10-20 23:40:02 -04:00
parent 8dd0dc11ee
commit b55ebba4ed
57 changed files with 1586 additions and 1210 deletions

View file

@ -69,7 +69,7 @@ _ioctl_file(fuse_file_info *ffi,
static
int
_ioctl_dir_base(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const Branches &branches_,
const uint64_t minfreespace,
const char *fusepath,
const unsigned long cmd,
@ -80,7 +80,7 @@ _ioctl_dir_base(Policy::Func::Search searchFunc,
string fullpath;
vector<const string*> basepaths;
rv = searchFunc(srcmounts,fusepath,minfreespace,basepaths);
rv = searchFunc(branches_,fusepath,minfreespace,basepaths);
if(rv == -1)
return -errno;
@ -108,10 +108,10 @@ _ioctl_dir(fuse_file_info *ffi,
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.srcmountslock);
const rwlock::ReadGuard readlock(&config.branches_lock);
return _ioctl_dir_base(config.getattr,
config.srcmounts,
config.branches,
config.minfreespace,
di->fusepath.c_str(),
cmd,