mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
create lus (least used space) policy. closes #273
This commit is contained in:
parent
e541cdb755
commit
f7d3e8bf47
13 changed files with 189 additions and 8 deletions
18
src/fs.cpp
18
src/fs.cpp
|
|
@ -73,7 +73,8 @@ namespace fs
|
|||
bool
|
||||
info(const string &path,
|
||||
bool &readonly,
|
||||
size_t &spaceavail)
|
||||
size_t &spaceavail,
|
||||
size_t &spaceused)
|
||||
{
|
||||
bool rv;
|
||||
struct statvfs st;
|
||||
|
|
@ -83,6 +84,7 @@ namespace fs
|
|||
{
|
||||
readonly = StatVFS::readonly(st);
|
||||
spaceavail = StatVFS::spaceavail(st);
|
||||
spaceused = StatVFS::spaceused(st);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
@ -113,6 +115,20 @@ namespace fs
|
|||
return rv;
|
||||
}
|
||||
|
||||
bool
|
||||
spaceused(const string &path,
|
||||
size_t &spaceused)
|
||||
{
|
||||
bool rv;
|
||||
struct statvfs st;
|
||||
|
||||
rv = fs::statvfs(path,st);
|
||||
if(rv)
|
||||
spaceused = StatVFS::spaceused(st);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
findallfiles(const vector<string> &srcmounts,
|
||||
const char *fusepath,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue