create lus (least used space) policy. closes #273

This commit is contained in:
Antonio SJ Musumeci 2016-05-07 14:05:38 -04:00
parent e541cdb755
commit f7d3e8bf47
13 changed files with 189 additions and 8 deletions

View file

@ -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,