mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04: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
|
|
@ -56,22 +56,23 @@ _dirent_exact_namelen(const struct dirent *d_)
|
|||
static
|
||||
int
|
||||
_readdir(const Branches::Ptr &branches_,
|
||||
const std::string &rel_dirpath_,
|
||||
const fs::path &rel_dirpath_,
|
||||
fuse_dirents_t *buf_)
|
||||
{
|
||||
Err err;
|
||||
HashSet names;
|
||||
std::string rel_filepath;
|
||||
std::string abs_dirpath;
|
||||
fs::path rel_filepath;
|
||||
fs::path abs_dirpath;
|
||||
|
||||
fuse_dirents_reset(buf_);
|
||||
|
||||
rel_filepath = rel_dirpath_ / "dummy";
|
||||
for(const auto &branch : *branches_)
|
||||
{
|
||||
int rv;
|
||||
DIR *dh;
|
||||
|
||||
abs_dirpath = fs::path::make(branch.path,rel_dirpath_);
|
||||
abs_dirpath = branch.path / rel_dirpath_;
|
||||
|
||||
errno = 0;
|
||||
dh = fs::opendir(abs_dirpath);
|
||||
|
|
@ -92,7 +93,7 @@ _readdir(const Branches::Ptr &branches_,
|
|||
if(rv == 0)
|
||||
continue;
|
||||
|
||||
rel_filepath = fs::path::make(rel_dirpath_,de->d_name);
|
||||
rel_filepath.replace_filename(de->d_name);
|
||||
de->d_ino = fs::inode::calc(branch.path,
|
||||
rel_filepath,
|
||||
DTTOIF(de->d_type),
|
||||
|
|
@ -111,7 +112,7 @@ int
|
|||
FUSE::ReadDirSeq::operator()(fuse_file_info_t const *ffi_,
|
||||
fuse_dirents_t *buf_)
|
||||
{
|
||||
DirInfo *di = reinterpret_cast<DirInfo*>(ffi_->fh);
|
||||
DirInfo *di = DirInfo::from_fh(ffi_->fh);
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue