Browse Source

Merge pull request #74 from trapexit/minfreespace

create minfreespace option. closes #71
pull/75/head
Antonio SJ Musumeci 9 years ago
parent
commit
6578b93190
  1. 4
      src/access.cpp
  2. 6
      src/chmod.cpp
  3. 4
      src/chown.cpp
  4. 1
      src/config.cpp
  5. 2
      src/config.hpp
  6. 6
      src/create.cpp
  7. 50
      src/fs.cpp
  8. 43
      src/fs.hpp
  9. 4
      src/getattr.cpp
  10. 4
      src/getxattr.cpp
  11. 4
      src/ioctl.cpp
  12. 9
      src/link.cpp
  13. 7
      src/listxattr.cpp
  14. 6
      src/mkdir.cpp
  15. 6
      src/mknod.cpp
  16. 4
      src/open.cpp
  17. 54
      src/option_parser.cpp
  18. 4
      src/readlink.cpp
  19. 4
      src/removexattr.cpp
  20. 9
      src/rename.cpp
  21. 4
      src/rmdir.cpp
  22. 4
      src/setxattr.cpp
  23. 4
      src/symlink.cpp
  24. 4
      src/truncate.cpp
  25. 4
      src/unlink.cpp
  26. 4
      src/utimens.cpp

4
src/access.cpp

@ -47,13 +47,14 @@ static
int
_access(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int mask)
{
int rv;
fs::Paths paths;
rv = searchFunc(srcmounts,fusepath,paths,1);
rv = searchFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -77,6 +78,7 @@ namespace mergerfs
return _access(*config.access,
config.srcmounts,
config.minfreespace,
fusepath,
mask);
}

6
src/chmod.cpp

@ -41,6 +41,7 @@ static
int
_chmod(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode)
{
@ -48,7 +49,7 @@ _chmod(const fs::find::Func actionFunc,
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -73,12 +74,13 @@ namespace mergerfs
mode_t mode)
{
const struct fuse_context *fc = fuse_get_context();
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const config::Config &config = config::get();
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
return _chmod(*config.chmod,
config.srcmounts,
config.minfreespace,
fusepath,
mode);
}

4
src/chown.cpp

@ -42,6 +42,7 @@ static
int
_chown(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const uid_t uid,
const gid_t gid)
@ -50,7 +51,7 @@ _chown(const fs::find::Func actionFunc,
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -82,6 +83,7 @@ namespace mergerfs
return _chown(*config.chown,
config.srcmounts,
config.minfreespace,
fusepath,
uid,
gid);

1
src/config.cpp

@ -46,6 +46,7 @@ namespace mergerfs
: destmount(),
srcmounts(),
srcmountslock(),
minfreespace(UINT32_MAX),
POLICYINIT(access),
POLICYINIT(chmod),
POLICYINIT(chown),

2
src/config.hpp

@ -28,6 +28,7 @@
#include <fuse.h>
#include <sys/stat.h>
#include <stdint.h>
#include <string>
#include <vector>
@ -54,6 +55,7 @@ namespace mergerfs
std::string destmount;
std::vector<std::string> srcmounts;
mutable pthread_rwlock_t srcmountslock;
size_t minfreespace;
public:
const Policy *policies[FuseFunc::Enum::END];

6
src/create.cpp

@ -46,6 +46,7 @@ int
_create(const fs::find::Func searchFunc,
const fs::find::Func createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode,
const int flags,
@ -59,11 +60,11 @@ _create(const fs::find::Func searchFunc,
fs::Paths existingpath;
dirname = fs::dirname(fusepath);
rv = searchFunc(srcmounts,dirname,existingpath,1);
rv = searchFunc(srcmounts,dirname,minfreespace,existingpath);
if(rv == -1)
return -errno;
rv = createFunc(srcmounts,dirname,createpath,1);
rv = createFunc(srcmounts,dirname,minfreespace,createpath);
if(rv == -1)
return -errno;
@ -101,6 +102,7 @@ namespace mergerfs
return _create(*config.getattr,
*config.create,
config.srcmounts,
config.minfreespace,
fusepath,
(mode & ~fc->umask),
fileinfo->flags,

50
src/fs.cpp

@ -520,8 +520,8 @@ namespace fs
int
invalid(const vector<string> &basepaths,
const string &fusepath,
Paths &rv,
size_t count)
const size_t minfreespace,
Paths &rv)
{
return (errno = EINVAL,-1);
}
@ -529,8 +529,8 @@ namespace fs
int
ff(const vector<string> &basepaths,
const string &fusepath,
Paths &paths,
size_t count)
const size_t minfreespace,
Paths &paths)
{
errno = ENOENT;
for(vector<string>::const_iterator
@ -558,8 +558,8 @@ namespace fs
int
ffwp(const vector<string> &basepaths,
const string &fusepath,
Paths &paths,
size_t count)
const size_t minfreespace,
Paths &paths)
{
Path fallback;
@ -597,8 +597,8 @@ namespace fs
int
newest(const vector<string> &basepaths,
const string &fusepath,
Paths &paths,
size_t count)
const size_t minfreespace,
Paths &paths)
{
time_t newest;
string npath;
@ -635,8 +635,8 @@ namespace fs
int
mfs(const vector<string> &basepaths,
const string &fusepath,
Paths &paths,
size_t count)
const size_t minfreespace,
Paths &paths)
{
fsblkcnt_t mfs;
size_t mfsidx;
@ -675,11 +675,11 @@ namespace fs
int
epmfs(const vector<string> &basepaths,
const string &fusepath,
Paths &paths,
size_t count)
const size_t minfreespace,
Paths &paths)
{
fsblkcnt_t existingmfs = 0;
fsblkcnt_t generalmfs = 0;
fsblkcnt_t existingmfs;
fsblkcnt_t generalmfs;
string fullpath;
string generalmfspath;
string existingmfspath;
@ -689,6 +689,8 @@ namespace fs
if(iter == eiter)
return (errno = ENOENT,-1);
existingmfs = 0;
generalmfs = 0;
do
{
int rv;
@ -736,8 +738,8 @@ namespace fs
int
all(const vector<string> &basepaths,
const string &fusepath,
Paths &paths,
size_t count)
const size_t minfreespace,
Paths &paths)
{
int rv;
struct stat st;
@ -745,17 +747,14 @@ namespace fs
for(vector<string>::const_iterator
iter = basepaths.begin(), eiter = basepaths.end();
iter != eiter && count;
iter != eiter;
++iter)
{
fullpath = fs::make_path(*iter,fusepath);
rv = ::lstat(fullpath.c_str(),&st);
if(rv == 0)
{
paths.push_back(Path(*iter,fullpath));
count--;
}
paths.push_back(Path(*iter,fullpath));
}
return paths.empty() ? (errno=ENOENT,-1) : 0;
@ -764,20 +763,17 @@ namespace fs
int
rand(const vector<string> &basepaths,
const string &fusepath,
Paths &paths,
size_t count)
const size_t minfreespace,
Paths &paths)
{
int rv;
rv = all(basepaths,fusepath,paths,-1);
rv = all(basepaths,fusepath,minfreespace,paths);
if(rv == -1)
return -1;
std::random_shuffle(paths.begin(),paths.end());
if(paths.size() > count)
paths.resize(count);
return 0;
}
}

43
src/fs.hpp

@ -39,12 +39,21 @@ namespace fs
struct Path
{
Path() {}
explicit
Path(const string &b,
const string &f)
: base(b),
full(f)
{}
explicit
Path(const char *b,
const string &f)
: base(b),
full(f)
{}
string base;
string full;
};
@ -113,40 +122,40 @@ namespace fs
namespace find
{
typedef int (*Func)(const vector<string>&,const string&,Paths&,size_t);
typedef int (*Func)(const vector<string>&,const string&,const size_t,Paths&);
int invalid(const vector<string> &basepaths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
int all(const vector<string> &basepaths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
int ff(const vector<string> &basepaths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
int ffwp(const vector<string> &paths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
int newest(const vector<string> &paths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
int mfs(const vector<string> &paths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
int epmfs(const vector<string> &paths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
int rand(const vector<string> &paths,
const string &fusepath,
Paths &path,
size_t max);
const size_t minfreespace,
Paths &path);
}
};

4
src/getattr.cpp

@ -67,13 +67,14 @@ static
int
_getattr(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
struct stat &buf)
{
int rv;
fs::Paths path;
rv = searchFunc(srcmounts,fusepath,path,1);
rv = searchFunc(srcmounts,fusepath,minfreespace,path);
if(rv == -1)
return -errno;
@ -101,6 +102,7 @@ namespace mergerfs
return _getattr(*config.getattr,
config.srcmounts,
config.minfreespace,
fusepath,
*st);
}

4
src/getxattr.cpp

@ -192,6 +192,7 @@ static
int
_getxattr(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname,
char *buf,
@ -201,7 +202,7 @@ _getxattr(const fs::find::Func searchFunc,
int rv;
fs::Paths path;
rv = searchFunc(srcmounts,fusepath,path,1);
rv = searchFunc(srcmounts,fusepath,minfreespace,path);
if(rv == -1)
return -errno;
@ -240,6 +241,7 @@ namespace mergerfs
return _getxattr(*config.getxattr,
config.srcmounts,
config.minfreespace,
fusepath,
attrname,
buf,

4
src/ioctl.cpp

@ -84,6 +84,7 @@ static
int
_ioctl_dir_base(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int cmd,
void *arg,
@ -94,7 +95,7 @@ _ioctl_dir_base(const fs::find::Func searchFunc,
int rv;
fs::Paths path;
rv = searchFunc(srcmounts,fusepath,path,1);
rv = searchFunc(srcmounts,fusepath,minfreespace,path);
if(rv == -1)
return -errno;
@ -124,6 +125,7 @@ _ioctl_dir(const string &fusepath,
return _ioctl_dir_base(*config.getattr,
config.srcmounts,
config.minfreespace,
fusepath,
cmd,
arg,

9
src/link.cpp

@ -43,6 +43,7 @@ static
int
_single_link(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &base,
const string &oldpath,
const string &newpath)
@ -58,7 +59,7 @@ _single_link(const fs::find::Func searchFunc,
fs::Paths foundpath;
newpathdir = fs::dirname(newpath);
rv = searchFunc(srcmounts,newpathdir,foundpath,1);
rv = searchFunc(srcmounts,newpathdir,minfreespace,foundpath);
if(rv == -1)
return -1;
@ -78,6 +79,7 @@ int
_link(const fs::find::Func searchFunc,
const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
{
@ -85,7 +87,7 @@ _link(const fs::find::Func searchFunc,
int error;
fs::Paths oldpaths;
rv = actionFunc(srcmounts,oldpath,oldpaths,-1);
rv = actionFunc(srcmounts,oldpath,minfreespace,oldpaths);
if(rv == -1)
return -errno;
@ -93,7 +95,7 @@ _link(const fs::find::Func searchFunc,
for(fs::Paths::const_iterator
i = oldpaths.begin(), ei = oldpaths.end(); i != ei; ++i)
{
rv = _single_link(searchFunc,srcmounts,i->base,oldpath,newpath);
rv = _single_link(searchFunc,srcmounts,minfreespace,i->base,oldpath,newpath);
if(rv == -1)
error = errno;
}
@ -117,6 +119,7 @@ namespace mergerfs
return _link(*config.getattr,
*config.link,
config.srcmounts,
config.minfreespace,
from,
to);
}

7
src/listxattr.cpp

@ -71,6 +71,7 @@ static
int
_listxattr(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
char *list,
const size_t size)
@ -79,7 +80,7 @@ _listxattr(const fs::find::Func searchFunc,
int rv;
fs::Paths path;
rv = searchFunc(srcmounts,fusepath,path,1);
rv = searchFunc(srcmounts,fusepath,minfreespace,path);
if(rv == -1)
return -errno;
@ -103,8 +104,7 @@ namespace mergerfs
const config::Config &config = config::get();
if(fusepath == config.controlfile)
return _listxattr_controlfile(list,
size);
return _listxattr_controlfile(list,size);
const struct fuse_context *fc = fuse_get_context();
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
@ -112,6 +112,7 @@ namespace mergerfs
return _listxattr(*config.listxattr,
config.srcmounts,
config.minfreespace,
fusepath,
list,
size);

6
src/mkdir.cpp

@ -44,6 +44,7 @@ int
_mkdir(const fs::find::Func searchFunc,
const fs::find::Func createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode)
{
@ -55,11 +56,11 @@ _mkdir(const fs::find::Func searchFunc,
fs::Paths existingpath;
dirname = fs::dirname(fusepath);
rv = searchFunc(srcmounts,dirname,existingpath,1);
rv = searchFunc(srcmounts,dirname,minfreespace,existingpath);
if(rv == -1)
return -errno;
rv = createFunc(srcmounts,dirname,createpaths,-1);
rv = createFunc(srcmounts,dirname,minfreespace,createpaths);
if(rv == -1)
return -errno;
@ -99,6 +100,7 @@ namespace mergerfs
return _mkdir(*config.getattr,
*config.mkdir,
config.srcmounts,
config.minfreespace,
fusepath,
(mode & ~fc->umask));
}

6
src/mknod.cpp

@ -46,6 +46,7 @@ int
_mknod(const fs::find::Func searchFunc,
const fs::find::Func createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const mode_t mode,
const dev_t dev)
@ -58,11 +59,11 @@ _mknod(const fs::find::Func searchFunc,
fs::Paths existingpath;
dirname = fs::dirname(fusepath);
rv = searchFunc(srcmounts,dirname,existingpath,1);
rv = searchFunc(srcmounts,dirname,minfreespace,existingpath);
if(rv == -1)
return -errno;
rv = createFunc(srcmounts,dirname,createpaths,-1);
rv = createFunc(srcmounts,dirname,minfreespace,createpaths);
if(rv == -1)
return -errno;
@ -103,6 +104,7 @@ namespace mergerfs
return _mknod(*config.getattr,
*config.mknod,
config.srcmounts,
config.minfreespace,
fusepath,
(mode & ~fc->umask),
rdev);

4
src/open.cpp

@ -43,6 +43,7 @@ static
int
_open(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const int flags,
uint64_t &fh)
@ -51,7 +52,7 @@ _open(const fs::find::Func searchFunc,
int rv;
fs::Paths path;
rv = searchFunc(srcmounts,fusepath,path,1);
rv = searchFunc(srcmounts,fusepath,minfreespace,path);
if(rv == -1)
return -errno;
@ -79,6 +80,7 @@ namespace mergerfs
return _open(*config.open,
config.srcmounts,
config.minfreespace,
fusepath,
fileinfo->flags,
fileinfo->fh);

54
src/option_parser.cpp

@ -27,6 +27,7 @@
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
@ -100,6 +101,38 @@ set_default_options(struct fuse_args &args)
set_option(args,"atomic_o_trunc");
}
static
int
parse_and_process_minfreespace(const std::string &value,
size_t &minfreespace)
{
char *endptr;
minfreespace = strtoll(value.c_str(),&endptr,10);
switch(*endptr)
{
case 'k':
case 'K':
minfreespace *= 1024;
break;
case 'm':
case 'M':
minfreespace *= (1024 * 1024);
break;
case 'b':
case 'B':
minfreespace *= (1024 * 1024 * 1024);
break;
default:
return 1;
}
return 0;
}
static
int
parse_and_process_arg(config::Config &config,
@ -121,19 +154,22 @@ parse_and_process_kv_arg(config::Config &config,
const std::string &key,
const std::string &value)
{
int rv;
int rv = -1;
std::vector<std::string> keypart;
str::split(keypart,key,'.');
if(keypart.size() != 2)
return 1;
if(keypart[0] == "func")
rv = config.set_func_policy(keypart[1],value);
else if(keypart[0] == "category")
rv = config.set_category_policy(keypart[1],value);
if(keypart.size() == 2)
{
if(keypart[0] == "func")
rv = config.set_func_policy(keypart[1],value);
else if(keypart[0] == "category")
rv = config.set_category_policy(keypart[1],value);
}
else
rv = -1;
{
if(key == "minfreespace")
rv = parse_and_process_minfreespace(value,config.minfreespace);
}
if(rv == -1)
rv = 1;

4
src/readlink.cpp

@ -43,6 +43,7 @@ static
int
_readlink(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
char *buf,
const size_t size)
@ -50,7 +51,7 @@ _readlink(const fs::find::Func searchFunc,
int rv;
fs::Paths path;
rv = searchFunc(srcmounts,fusepath,path,1);
rv = searchFunc(srcmounts,fusepath,minfreespace,path);
if(rv == -1)
return -errno;
@ -79,6 +80,7 @@ namespace mergerfs
return _readlink(*config.readlink,
config.srcmounts,
config.minfreespace,
fusepath,
buf,
size);

4
src/removexattr.cpp

@ -43,6 +43,7 @@ static
int
_removexattr(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname)
{
@ -51,7 +52,7 @@ _removexattr(const fs::find::Func actionFunc,
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -89,6 +90,7 @@ namespace mergerfs
return _removexattr(*config.removexattr,
config.srcmounts,
config.minfreespace,
fusepath,
attrname);
}

9
src/rename.cpp

@ -43,6 +43,7 @@ static
int
_single_rename(const fs::find::Func searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const fs::Path &oldpath,
const string &newpath)
{
@ -56,7 +57,7 @@ _single_rename(const fs::find::Func searchFunc,
fs::Paths newpathdir;
dirname = fs::dirname(newpath);
rv = searchFunc(srcmounts,dirname,newpathdir,1);
rv = searchFunc(srcmounts,dirname,minfreespace,newpathdir);
if(rv == -1)
return -1;
@ -76,6 +77,7 @@ int
_rename(const fs::find::Func searchFunc,
const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
{
@ -83,7 +85,7 @@ _rename(const fs::find::Func searchFunc,
int error;
fs::Paths oldpaths;
rv = actionFunc(srcmounts,oldpath,oldpaths,-1);
rv = actionFunc(srcmounts,oldpath,minfreespace,oldpaths);
if(rv == -1)
return -errno;
@ -91,7 +93,7 @@ _rename(const fs::find::Func searchFunc,
for(fs::Paths::const_iterator
i = oldpaths.begin(), ei = oldpaths.end(); i != ei; ++i)
{
rv = _single_rename(searchFunc,srcmounts,*i,newpath);
rv = _single_rename(searchFunc,srcmounts,minfreespace,*i,newpath);
if(rv == -1)
error = errno;
}
@ -115,6 +117,7 @@ namespace mergerfs
return _rename(*config.getattr,
*config.rename,
config.srcmounts,
config.minfreespace,
oldpath,
newpath);
}

4
src/rmdir.cpp

@ -42,13 +42,14 @@ static
int
_rmdir(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath)
{
int rv;
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -78,6 +79,7 @@ namespace mergerfs
return _rmdir(*config.rmdir,
config.srcmounts,
config.minfreespace,
fusepath);
}
}

4
src/setxattr.cpp

@ -242,6 +242,7 @@ static
int
_setxattr(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *attrname,
const char *attrval,
@ -253,7 +254,7 @@ _setxattr(const fs::find::Func actionFunc,
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -302,6 +303,7 @@ namespace mergerfs
return _setxattr(*config.setxattr,
config.srcmounts,
config.minfreespace,
fusepath,
attrname,
attrval,

4
src/symlink.cpp

@ -41,6 +41,7 @@ static
int
_symlink(const fs::find::Func createFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &oldpath,
const string &newpath)
{
@ -50,7 +51,7 @@ _symlink(const fs::find::Func createFunc,
fs::Paths newpathdirs;
newpathdir = fs::dirname(newpath);
rv = createFunc(srcmounts,newpathdir,newpathdirs,-1);
rv = createFunc(srcmounts,newpathdir,minfreespace,newpathdirs);
if(rv == -1)
return -errno;
@ -83,6 +84,7 @@ namespace mergerfs
return _symlink(*config.symlink,
config.srcmounts,
config.minfreespace,
oldpath,
newpath);
}

4
src/truncate.cpp

@ -43,6 +43,7 @@ static
int
_truncate(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const off_t size)
{
@ -50,7 +51,7 @@ _truncate(const fs::find::Func actionFunc,
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -81,6 +82,7 @@ namespace mergerfs
return _truncate(*config.truncate,
config.srcmounts,
config.minfreespace,
fusepath,
size);
}

4
src/unlink.cpp

@ -42,13 +42,14 @@ static
int
_unlink(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath)
{
int rv;
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -78,6 +79,7 @@ namespace mergerfs
return _unlink(*config.unlink,
config.srcmounts,
config.minfreespace,
fusepath);
}
}

4
src/utimens.cpp

@ -43,6 +43,7 @@ static
int
_utimens(const fs::find::Func actionFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const struct timespec ts[2])
{
@ -50,7 +51,7 @@ _utimens(const fs::find::Func actionFunc,
int error;
fs::Paths paths;
rv = actionFunc(srcmounts,fusepath,paths,-1);
rv = actionFunc(srcmounts,fusepath,minfreespace,paths);
if(rv == -1)
return -errno;
@ -81,6 +82,7 @@ namespace mergerfs
return _utimens(*config.utimens,
config.srcmounts,
config.minfreespace,
fusepath,
ts);
}

Loading…
Cancel
Save