mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-25 17:36:25 -05:00
generate the controlfile data on the fly. closes #19
This commit is contained in:
parent
15a0416eed
commit
ccb0ac1463
11 changed files with 57 additions and 52 deletions
|
|
@ -32,6 +32,18 @@
|
|||
#include "config.hpp"
|
||||
#include "fileinfo.hpp"
|
||||
|
||||
static
|
||||
int
|
||||
_fgetattr_controlfile(const struct stat &controlfilestat,
|
||||
const std::string cfdata,
|
||||
struct stat &st)
|
||||
{
|
||||
st = controlfilestat;
|
||||
st.st_size = cfdata.size();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
_fgetattr(const int fd,
|
||||
|
|
@ -57,7 +69,9 @@ namespace mergerfs
|
|||
const FileInfo *fileinfo = (FileInfo*)ffi->fh;
|
||||
|
||||
if(fusepath == config.controlfile)
|
||||
return (*st = config.controlfilestat,0);
|
||||
return _fgetattr_controlfile(config.controlfilestat,
|
||||
config.controlfiledata(),
|
||||
*st);
|
||||
|
||||
return _fgetattr(fileinfo->fd,
|
||||
*st);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue