mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-28 19:06:39 -05:00
Start using std::filesystem::path for fusepath (#1522)
This commit is contained in:
parent
f64ff9ca1e
commit
8c649d33ee
139 changed files with 1711 additions and 1663 deletions
|
|
@ -30,9 +30,6 @@
|
|||
|
||||
#include <unistd.h>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
|
||||
static
|
||||
int
|
||||
|
|
@ -45,14 +42,14 @@ _should_unlink(int rv_,
|
|||
|
||||
static
|
||||
int
|
||||
_rmdir_core(const string &basepath_,
|
||||
const char *fusepath_,
|
||||
_rmdir_core(const fs::path &basepath_,
|
||||
const fs::path &fusepath_,
|
||||
const FollowSymlinks followsymlinks_)
|
||||
{
|
||||
int rv;
|
||||
string fullpath;
|
||||
fs::path fullpath;
|
||||
|
||||
fullpath = fs::path::make(basepath_,fusepath_);
|
||||
fullpath = basepath_ / fusepath_;
|
||||
|
||||
rv = fs::rmdir(fullpath);
|
||||
if(::_should_unlink(rv,followsymlinks_))
|
||||
|
|
@ -64,7 +61,7 @@ _rmdir_core(const string &basepath_,
|
|||
static
|
||||
int
|
||||
_rmdir_loop(const std::vector<Branch*> &branches_,
|
||||
const char *fusepath_,
|
||||
const fs::path &fusepath_,
|
||||
const FollowSymlinks followsymlinks_)
|
||||
{
|
||||
Err err;
|
||||
|
|
@ -82,7 +79,7 @@ int
|
|||
_rmdir(const Policy::Action &actionFunc_,
|
||||
const Branches &branches_,
|
||||
const FollowSymlinks followsymlinks_,
|
||||
const char *fusepath_)
|
||||
const fs::path &fusepath_)
|
||||
{
|
||||
int rv;
|
||||
std::vector<Branch*> branches;
|
||||
|
|
@ -97,11 +94,12 @@ _rmdir(const Policy::Action &actionFunc_,
|
|||
int
|
||||
FUSE::rmdir(const char *fusepath_)
|
||||
{
|
||||
const fs::path fusepath{fusepath_};
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
|
||||
return ::_rmdir(cfg.func.rmdir.policy,
|
||||
cfg.branches,
|
||||
cfg.follow_symlinks,
|
||||
fusepath_);
|
||||
fusepath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue