Add support for FUSE passthrough
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run

This commit is contained in:
trapexit 2025-06-05 23:47:42 -05:00 • committed by GitHub
parent 92312c8507
commit e310d24615
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
412 changed files with 43707 additions and 17432 deletions

View file

@ -17,6 +17,7 @@
#include "errno.hpp"
#include "fileinfo.hpp"
#include "fs_fchmod.hpp"
#include "state.hpp"
#include "fuse.h"
@ -41,10 +42,26 @@ namespace l
namespace FUSE
{
int
fchmod(const fuse_file_info_t *ffi_,
const mode_t mode_)
fchmod(const uint64_t fh_,
const mode_t mode_)
{
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);
uint64_t fh;
const fuse_context *fc = fuse_get_context();
fh = fh_;
if(fh == 0)
{
state.open_files.cvisit(fc->nodeid,
[&](auto &val_)
{
fh = reinterpret_cast<uint64_t>(val_.second.fi);
});
}
if(fh == 0)
return -ENOENT;
FileInfo *fi = reinterpret_cast<FileInfo*>(fh);
return l::fchmod(fi->fd,mode_);
}