Start using std::filesystem::path for fusepath (#1522)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run

This commit is contained in:
trapexit 2025-09-17 23:51:16 -04:00 • committed by GitHub
parent f64ff9ca1e
commit 8c649d33ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
139 changed files with 1711 additions and 1663 deletions

View file

@ -26,13 +26,13 @@
#include <pthread.h>
#include <sys/stat.h>
typedef uint64_t (*inodefunc_t)(const std::string_view,
const std::string_view,
typedef uint64_t (*inodefunc_t)(const std::string &,
const std::string &,
const mode_t,
const ino_t);
static uint64_t _hybrid_hash(const std::string_view,
const std::string_view,
static uint64_t _hybrid_hash(const std::string &,
const std::string &,
const mode_t,
const ino_t);
@ -51,8 +51,8 @@ _h64_to_h32(uint64_t h_)
static
uint64_t
_passthrough(const std::string_view branch_path_,
const std::string_view fusepath_,
_passthrough(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
@ -61,8 +61,8 @@ _passthrough(const std::string_view branch_path_,
static
uint64_t
_path_hash(const std::string_view branch_path_,
const std::string_view fusepath_,
_path_hash(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
@ -75,8 +75,8 @@ _path_hash(const std::string_view branch_path_,
static
uint64_t
_path_hash32(const std::string_view branch_path_,
const std::string_view fusepath_,
_path_hash32(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
@ -92,8 +92,8 @@ _path_hash32(const std::string_view branch_path_,
static
uint64_t
_devino_hash(const std::string_view branch_path_,
const std::string_view fusepath_,
_devino_hash(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
@ -107,8 +107,8 @@ _devino_hash(const std::string_view branch_path_,
static
uint64_t
_devino_hash32(const std::string_view branch_path_,
const std::string_view fusepath_,
_devino_hash32(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
@ -124,8 +124,8 @@ _devino_hash32(const std::string_view branch_path_,
static
uint64_t
_hybrid_hash(const std::string_view branch_path_,
const std::string_view fusepath_,
_hybrid_hash(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
@ -136,8 +136,8 @@ _hybrid_hash(const std::string_view branch_path_,
static
uint64_t
_hybrid_hash32(const std::string_view branch_path_,
const std::string_view fusepath_,
_hybrid_hash32(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
@ -147,7 +147,7 @@ _hybrid_hash32(const std::string_view branch_path_,
}
int
fs::inode::set_algo(const std::string_view algo_)
fs::inode::set_algo(const std::string &algo_)
{
if(algo_ == "passthrough")
g_func = ::_passthrough;
@ -191,18 +191,18 @@ fs::inode::get_algo(void)
}
uint64_t
fs::inode::calc(const std::string_view branch_path_,
const std::string_view fusepath_,
const mode_t mode_,
const ino_t ino_)
fs::inode::calc(const std::string &branch_path_,
const std::string &fusepath_,
const mode_t mode_,
const ino_t ino_)
{
return g_func(branch_path_,fusepath_,mode_,ino_);
}
void
fs::inode::calc(const std::string_view branch_path_,
const std::string_view fusepath_,
struct stat *st_)
fs::inode::calc(const std::string &branch_path_,
const std::string &fusepath_,
struct stat *st_)
{
st_->st_ino = calc(branch_path_,
fusepath_,
@ -211,9 +211,9 @@ fs::inode::calc(const std::string_view branch_path_,
}
void
fs::inode::calc(const std::string_view branch_path_,
const std::string_view fusepath_,
struct fuse_statx *st_)
fs::inode::calc(const std::string &branch_path_,
const std::string &fusepath_,
struct fuse_statx *st_)
{
st_->ino = calc(branch_path_,
fusepath_,