use references to srcmounts rather than copies

This commit is contained in:
Antonio SJ Musumeci
2016-02-11 21:09:31 -05:00
parent f7c37d2974
commit 6086620e23
49 changed files with 1050 additions and 717 deletions
+10 -10
View File
@@ -40,16 +40,16 @@ namespace fs
{
void
findallfiles(const vector<string> &srcmounts,
const string &fusepath,
const char *fusepath,
vector<string> &paths)
{
int rv;
string fullpath;
struct stat st;
for(size_t i = 0, ei = srcmounts.size(); i != ei; i++)
{
int rv;
string fullpath;
struct stat st;
fs::path::make(srcmounts[i],fusepath,fullpath);
fs::path::make(&srcmounts[i],fusepath,fullpath);
rv = ::lstat(fullpath.c_str(),&st);
if(rv == 0)
@@ -59,12 +59,12 @@ namespace fs
int
findonfs(const vector<string> &srcmounts,
const string &fusepath,
const char *fusepath,
const int fd,
string &basepath)
{
int rv;
string tmppath;
string fullpath;
unsigned long fsid;
struct statvfs buf;
@@ -75,9 +75,9 @@ namespace fs
fsid = buf.f_fsid;
for(int i = 0, ei = srcmounts.size(); i != ei; i++)
{
fs::path::make(srcmounts[i],fusepath,tmppath);
fs::path::make(&srcmounts[i],fusepath,fullpath);
rv = ::statvfs(tmppath.c_str(),&buf);
rv = ::statvfs(fullpath.c_str(),&buf);
if(rv == -1)
continue;