mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-26 09:56:28 -05:00
add minfreespace to xattr interface
This commit is contained in:
parent
54484f35fc
commit
b3109ac506
5 changed files with 54 additions and 25 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
|
|
@ -92,6 +93,18 @@ _getxattr_controlfile_srcmounts(const Config &config,
|
|||
attrvalue = str::join(config.srcmounts,':');
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
_getxattr_controlfile_minfreespace(const Config &config,
|
||||
string &attrvalue)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
snprintf(buf,sizeof(buf),"%li",config.minfreespace);
|
||||
|
||||
attrvalue = buf;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
_getxattr_controlfile(const Config &config,
|
||||
|
|
@ -108,6 +121,8 @@ _getxattr_controlfile(const Config &config,
|
|||
|
||||
if(!strcmp("srcmounts",attrbasename))
|
||||
_getxattr_controlfile_srcmounts(config,attrvalue);
|
||||
else if(!strcmp("minfreespace",attrbasename))
|
||||
_getxattr_controlfile_minfreespace(config,attrvalue);
|
||||
else if(!strncmp("category.",attrbasename,sizeof("category.")-1))
|
||||
_getxattr_controlfile_category_policy(config,&attrbasename[sizeof("category.")-1],attrvalue);
|
||||
else if(!strncmp("func.",attrbasename,sizeof("func.")-1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue