mirror of
https://github.com/trapexit/mergerfs.git
synced 2024-11-23 14:58:34 +08:00
Merge pull request #418 from trapexit/fix
use fusepath from fileinfo. closes #417
This commit is contained in:
commit
fa3ff40218
|
@ -137,7 +137,7 @@ namespace fs
|
||||||
|
|
||||||
int
|
int
|
||||||
findonfs(const vector<string> &srcmounts,
|
findonfs(const vector<string> &srcmounts,
|
||||||
const char *fusepath,
|
const string &fusepath,
|
||||||
const int fd,
|
const int fd,
|
||||||
string &basepath)
|
string &basepath)
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace fs
|
||||||
vector<string> &paths);
|
vector<string> &paths);
|
||||||
|
|
||||||
int findonfs(const vector<string> &srcmounts,
|
int findonfs(const vector<string> &srcmounts,
|
||||||
const char *fusepath,
|
const string &fusepath,
|
||||||
const int fd,
|
const int fd,
|
||||||
string &basepath);
|
string &basepath);
|
||||||
|
|
||||||
|
|
|
@ -41,15 +41,6 @@ namespace fs
|
||||||
const string &fusepath,
|
const string &fusepath,
|
||||||
const size_t additional_size,
|
const size_t additional_size,
|
||||||
int &origfd)
|
int &origfd)
|
||||||
{
|
|
||||||
return fs::movefile(basepaths,fusepath.c_str(),additional_size,origfd);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
movefile(const vector<string> &basepaths,
|
|
||||||
const char *fusepath,
|
|
||||||
const size_t additional_size,
|
|
||||||
int &origfd)
|
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
int fdin;
|
int fdin;
|
||||||
|
|
|
@ -27,12 +27,6 @@ namespace fs
|
||||||
const std::string &fusepath,
|
const std::string &fusepath,
|
||||||
const size_t additional_size,
|
const size_t additional_size,
|
||||||
int &origfd);
|
int &origfd);
|
||||||
|
|
||||||
int
|
|
||||||
movefile(const std::vector<std::string> &basepaths,
|
|
||||||
const char *fusepath,
|
|
||||||
const size_t additional_size,
|
|
||||||
int &origfd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -38,6 +38,14 @@ namespace fs
|
||||||
base += suffix;
|
base += suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
void
|
||||||
|
append(string &base,
|
||||||
|
const string &suffix)
|
||||||
|
{
|
||||||
|
base += suffix;
|
||||||
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
void
|
void
|
||||||
make(const string *base,
|
make(const string *base,
|
||||||
|
@ -47,6 +55,16 @@ namespace fs
|
||||||
output = *base;
|
output = *base;
|
||||||
output += suffix;
|
output += suffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
void
|
||||||
|
make(const string *base,
|
||||||
|
const string &suffix,
|
||||||
|
string &output)
|
||||||
|
{
|
||||||
|
output = *base;
|
||||||
|
output += suffix;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ namespace mergerfs
|
||||||
const rwlock::ReadGuard readlock(&config.srcmountslock);
|
const rwlock::ReadGuard readlock(&config.srcmountslock);
|
||||||
|
|
||||||
extra = fuse_buf_size(src);
|
extra = fuse_buf_size(src);
|
||||||
rv = fs::movefile(config.srcmounts,fusepath,extra,fi->fd);
|
rv = fs::movefile(config.srcmounts,fi->fusepath,extra,fi->fd);
|
||||||
if(rv == -1)
|
if(rv == -1)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user