mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Add support for FUSE passthrough
This commit is contained in:
parent
92312c8507
commit
e310d24615
412 changed files with 43707 additions and 17432 deletions
|
|
@ -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_);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue