add user.mergerfs.version xattr

This commit is contained in:
Antonio SJ Musumeci 2015-09-05 21:48:15 -04:00
parent adf983c8c3
commit b22528bac4
3 changed files with 21 additions and 3 deletions

View file

@ -40,6 +40,7 @@
#include "rwlock.hpp"
#include "xattr.hpp"
#include "str.hpp"
#include "version.hpp"
using std::string;
using std::vector;
@ -134,6 +135,13 @@ _getxattr_controlfile_policies(const Config &config,
attrvalue += ',' + (string)Policy::policies[i];
}
static
void
_getxattr_controlfile_version(string &attrvalue)
{
attrvalue = MERGERFS_VERSION;
}
static
int
_getxattr_controlfile(const Config &config,
@ -158,6 +166,8 @@ _getxattr_controlfile(const Config &config,
_getxattr_controlfile_minfreespace(config,attrvalue);
else if(attr[2] == "policies")
_getxattr_controlfile_policies(config,attrvalue);
else if(attr[2] == "version")
_getxattr_controlfile_version(attrvalue);
break;
case 4: