new features: follow-symlinks, rename-exdev, link-exdev

* follow-symlinks: allows mergerfs to transparently follow symlinks
* link-exdev: in the event a link returns EXDEV create a symlink instead
* rename-exdev: in the event a rename returns EXDEV move the oldpath and
  create a symlink for the newpath
This commit is contained in:
Antonio SJ Musumeci 2020-06-21 14:45:14 -04:00
parent 50daf84ec0
commit 8adebc9489
26 changed files with 6980 additions and 450 deletions

View file

@ -28,30 +28,27 @@ namespace fs
static
inline
int
symlink(const char *oldpath_,
const char *newpath_)
symlink(const char *target_,
const char *linkpath_)
{
return ::symlink(oldpath_,
newpath_);
return ::symlink(target_,linkpath_);
}
static
inline
int
symlink(const std::string &oldpath_,
const std::string &newpath_)
symlink(const std::string &target_,
const std::string &linkpath_)
{
return fs::symlink(oldpath_.c_str(),
newpath_.c_str());
return ::symlink(target_.c_str(),linkpath_.c_str());
}
static
inline
int
symlink(const char *oldpath_,
const std::string &newpath_)
symlink(const char *target_,
const std::string &linkpath_)
{
return fs::symlink(oldpath_,
newpath_.c_str());
return ::symlink(target_,linkpath_.c_str());
}
}