mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-21 07:26:28 -05:00
rework config management
* Add standard way to do str2val and val2str conversion * Add support for a config file * Add support for reading and writing settings via ioctl
This commit is contained in:
parent
8d989777f8
commit
54c41c4994
90 changed files with 3292 additions and 2619 deletions
|
|
@ -14,6 +14,7 @@
|
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.hpp"
|
||||
#include "errno.hpp"
|
||||
#include "fileinfo.hpp"
|
||||
#include "fs_base_stat.hpp"
|
||||
|
|
@ -43,13 +44,22 @@ namespace l
|
|||
namespace FUSE
|
||||
{
|
||||
int
|
||||
fgetattr(const char *fusepath_,
|
||||
struct stat *st_,
|
||||
fuse_file_info *ffi_)
|
||||
fgetattr(const char *fusepath_,
|
||||
struct stat *st_,
|
||||
fuse_file_info *ffi_,
|
||||
fuse_timeouts_t *timeout_)
|
||||
{
|
||||
int rv;
|
||||
const Config &config = Config::ro();
|
||||
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);
|
||||
|
||||
return l::fgetattr(fi->fd,st_);
|
||||
rv = l::fgetattr(fi->fd,st_);
|
||||
|
||||
timeout_->entry = ((rv >= 0) ?
|
||||
config.cache_entry :
|
||||
config.cache_negative_entry);
|
||||
timeout_->attr = config.cache_attr;
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue