mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
stop auto calculating and storing fullpath in policies
This commit is contained in:
parent
0c60701b29
commit
b2cd79154a
37 changed files with 278 additions and 259 deletions
|
|
@ -53,10 +53,10 @@ _mkdir(Policy::Func::Search searchFunc,
|
|||
int error;
|
||||
string dirname;
|
||||
string fullpath;
|
||||
Paths createpaths;
|
||||
Paths existingpath;
|
||||
vector<string> createpaths;
|
||||
vector<string> existingpath;
|
||||
|
||||
dirname = fs::dirname(fusepath);
|
||||
dirname = fs::path::dirname(fusepath);
|
||||
rv = searchFunc(srcmounts,dirname,minfreespace,existingpath);
|
||||
if(rv == -1)
|
||||
return -errno;
|
||||
|
|
@ -68,17 +68,17 @@ _mkdir(Policy::Func::Search searchFunc,
|
|||
error = 0;
|
||||
for(size_t i = 0, ei = createpaths.size(); i != ei; i++)
|
||||
{
|
||||
const string &createpath = createpaths[i].base;
|
||||
string &createpath = createpaths[i];
|
||||
|
||||
if(createpath != existingpath[0].base)
|
||||
if(createpath != existingpath[0])
|
||||
{
|
||||
const mergerfs::ugid::SetResetGuard ugid(0,0);
|
||||
fs::clonepath(existingpath[0].base,createpath,dirname);
|
||||
fs::clonepath(existingpath[0],createpath,dirname);
|
||||
}
|
||||
|
||||
fullpath = fs::make_path(createpath,fusepath);
|
||||
fs::path::append(createpath,fusepath);
|
||||
|
||||
rv = ::mkdir(fullpath.c_str(),mode);
|
||||
rv = ::mkdir(createpath.c_str(),mode);
|
||||
if(rv == -1)
|
||||
error = errno;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue