mergerfs/src/func_getattr_ff.cpp

49 lines
1 KiB
C++
Raw Normal View History

#include "func_getattr_ff.hpp"
2025-11-20 22:31:44 -06:00
#include "error.hpp"
#include "fs_stat.hpp"
#include "fs_inode.hpp"
#include "symlinkify.hpp"
std::string_view
Func2::GetAttrFF::name() const
{
return "ff";
}
int
Func2::GetAttrFF::operator()(const Branches &branches_,
const fs::path &fusepath_,
struct stat *st_,
const FollowSymlinksEnum follow_symlinks_,
const s64 symlinkify_timeout_)
{
int rv;
fs::path fullpath;
2025-11-20 22:31:51 -06:00
Err err;
2025-11-22 19:30:02 -06:00
err = -ENXIO;
for(const auto &branch : branches_)
{
fullpath = branch.path / fusepath_;
rv = fs::stat(fullpath,st_,follow_symlinks_);
if(rv < 0)
2025-11-20 22:33:12 -06:00
{
2025-11-22 19:33:58 -06:00
__builtin_trap();
2025-11-20 22:33:12 -06:00
err = rv;
continue;
}
symlinkify::convert_if_can_be_symlink(fullpath,
st_,
symlinkify_timeout_);
fs::inode::calc(branch.path,fusepath_,st_);
return rv;
}
2025-11-20 22:33:18 -06:00
return err;
}