Browse Source

add category to policies so as to distinguish between creates and searches

pull/78/head
Antonio SJ Musumeci 10 years ago
parent
commit
51b6d3f647
  1. 13
      src/access.cpp
  2. 12
      src/chmod.cpp
  3. 14
      src/chown.cpp
  4. 20
      src/create.cpp
  5. 12
      src/getattr.cpp
  6. 16
      src/getxattr.cpp
  7. 18
      src/ioctl.cpp
  8. 28
      src/link.cpp
  9. 14
      src/listxattr.cpp
  10. 16
      src/mkdir.cpp
  11. 18
      src/mknod.cpp
  12. 14
      src/open.cpp
  13. 103
      src/policy.hpp
  14. 9
      src/policy_all.cpp
  15. 9
      src/policy_epmfs.cpp
  16. 9
      src/policy_ff.cpp
  17. 9
      src/policy_ffwp.cpp
  18. 11
      src/policy_fwfs.cpp
  19. 9
      src/policy_invalid.cpp
  20. 11
      src/policy_lfs.cpp
  21. 9
      src/policy_mfs.cpp
  22. 9
      src/policy_newest.cpp
  23. 11
      src/policy_rand.cpp
  24. 14
      src/readlink.cpp
  25. 12
      src/removexattr.cpp
  26. 26
      src/rename.cpp
  27. 10
      src/rmdir.cpp
  28. 18
      src/setxattr.cpp
  29. 12
      src/symlink.cpp
  30. 12
      src/truncate.cpp
  31. 10
      src/unlink.cpp
  32. 12
      src/utimens.cpp

13
src/access.cpp

@ -42,14 +42,15 @@
using std::string;
using std::vector;
using mergerfs::Policy;
using mergerfs::Category;
static
int
_access(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int mask)
_access(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int mask)
{
int rv;
Paths paths;
@ -76,7 +77,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _access(*config.access,
return _access(config.access,
config.srcmounts,
config.minfreespace,
fusepath,

12
src/chmod.cpp

@ -39,11 +39,11 @@ using mergerfs::Policy;
static
int
_chmod(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode)
_chmod(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode)
{
int rv;
int error;
@ -78,7 +78,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _chmod(*config.chmod,
return _chmod(config.chmod,
config.srcmounts,
config.minfreespace,
fusepath,

14
src/chown.cpp

@ -40,12 +40,12 @@ using mergerfs::Policy;
static
int
_chown(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const uid_t uid,
const gid_t gid)
_chown(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const uid_t uid,
const gid_t gid)
{
int rv;
int error;
@ -81,7 +81,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _chown(*config.chown,
return _chown(config.chown,
config.srcmounts,
config.minfreespace,
fusepath,

20
src/create.cpp

@ -43,14 +43,14 @@ using mergerfs::Policy;
static
int
_create(const Policy::Func::Ptr searchFunc,
const Policy::Func::Ptr createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode,
const int flags,
uint64_t &fh)
_create(Policy::Func::Search searchFunc,
Policy::Func::Create createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode,
const int flags,
uint64_t &fh)
{
int fd;
int rv;
@ -99,8 +99,8 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _create(*config.getattr,
*config.create,
return _create(config.getattr,
config.create,
config.srcmounts,
config.minfreespace,
fusepath,

12
src/getattr.cpp

@ -66,11 +66,11 @@ _getattr_controlfile(struct stat &buf)
static
int
_getattr(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
struct stat &buf)
_getattr(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
struct stat &buf)
{
int rv;
Paths path;
@ -101,7 +101,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _getattr(*config.getattr,
return _getattr(config.getattr,
config.srcmounts,
config.minfreespace,
fusepath,

16
src/getxattr.cpp

@ -190,13 +190,13 @@ _getxattr_user_mergerfs(const Path &path,
static
int
_getxattr(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname,
char *buf,
const size_t count)
_getxattr(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname,
char *buf,
const size_t count)
{
#ifndef WITHOUT_XATTR
int rv;
@ -239,7 +239,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _getxattr(*config.getxattr,
return _getxattr(config.getxattr,
config.srcmounts,
config.minfreespace,
fusepath,

18
src/ioctl.cpp

@ -82,14 +82,14 @@ _ioctl(const int fd,
#ifdef FUSE_IOCTL_DIR
static
int
_ioctl_dir_base(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int cmd,
void *arg,
const unsigned int flags,
void *data)
_ioctl_dir_base(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int cmd,
void *arg,
const unsigned int flags,
void *data)
{
int fd;
int rv;
@ -123,7 +123,7 @@ _ioctl_dir(const string &fusepath,
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _ioctl_dir_base(*config.getattr,
return _ioctl_dir_base(config.getattr,
config.srcmounts,
config.minfreespace,
fusepath,

28
src/link.cpp

@ -41,12 +41,12 @@ using mergerfs::Policy;
static
int
_single_link(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &base,
const string &oldpath,
const string &newpath)
_single_link(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &base,
const string &oldpath,
const string &newpath)
{
int rv;
const string fulloldpath = fs::make_path(base,oldpath);
@ -76,12 +76,12 @@ _single_link(const Policy::Func::Ptr searchFunc,
static
int
_link(const Policy::Func::Ptr searchFunc,
const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
_link(Policy::Func::Search searchFunc,
Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
{
int rv;
int error;
@ -116,8 +116,8 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _link(*config.getattr,
*config.link,
return _link(config.getattr,
config.link,
config.srcmounts,
config.minfreespace,
from,

14
src/listxattr.cpp

@ -69,12 +69,12 @@ _listxattr_controlfile(char *list,
static
int
_listxattr(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
char *list,
const size_t size)
_listxattr(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
char *list,
const size_t size)
{
#ifndef WITHOUT_XATTR
int rv;
@ -110,7 +110,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _listxattr(*config.listxattr,
return _listxattr(config.listxattr,
config.srcmounts,
config.minfreespace,
fusepath,

16
src/mkdir.cpp

@ -42,12 +42,12 @@ using mergerfs::Policy;
static
int
_mkdir(const Policy::Func::Ptr searchFunc,
const Policy::Func::Ptr createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode)
_mkdir(Policy::Func::Search searchFunc,
Policy::Func::Create createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode)
{
int rv;
int error;
@ -98,8 +98,8 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _mkdir(*config.getattr,
*config.mkdir,
return _mkdir(config.getattr,
config.mkdir,
config.srcmounts,
config.minfreespace,
fusepath,

18
src/mknod.cpp

@ -44,13 +44,13 @@ using mergerfs::Policy;
static
int
_mknod(const Policy::Func::Ptr searchFunc,
const Policy::Func::Ptr createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode,
const dev_t dev)
_mknod(Policy::Func::Search searchFunc,
Policy::Func::Create createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode,
const dev_t dev)
{
int rv;
int error;
@ -102,8 +102,8 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _mknod(*config.getattr,
*config.mknod,
return _mknod(config.getattr,
config.mknod,
config.srcmounts,
config.minfreespace,
fusepath,

14
src/open.cpp

@ -42,12 +42,12 @@ using mergerfs::Policy;
static
int
_open(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int flags,
uint64_t &fh)
_open(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int flags,
uint64_t &fh)
{
int fd;
int rv;
@ -79,7 +79,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _open(*config.open,
return _open(config.open,
config.srcmounts,
config.minfreespace,
fusepath,

103
src/policy.hpp

@ -31,6 +31,7 @@
#include "path.hpp"
#include "fs.hpp"
#include "category.hpp"
namespace mergerfs
{
@ -61,19 +62,74 @@ namespace mergerfs
typedef std::string string;
typedef std::size_t size_t;
typedef std::vector<string> strvec;
typedef int (*Ptr)(const strvec&,const string&,const size_t,Paths&);
static int invalid(const strvec&,const string&,const size_t,Paths&);
static int all(const strvec&,const string&,const size_t,Paths&);
static int epmfs(const strvec&,const string&,const size_t,Paths&);
static int ff(const strvec&,const string&,const size_t,Paths&);
static int ffwp(const strvec&,const string&,const size_t,Paths&);
static int fwfs(const strvec&,const string&,const size_t,Paths&);
static int lfs(const strvec&,const string&,const size_t,Paths&);
static int mfs(const strvec&,const string&,const size_t,Paths&);
static int newest(const strvec&,const string&,const size_t,Paths&);
static int rand(const strvec&,const string&,const size_t,Paths&);
typedef const string cstring;
typedef const size_t csize_t;
typedef const strvec cstrvec;
typedef const Category::Enum::Type CType;
typedef int (*Ptr)(CType,cstrvec&,cstring&,csize_t,Paths&);
class Action
{
public:
Action(const Policy *p)
: func(p->_func)
{}
int
operator()(cstrvec& b,cstring& c,csize_t d,Paths& e)
{
return func(Category::Enum::action,b,c,d,e);
}
private:
const Ptr func;
};
class Create
{
public:
Create(const Policy *p)
: func(p->_func)
{}
int
operator()(cstrvec& b,cstring& c,csize_t d,Paths& e)
{
return func(Category::Enum::create,b,c,d,e);
}
private:
const Ptr func;
};
class Search
{
public:
Search(const Policy *p)
: func(p->_func)
{}
int
operator()(cstrvec& b,cstring& c,csize_t d,Paths& e)
{
return func(Category::Enum::search,b,c,d,e);
}
private:
const Ptr func;
};
static int invalid(CType,cstrvec&,cstring&,csize_t,Paths&);
static int all(CType,cstrvec&,cstring&,csize_t,Paths&);
static int epmfs(CType,cstrvec&,cstring&,csize_t,Paths&);
static int ff(CType,cstrvec&,cstring&,csize_t,Paths&);
static int ffwp(CType,cstrvec&,cstring&,csize_t,Paths&);
static int fwfs(CType,cstrvec&,cstring&,csize_t,Paths&);
static int lfs(CType,cstrvec&,cstring&,csize_t,Paths&);
static int mfs(CType,cstrvec&,cstring&,csize_t,Paths&);
static int newest(CType,cstrvec&,cstring&,csize_t,Paths&);
static int rand(CType,cstrvec&,cstring&,csize_t,Paths&);
};
private:
@ -124,16 +180,17 @@ namespace mergerfs
public:
static const std::vector<Policy> _policies_;
static const Policy * const policies;
static const Policy &invalid;
static const Policy &all;
static const Policy &epmfs;
static const Policy &ff;
static const Policy &ffwp;
static const Policy &fwfs;
static const Policy &lfs;
static const Policy &mfs;
static const Policy &newest;
static const Policy &rand;
static const Policy &invalid;
static const Policy &all;
static const Policy &epmfs;
static const Policy &ff;
static const Policy &ffwp;
static const Policy &fwfs;
static const Policy &lfs;
static const Policy &mfs;
static const Policy &newest;
static const Policy &rand;
};
}

9
src/policy_all.cpp

@ -39,10 +39,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::all(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::all(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
int rv;
struct stat st;

9
src/policy_epmfs.cpp

@ -40,10 +40,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::epmfs(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::epmfs(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
fsblkcnt_t existingmfs;
fsblkcnt_t generalmfs;

9
src/policy_ff.cpp

@ -40,10 +40,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::ff(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::ff(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
errno = ENOENT;
for(vector<string>::const_iterator

9
src/policy_ffwp.cpp

@ -39,10 +39,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::ffwp(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::ffwp(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
Path fallback;

11
src/policy_fwfs.cpp

@ -37,10 +37,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::fwfs(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::fwfs(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
for(size_t i = 0, size = basepaths.size(); i != size; i++)
{
@ -64,6 +65,6 @@ namespace mergerfs
}
}
return mfs(basepaths,fusepath,minfreespace,paths);
return mfs(type,basepaths,fusepath,minfreespace,paths);
}
}

9
src/policy_invalid.cpp

@ -36,10 +36,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::invalid(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &rv)
Policy::Func::invalid(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &rv)
{
return (errno = EINVAL,-1);
}

11
src/policy_lfs.cpp

@ -40,10 +40,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::lfs(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::lfs(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
fsblkcnt_t lfs;
const char *lfsstr;
@ -73,7 +74,7 @@ namespace mergerfs
}
if(lfsstr == NULL)
return Policy::Func::mfs(basepaths,fusepath,minfreespace,paths);
return mfs(type,basepaths,fusepath,minfreespace,paths);
paths.push_back(Path(lfsstr,
fs::make_path(lfsstr,fusepath)));

9
src/policy_mfs.cpp

@ -37,10 +37,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::mfs(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::mfs(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
fsblkcnt_t mfs;
size_t mfsidx;

9
src/policy_newest.cpp

@ -39,10 +39,11 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::newest(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::newest(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
time_t newest;
string npath;

11
src/policy_rand.cpp

@ -37,14 +37,15 @@ using std::size_t;
namespace mergerfs
{
int
Policy::Func::rand(const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
Policy::Func::rand(const Category::Enum::Type type,
const vector<string> &basepaths,
const string &fusepath,
const size_t minfreespace,
Paths &paths)
{
int rv;
rv = Policy::Func::all(basepaths,fusepath,minfreespace,paths);
rv = Policy::Func::all(type,basepaths,fusepath,minfreespace,paths);
if(rv == -1)
return -1;

14
src/readlink.cpp

@ -41,12 +41,12 @@ using mergerfs::Policy;
static
int
_readlink(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
char *buf,
const size_t size)
_readlink(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
char *buf,
const size_t size)
{
int rv;
Paths path;
@ -78,7 +78,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _readlink(*config.readlink,
return _readlink(config.readlink,
config.srcmounts,
config.minfreespace,
fusepath,

12
src/removexattr.cpp

@ -42,11 +42,11 @@ using mergerfs::Policy;
static
int
_removexattr(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname)
_removexattr(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname)
{
#ifndef WITHOUT_XATTR
int rv;
@ -89,7 +89,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _removexattr(*config.removexattr,
return _removexattr(config.removexattr,
config.srcmounts,
config.minfreespace,
fusepath,

26
src/rename.cpp

@ -42,11 +42,11 @@ using mergerfs::Policy;
static
int
_single_rename(const Policy::Func::Ptr searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const Path &oldpath,
const string &newpath)
_single_rename(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const Path &oldpath,
const string &newpath)
{
int rv;
const string fullnewpath = fs::make_path(oldpath.base,newpath);
@ -75,12 +75,12 @@ _single_rename(const Policy::Func::Ptr searchFunc,
static
int
_rename(const Policy::Func::Ptr searchFunc,
const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
_rename(Policy::Func::Search searchFunc,
Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
{
int rv;
int error;
@ -115,8 +115,8 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _rename(*config.getattr,
*config.rename,
return _rename(config.getattr,
config.rename,
config.srcmounts,
config.minfreespace,
oldpath,

10
src/rmdir.cpp

@ -40,10 +40,10 @@ using mergerfs::Policy;
static
int
_rmdir(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath)
_rmdir(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath)
{
int rv;
int error;
@ -77,7 +77,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readguard(&config.srcmountslock);
return _rmdir(*config.rmdir,
return _rmdir(config.rmdir,
config.srcmounts,
config.minfreespace,
fusepath);

18
src/setxattr.cpp

@ -240,14 +240,14 @@ _setxattr_controlfile(config::Config &config,
static
int
_setxattr(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname,
const char *attrval,
const size_t attrvalsize,
const int flags)
_setxattr(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname,
const char *attrval,
const size_t attrvalsize,
const int flags)
{
#ifndef WITHOUT_XATTR
int rv;
@ -301,7 +301,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _setxattr(*config.setxattr,
return _setxattr(config.setxattr,
config.srcmounts,
config.minfreespace,
fusepath,

12
src/symlink.cpp

@ -40,11 +40,11 @@ using mergerfs::Policy;
static
int
_symlink(const Policy::Func::Ptr createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
_symlink(Policy::Func::Create createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
{
int rv;
int error;
@ -83,7 +83,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _symlink(*config.symlink,
return _symlink(config.symlink,
config.srcmounts,
config.minfreespace,
oldpath,

12
src/truncate.cpp

@ -42,11 +42,11 @@ using mergerfs::Policy;
static
int
_truncate(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const off_t size)
_truncate(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const off_t size)
{
int rv;
int error;
@ -81,7 +81,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _truncate(*config.truncate,
return _truncate(config.truncate,
config.srcmounts,
config.minfreespace,
fusepath,

10
src/unlink.cpp

@ -41,10 +41,10 @@ using mergerfs::Policy;
static
int
_unlink(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath)
_unlink(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath)
{
int rv;
int error;
@ -78,7 +78,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _unlink(*config.unlink,
return _unlink(config.unlink,
config.srcmounts,
config.minfreespace,
fusepath);

12
src/utimens.cpp

@ -42,11 +42,11 @@ using mergerfs::Policy;
static
int
_utimens(const Policy::Func::Ptr actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const struct timespec ts[2])
_utimens(Policy::Func::Action actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const struct timespec ts[2])
{
int rv;
int error;
@ -81,7 +81,7 @@ namespace mergerfs
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _utimens(*config.utimens,
return _utimens(config.utimens,
config.srcmounts,
config.minfreespace,
fusepath,

Loading…
Cancel
Save