|
|
@ -282,8 +282,8 @@ _(const PassthroughEnum e_, |
|
|
|
namespace FUSE |
|
|
|
{ |
|
|
|
int |
|
|
|
open2(const char *fusepath_, |
|
|
|
fuse_file_info_t *ffi_) |
|
|
|
open_regular(const char *fusepath_, |
|
|
|
fuse_file_info_t *ffi_) |
|
|
|
{ |
|
|
|
int rv; |
|
|
|
Config::Read cfg; |
|
|
@ -324,6 +324,52 @@ namespace FUSE |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int |
|
|
|
open_passthrough(const char *fusepath_, |
|
|
|
fuse_file_info_t *ffi_) |
|
|
|
{ |
|
|
|
int rv; |
|
|
|
Config::Read cfg; |
|
|
|
const fuse_context *fc = fuse_get_context(); |
|
|
|
const ugid::Set ugid(fc->uid,fc->gid); |
|
|
|
|
|
|
|
l::config_to_ffi_flags(cfg,fc->pid,ffi_); |
|
|
|
|
|
|
|
if(cfg->writeback_cache) |
|
|
|
l::tweak_flags_writeback_cache(&ffi_->flags); |
|
|
|
|
|
|
|
ffi_->noflush = !l::calculate_flush(cfg->flushonclose, |
|
|
|
ffi_->flags); |
|
|
|
|
|
|
|
rv = l::open(cfg->func.open.policy, |
|
|
|
cfg->branches, |
|
|
|
fusepath_, |
|
|
|
ffi_, |
|
|
|
cfg->link_cow, |
|
|
|
cfg->nfsopenhack); |
|
|
|
|
|
|
|
if(rv != 0) |
|
|
|
return rv; |
|
|
|
|
|
|
|
switch(_(cfg->passthrough,ffi_->flags)) |
|
|
|
{ |
|
|
|
case _(PassthroughEnum::r, O_RDONLY): |
|
|
|
case _(PassthroughEnum::r, O_RDWR): |
|
|
|
case _(PassthroughEnum::w, O_WRONLY): |
|
|
|
case _(PassthroughEnum::w, O_RDWR): |
|
|
|
case _(PassthroughEnum::ro,O_RDONLY): |
|
|
|
case _(PassthroughEnum::wo,O_WRONLY): |
|
|
|
case _(PassthroughEnum::rw,O_RDONLY): |
|
|
|
case _(PassthroughEnum::rw,O_WRONLY): |
|
|
|
case _(PassthroughEnum::rw,O_RDWR): |
|
|
|
return l::passthrough(fc,ffi_); |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int |
|
|
|
open(const char *fusepath_, |
|
|
|