mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
add writeback caching
This commit is contained in:
parent
e6c8fa3fad
commit
903d39f968
10 changed files with 103 additions and 17 deletions
|
|
@ -35,6 +35,21 @@ typedef Config::CacheFiles CacheFiles;
|
|||
|
||||
namespace l
|
||||
{
|
||||
static
|
||||
int
|
||||
tweak_flags_writeback_cache(const int flags_)
|
||||
{
|
||||
int flags;
|
||||
|
||||
flags = flags_;
|
||||
if((flags & O_ACCMODE) == O_WRONLY)
|
||||
flags = ((flags & ~O_ACCMODE) | O_RDWR);
|
||||
if(flags & O_APPEND)
|
||||
flags &= ~O_APPEND;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
open_core(const string &basepath_,
|
||||
|
|
@ -122,6 +137,9 @@ namespace FUSE
|
|||
break;
|
||||
}
|
||||
|
||||
if(config.writeback_cache)
|
||||
ffi_->flags = l::tweak_flags_writeback_cache(ffi_->flags);
|
||||
|
||||
return l::open(config.open,
|
||||
config.open_cache,
|
||||
config.branches,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue