diff --git a/src/fuse_getattr_func.cpp b/src/fuse_getattr_func.cpp index 707e14c0..b1567e66 100644 --- a/src/fuse_getattr_func.cpp +++ b/src/fuse_getattr_func.cpp @@ -27,12 +27,6 @@ FUSE::GETATTR::Func::Func(const toml::value &toml_) _getattr = FuncFactory(toml_); } -void -FUSE::GETATTR::Func::operator=(const toml::value &toml_) -{ - _getattr = FuncFactory(toml_); -} - int FUSE::GETATTR::Func::operator()(const gfs::path &fusepath_, struct stat *st_, diff --git a/src/fuse_getattr_func.hpp b/src/fuse_getattr_func.hpp index 99f78770..4017a5bd 100644 --- a/src/fuse_getattr_func.hpp +++ b/src/fuse_getattr_func.hpp @@ -39,9 +39,6 @@ namespace FUSE::GETATTR struct stat *st, fuse_timeouts_t *timeout); - - void operator=(const toml::value&); - private: FuncBase::Ptr _getattr; }; diff --git a/src/fuse_listxattr.cpp b/src/fuse_listxattr.cpp index 01675a84..4f272b73 100644 --- a/src/fuse_listxattr.cpp +++ b/src/fuse_listxattr.cpp @@ -93,9 +93,11 @@ namespace FUSE::LISTXATTR size_t size_) { State s; + gfs::path fusepath; const fuse_context *fc = fuse_get_context(); const ugid::Set ugid(fc->uid,fc->gid); - return s->listxattr(fusepath_,list_,size_); + fusepath = &fusepath_[1]; + return s->listxattr(fusepath,list_,size_); } } diff --git a/src/fuse_listxattr_func.cpp b/src/fuse_listxattr_func.cpp index 21374542..dc8e2c39 100644 --- a/src/fuse_listxattr_func.cpp +++ b/src/fuse_listxattr_func.cpp @@ -25,16 +25,10 @@ FUSE::LISTXATTR::Func::Func(const toml::value &toml_) _listxattr = FuncFactory(toml_); } -void -FUSE::LISTXATTR::Func::operator=(const toml::value &toml_) -{ - _listxattr = FuncFactory(toml_); -} - int -FUSE::LISTXATTR::Func::operator()(const char *fusepath_, - char *list_, - const size_t size_) +FUSE::LISTXATTR::Func::operator()(const gfs::path &fusepath_, + char *list_, + const size_t size_) { return (*_listxattr)(fusepath_,list_,size_); } diff --git a/src/fuse_listxattr_func.hpp b/src/fuse_listxattr_func.hpp index 3df9ce06..79102da1 100644 --- a/src/fuse_listxattr_func.hpp +++ b/src/fuse_listxattr_func.hpp @@ -33,12 +33,9 @@ namespace FUSE::LISTXATTR Func(const toml::value &); public: - int operator()(const char *fusepath, - char *buf, - size_t count); - - - void operator=(const toml::value&); + int operator()(const gfs::path &fusepath, + char *buf, + size_t count); private: FuncBase::Ptr _listxattr; diff --git a/src/fuse_listxattr_func_base.hpp b/src/fuse_listxattr_func_base.hpp index 0b344741..215d65c0 100644 --- a/src/fuse_listxattr_func_base.hpp +++ b/src/fuse_listxattr_func_base.hpp @@ -18,6 +18,8 @@ #pragma once +#include "fs_path.hpp" + #include @@ -29,9 +31,8 @@ namespace FUSE::LISTXATTR typedef std::shared_ptr Ptr; public: - virtual int operator()(const char *fusepath, - char *list, - const size_t size) = 0; - + virtual int operator()(const gfs::path &fusepath, + char *list, + const size_t size) = 0; }; } diff --git a/src/fuse_listxattr_func_ff.cpp b/src/fuse_listxattr_func_ff.cpp index 6173b462..4d9802b4 100644 --- a/src/fuse_listxattr_func_ff.cpp +++ b/src/fuse_listxattr_func_ff.cpp @@ -21,9 +21,6 @@ #include "fs_llistxattr.hpp" -namespace gfs = ghc::filesystem; - - FUSE::LISTXATTR::FuncFF::FuncFF(const toml::value &toml_) : _branches(toml_) { @@ -31,20 +28,18 @@ FUSE::LISTXATTR::FuncFF::FuncFF(const toml::value &toml_) } int -FUSE::LISTXATTR::FuncFF::operator()(const char *fusepath_, - char *list_, - const size_t size_) +FUSE::LISTXATTR::FuncFF::operator()(const gfs::path &fusepath_, + char *list_, + const size_t size_) { int rv; - gfs::path fusepath; gfs::path fullpath; - fusepath = &fusepath_[1]; for(const auto &branch_group : _branches) { for(const auto &branch : branch_group) { - fullpath = branch.path / fusepath; + fullpath = branch.path / fusepath_; rv = fs::llistxattr(fullpath,list_,size_); if(rv == -ENOENT) diff --git a/src/fuse_listxattr_func_ff.hpp b/src/fuse_listxattr_func_ff.hpp index d29d200c..07fd0704 100644 --- a/src/fuse_listxattr_func_ff.hpp +++ b/src/fuse_listxattr_func_ff.hpp @@ -32,9 +32,9 @@ namespace FUSE::LISTXATTR FuncFF(const toml::value&); public: - int operator()(const char *fusepath, - char *list, - const size_t size) final; + int operator()(const gfs::path &fusepath, + char *list, + const size_t size) final; private: Branches2 _branches; diff --git a/src/fuse_mkdir.cpp b/src/fuse_mkdir.cpp index e8be0c7e..b4c1652e 100644 --- a/src/fuse_mkdir.cpp +++ b/src/fuse_mkdir.cpp @@ -148,30 +148,16 @@ namespace l namespace FUSE::MKDIR { - int - mkdir_old(const char *fusepath_, - mode_t mode_) - { - Config::Read cfg; - const fuse_context *fc = fuse_get_context(); - const ugid::Set ugid(fc->uid,fc->gid); - - return l::mkdir(cfg->func.getattr.policy, - cfg->func.mkdir.policy, - cfg->branches, - fusepath_, - mode_, - fc->umask); - } - int mkdir(const char *fusepath_, mode_t mode_) { State s; + gfs::path fusepath; const fuse_context *fc = fuse_get_context(); const ugid::Set ugid(fc->uid,fc->gid); - return s->mkdir(fusepath_,mode_,fc->umask); + fusepath = &fusepath_[1]; + return s->mkdir(fusepath,mode_,fc->umask); } } diff --git a/src/fuse_mkdir_func.cpp b/src/fuse_mkdir_func.cpp index 7abedfb0..07ce11ac 100644 --- a/src/fuse_mkdir_func.cpp +++ b/src/fuse_mkdir_func.cpp @@ -28,9 +28,9 @@ FUSE::MKDIR::Func::Func(const toml::value &toml_) } int -FUSE::MKDIR::Func::operator()(const char *fusepath_, - const mode_t mode_, - const mode_t umask_) +FUSE::MKDIR::Func::operator()(const gfs::path &fusepath_, + const mode_t mode_, + const mode_t umask_) { return (*_mkdir)(fusepath_,mode_,umask_); } diff --git a/src/fuse_mkdir_func.hpp b/src/fuse_mkdir_func.hpp index 73d48c54..ef19b870 100644 --- a/src/fuse_mkdir_func.hpp +++ b/src/fuse_mkdir_func.hpp @@ -31,9 +31,9 @@ namespace FUSE::MKDIR Func(const toml::value &); public: - int operator()(const char *fusepath, - const mode_t mode, - const mode_t umask); + int operator()(const gfs::path &fusepath, + const mode_t mode, + const mode_t umask); private: FuncBase::Ptr _mkdir; diff --git a/src/fuse_mkdir_func_base.hpp b/src/fuse_mkdir_func_base.hpp index 2dfcaa9e..a06ada8a 100644 --- a/src/fuse_mkdir_func_base.hpp +++ b/src/fuse_mkdir_func_base.hpp @@ -18,6 +18,8 @@ #pragma once +#include "fs_path.hpp" + #include "fuse.h" #include @@ -31,8 +33,8 @@ namespace FUSE::MKDIR typedef std::shared_ptr Ptr; public: - virtual int operator()(const char *fusepath, - const mode_t mode, - const mode_t umask) = 0; + virtual int operator()(const gfs::path &fusepath, + const mode_t mode, + const mode_t umask) = 0; }; } diff --git a/src/fuse_mkdir_func_epff.cpp b/src/fuse_mkdir_func_epff.cpp index 65c5dafc..a4719880 100644 --- a/src/fuse_mkdir_func_epff.cpp +++ b/src/fuse_mkdir_func_epff.cpp @@ -30,20 +30,18 @@ FUSE::MKDIR::FuncEPFF::FuncEPFF(const toml::value &toml_) } int -FUSE::MKDIR::FuncEPFF::operator()(const char *fusepath_, - const mode_t mode_, - const mode_t umask_) +FUSE::MKDIR::FuncEPFF::operator()(const gfs::path &fusepath_, + const mode_t mode_, + const mode_t umask_) { int rv; - gfs::path fusepath; gfs::path fullpath; - fusepath = &fusepath_[1]; for(const auto &branch_group : _branches) { for(const auto &branch : branch_group) { - fullpath = branch.path / fusepath; + fullpath = branch.path / fusepath_; rv = FUSE::MKDIR::mkdir(fullpath,mode_,umask_); if(rv == -ENOENT) diff --git a/src/fuse_mkdir_func_epff.hpp b/src/fuse_mkdir_func_epff.hpp index 90567beb..31d11d32 100644 --- a/src/fuse_mkdir_func_epff.hpp +++ b/src/fuse_mkdir_func_epff.hpp @@ -31,9 +31,9 @@ namespace FUSE::MKDIR FuncEPFF(const toml::value&); public: - int operator()(const char *fusepath, - const mode_t mode, - const mode_t umask) final; + int operator()(const gfs::path &fusepath, + const mode_t mode, + const mode_t umask) final; private: Branches2 _branches; diff --git a/src/fuse_mkdir_func_ff.cpp b/src/fuse_mkdir_func_ff.cpp index 85817050..f9c80279 100644 --- a/src/fuse_mkdir_func_ff.cpp +++ b/src/fuse_mkdir_func_ff.cpp @@ -32,25 +32,23 @@ FUSE::MKDIR::FuncFF::FuncFF(const toml::value &toml_) } int -FUSE::MKDIR::FuncFF::operator()(const char *fusepath_, - const mode_t mode_, - const mode_t umask_) +FUSE::MKDIR::FuncFF::operator()(const gfs::path &fusepath_, + const mode_t mode_, + const mode_t umask_) { int rv; - gfs::path fusepath; gfs::path fullpath; - fusepath = &fusepath_[1]; for(const auto &branch_group : _branches) { for(const auto &branch : branch_group) { - fullpath = branch.path / fusepath; + fullpath = branch.path / fusepath_; rv = FUSE::MKDIR::mkdir(fullpath,mode_,umask_); if(rv == -ENOENT) { - rv = fs::clonepath_as_root(_branches,branch.path,fusepath); + rv = fs::clonepath_as_root(_branches,branch.path,fusepath_); if(rv >= 0) rv = FUSE::MKDIR::mkdir(fullpath,mode_,umask_); } diff --git a/src/fuse_mkdir_func_ff.hpp b/src/fuse_mkdir_func_ff.hpp index 3cc51ec4..1cef1b74 100644 --- a/src/fuse_mkdir_func_ff.hpp +++ b/src/fuse_mkdir_func_ff.hpp @@ -31,9 +31,9 @@ namespace FUSE::MKDIR FuncFF(const toml::value&); public: - int operator()(const char *fusepath, - const mode_t mode, - const mode_t umask) final; + int operator()(const gfs::path &fusepath, + const mode_t mode, + const mode_t umask) final; private: Branches2 _branches; diff --git a/src/fuse_mkdir_mkdir.cpp b/src/fuse_mkdir_mkdir.cpp index 532415d1..10185cf8 100644 --- a/src/fuse_mkdir_mkdir.cpp +++ b/src/fuse_mkdir_mkdir.cpp @@ -22,9 +22,6 @@ #include "fs_mkdir.hpp" -namespace gfs = ghc::filesystem; - - int FUSE::MKDIR::mkdir(const gfs::path &fullpath_, const mode_t mode_, diff --git a/src/fuse_mkdir_mkdir.hpp b/src/fuse_mkdir_mkdir.hpp index e5ddd1ab..90a5479a 100644 --- a/src/fuse_mkdir_mkdir.hpp +++ b/src/fuse_mkdir_mkdir.hpp @@ -18,7 +18,7 @@ #pragma once -#include "ghc/filesystem.hpp" +#include "fs_path.hpp" #include #include @@ -27,7 +27,7 @@ namespace FUSE::MKDIR { int - mkdir(const ghc::filesystem::path &fullpath, - const mode_t mode, - const mode_t umask); + mkdir(const gfs::path &fullpath, + const mode_t mode, + const mode_t umask); }