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

@ -81,15 +81,15 @@ namespace fs
}
void
findallfiles(const vector<string> &srcmounts,
findallfiles(const vector<string> &basepaths,
const char *fusepath,
vector<string> &paths)
{
string fullpath;
for(size_t i = 0, ei = srcmounts.size(); i != ei; i++)
for(size_t i = 0, ei = basepaths.size(); i != ei; i++)
{
fs::path::make(&srcmounts[i],fusepath,fullpath);
fs::path::make(&basepaths[i],fusepath,fullpath);
if(!fs::exists(fullpath))
continue;
@ -99,7 +99,7 @@ namespace fs
}
int
findonfs(const vector<string> &srcmounts,
findonfs(const vector<string> &basepaths,
const string &fusepath,
const int fd,
string &basepath)
@ -114,9 +114,9 @@ namespace fs
return -1;
dev = st.st_dev;
for(size_t i = 0, ei = srcmounts.size(); i != ei; i++)
for(size_t i = 0, ei = basepaths.size(); i != ei; i++)
{
fs::path::make(&srcmounts[i],fusepath,fullpath);
fs::path::make(&basepaths[i],fusepath,fullpath);
rv = fs::lstat(fullpath,st);
if(rv == -1)
@ -125,7 +125,7 @@ namespace fs
if(st.st_dev != dev)
continue;
basepath = srcmounts[i];
basepath = basepaths[i];
return 0;
}