mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-21 07:26:28 -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
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "fuse.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <unistd.h>
|
||||
|
|
@ -34,14 +33,14 @@
|
|||
static
|
||||
int
|
||||
_unlink_loop(const std::vector<Branch*> &branches_,
|
||||
const char *fusepath_)
|
||||
const fs::path &fusepath_)
|
||||
{
|
||||
Err err;
|
||||
std::string fullpath;
|
||||
fs::path fullpath;
|
||||
|
||||
for(const auto &branch : branches_)
|
||||
{
|
||||
fullpath = fs::path::make(branch->path,fusepath_);
|
||||
fullpath = branch->path / fusepath_;
|
||||
|
||||
err = fs::unlink(fullpath);
|
||||
}
|
||||
|
|
@ -53,7 +52,7 @@ static
|
|||
int
|
||||
_unlink(const Policy::Action &unlinkPolicy_,
|
||||
const Branches &branches_,
|
||||
const char *fusepath_)
|
||||
const fs::path &fusepath_)
|
||||
{
|
||||
int rv;
|
||||
std::vector<Branch*> branches;
|
||||
|
|
@ -68,10 +67,11 @@ _unlink(const Policy::Action &unlinkPolicy_,
|
|||
int
|
||||
FUSE::unlink(const char *fusepath_)
|
||||
{
|
||||
const fs::path fusepath{fusepath_};
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
|
||||
return ::_unlink(cfg.func.unlink.policy,
|
||||
cfg.branches,
|
||||
fusepath_);
|
||||
fusepath);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue