mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-30 11:56:31 -05:00
add file caching across opens and runtime control
This commit is contained in:
parent
02b657edff
commit
529a953e30
13 changed files with 601 additions and 336 deletions
|
|
@ -235,6 +235,26 @@ namespace l
|
|||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
setxattr(const string &attrval_,
|
||||
const int flags_,
|
||||
Config::CacheFiles &cache_files_)
|
||||
{
|
||||
Config::CacheFiles tmp;
|
||||
|
||||
if((flags_ & XATTR_CREATE) == XATTR_CREATE)
|
||||
return -EEXIST;
|
||||
|
||||
tmp = attrval_;
|
||||
if(!tmp.valid())
|
||||
return -EINVAL;
|
||||
|
||||
cache_files_ = tmp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
setxattr_controlfile_func_policy(Config &config,
|
||||
|
|
@ -438,6 +458,8 @@ namespace l
|
|||
return l::setxattr_controlfile_cache_negative_entry(attrval,flags);
|
||||
else if((attr[2] == "cache") && (attr[3] == "readdir"))
|
||||
return l::setxattr_bool(attrval,flags,config.cache_readdir);
|
||||
else if((attr[2] == "cache") && (attr[3] == "files"))
|
||||
return l::setxattr(attrval,flags,config.cache_files);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue