Skip to content

Commit

Permalink
Merge pull request #418 from trapexit/fix
Browse files Browse the repository at this point in the history
use fusepath from fileinfo. closes #417
  • Loading branch information
trapexit authored Jun 24, 2017
2 parents 721bd4d + bfd410d commit fa3ff40
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace fs

int
findonfs(const vector<string> &srcmounts,
const char *fusepath,
const string &fusepath,
const int fd,
string &basepath)
{
Expand Down
2 changes: 1 addition & 1 deletion src/fs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace fs
vector<string> &paths);

int findonfs(const vector<string> &srcmounts,
const char *fusepath,
const string &fusepath,
const int fd,
string &basepath);

Expand Down
9 changes: 0 additions & 9 deletions src/fs_movefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ namespace fs
const string &fusepath,
const size_t additional_size,
int &origfd)
{
return fs::movefile(basepaths,fusepath.c_str(),additional_size,origfd);
}

int
movefile(const vector<string> &basepaths,
const char *fusepath,
const size_t additional_size,
int &origfd)
{
int rv;
int fdin;
Expand Down
6 changes: 0 additions & 6 deletions src/fs_movefile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ namespace fs
const std::string &fusepath,
const size_t additional_size,
int &origfd);

int
movefile(const std::vector<std::string> &basepaths,
const char *fusepath,
const size_t additional_size,
int &origfd);
}

#endif
18 changes: 18 additions & 0 deletions src/fs_path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ namespace fs
base += suffix;
}

inline
void
append(string &base,
const string &suffix)
{
base += suffix;
}

inline
void
make(const string *base,
Expand All @@ -47,6 +55,16 @@ namespace fs
output = *base;
output += suffix;
}

inline
void
make(const string *base,
const string &suffix,
string &output)
{
output = *base;
output += suffix;
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/write_buf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace mergerfs
const rwlock::ReadGuard readlock(&config.srcmountslock);

extra = fuse_buf_size(src);
rv = fs::movefile(config.srcmounts,fusepath,extra,fi->fd);
rv = fs::movefile(config.srcmounts,fi->fusepath,extra,fi->fd);
if(rv == -1)
return -ENOSPC;

Expand Down

0 comments on commit fa3ff40

Please sign in to comment.