mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-01 04:16:59 -05:00
add existing path, least free space policy. closes #216
This commit is contained in:
parent
c568a6d356
commit
7bf1ca45e4
5 changed files with 172 additions and 47 deletions
|
|
@ -39,6 +39,7 @@ namespace mergerfs
|
|||
einval,
|
||||
enosys,
|
||||
enotsup,
|
||||
eplfs,
|
||||
epmfs,
|
||||
erofs,
|
||||
exdev,
|
||||
|
|
@ -95,6 +96,7 @@ namespace mergerfs
|
|||
static int einval(CType,cstrvec&,const char*,csize_t,cstrptrvec&);
|
||||
static int enosys(CType,cstrvec&,const char *,csize_t,cstrptrvec&);
|
||||
static int enotsup(CType,cstrvec&,const char *,csize_t,cstrptrvec&);
|
||||
static int eplfs(CType,cstrvec&,const char *,csize_t,cstrptrvec&);
|
||||
static int epmfs(CType,cstrvec&,const char *,csize_t,cstrptrvec&);
|
||||
static int erofs(CType,cstrvec&,const char *,csize_t,cstrptrvec&);
|
||||
static int exdev(CType,cstrvec&,const char *,csize_t,cstrptrvec&);
|
||||
|
|
@ -112,24 +114,34 @@ namespace mergerfs
|
|||
Enum::Type _enum;
|
||||
std::string _str;
|
||||
Func::Ptr _func;
|
||||
bool _path_preserving;
|
||||
|
||||
public:
|
||||
Policy()
|
||||
: _enum(invalid),
|
||||
_str(invalid),
|
||||
_func(invalid)
|
||||
_func(invalid),
|
||||
_path_preserving(false)
|
||||
{
|
||||
}
|
||||
|
||||
Policy(const Enum::Type enum_,
|
||||
const std::string &str_,
|
||||
const Func::Ptr func_)
|
||||
const Func::Ptr func_,
|
||||
const bool path_preserving_)
|
||||
: _enum(enum_),
|
||||
_str(str_),
|
||||
_func(func_)
|
||||
_func(func_),
|
||||
_path_preserving(path_preserving_)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
path_preserving() const
|
||||
{
|
||||
return _path_preserving;
|
||||
}
|
||||
|
||||
public:
|
||||
operator const Enum::Type() const { return _enum; }
|
||||
operator const std::string&() const { return _str; }
|
||||
|
|
@ -162,6 +174,7 @@ namespace mergerfs
|
|||
static const Policy &einval;
|
||||
static const Policy &enosys;
|
||||
static const Policy &enotsup;
|
||||
static const Policy &eplfs;
|
||||
static const Policy &epmfs;
|
||||
static const Policy &erofs;
|
||||
static const Policy &exdev;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue