Loading include/common/rpc/rpc_types.hpp +2 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,8 @@ MERCURY_GEN_PROC(rpc_mk_symlink_in_t, ((hg_const_string_t) (path))(( #endif #ifdef HAS_RENAME MERCURY_GEN_PROC(rpc_rename_in_t, ((hg_const_string_t) (path))(( hg_const_string_t) (target_path))) MERCURY_GEN_PROC(rpc_rename_in_t, ((hg_const_string_t) (path))( (hg_const_string_t) (target_path))) #endif Loading src/client/gkfs_functions.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,15 @@ gkfs_rename(const string& old_path, const string& new_path) { if(!md_old || md_old.value().blocks() == -1) { return -1; } if(!md_old.value().target_path().empty()) { // the file is a renamed one, we need to get the metadata of the // original file. (There will be only one level) md_old = gkfs::utils::get_metadata(md_old.value().target_path(), false); if(!md_old) { return -1; } } auto md_new = gkfs::utils::get_metadata(new_path, false); if(md_new) { // the new file exists... check for circular... Loading src/client/hooks.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -385,7 +385,9 @@ hook_symlinkat(const char* oldname, int newdfd, const char* newname) { LOG(DEBUG, "{}() called with oldname: \"{}\", newfd: {}, newname: \"{}\"", __func__, oldname, newdfd, newname); #ifdef HAS_SYMLINKS bool internal1 = false; #endif std::string oldname_resolved; if(CTX->relativize_path(oldname, oldname_resolved)) { #ifdef HAS_SYMLINKS Loading Loading @@ -417,6 +419,8 @@ hook_symlinkat(const char* oldname, int newdfd, const char* newname) { return with_errno(gkfs::syscall::gkfs_mk_symlink( newname_resolved, oldname_resolved)); } LOG(WARNING, "{}() operation not supported", __func__); return -ENOTSUP; #else LOG(WARNING, "{}() operation not supported", __func__); return -ENOTSUP; Loading src/client/path.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -125,7 +125,8 @@ follow_symlinks(const string& path) { if(S_ISLNK(st.st_mode)) { auto link_resolved = ::unique_ptr<char[]>(new char[PATH_MAX]); if(real_realpath == nullptr) { real_realpath = reinterpret_cast<char* (*) (const char* path, char* resolved_path)>( real_realpath = reinterpret_cast<char* (*) (const char* path, char* resolved_path)>( dlsym(((void*) -1l), "realpath")); } Loading Loading @@ -218,7 +219,6 @@ resolve_new(const string& path, bool resolve_last_link) { } LOG(DEBUG, "external: \"{}\"", resolved); return make_pair(false, resolved); } /** Resolve path to its canonical representation Loading src/client/preload_util.cpp +3 −6 Original line number Diff line number Diff line Loading @@ -206,9 +206,6 @@ load_hostfile(const std::string& path) { // convert match[11] and match[12] to unsigned integers. CTX->fs_conf()->uid = std::stoi(match[11]); CTX->fs_conf()->gid = std::stoi(match[12]); } if(hosts.empty()) { throw runtime_error( Loading Loading
include/common/rpc/rpc_types.hpp +2 −2 Original line number Diff line number Diff line Loading @@ -95,8 +95,8 @@ MERCURY_GEN_PROC(rpc_mk_symlink_in_t, ((hg_const_string_t) (path))(( #endif #ifdef HAS_RENAME MERCURY_GEN_PROC(rpc_rename_in_t, ((hg_const_string_t) (path))(( hg_const_string_t) (target_path))) MERCURY_GEN_PROC(rpc_rename_in_t, ((hg_const_string_t) (path))( (hg_const_string_t) (target_path))) #endif Loading
src/client/gkfs_functions.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -436,6 +436,15 @@ gkfs_rename(const string& old_path, const string& new_path) { if(!md_old || md_old.value().blocks() == -1) { return -1; } if(!md_old.value().target_path().empty()) { // the file is a renamed one, we need to get the metadata of the // original file. (There will be only one level) md_old = gkfs::utils::get_metadata(md_old.value().target_path(), false); if(!md_old) { return -1; } } auto md_new = gkfs::utils::get_metadata(new_path, false); if(md_new) { // the new file exists... check for circular... Loading
src/client/hooks.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -385,7 +385,9 @@ hook_symlinkat(const char* oldname, int newdfd, const char* newname) { LOG(DEBUG, "{}() called with oldname: \"{}\", newfd: {}, newname: \"{}\"", __func__, oldname, newdfd, newname); #ifdef HAS_SYMLINKS bool internal1 = false; #endif std::string oldname_resolved; if(CTX->relativize_path(oldname, oldname_resolved)) { #ifdef HAS_SYMLINKS Loading Loading @@ -417,6 +419,8 @@ hook_symlinkat(const char* oldname, int newdfd, const char* newname) { return with_errno(gkfs::syscall::gkfs_mk_symlink( newname_resolved, oldname_resolved)); } LOG(WARNING, "{}() operation not supported", __func__); return -ENOTSUP; #else LOG(WARNING, "{}() operation not supported", __func__); return -ENOTSUP; Loading
src/client/path.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -125,7 +125,8 @@ follow_symlinks(const string& path) { if(S_ISLNK(st.st_mode)) { auto link_resolved = ::unique_ptr<char[]>(new char[PATH_MAX]); if(real_realpath == nullptr) { real_realpath = reinterpret_cast<char* (*) (const char* path, char* resolved_path)>( real_realpath = reinterpret_cast<char* (*) (const char* path, char* resolved_path)>( dlsym(((void*) -1l), "realpath")); } Loading Loading @@ -218,7 +219,6 @@ resolve_new(const string& path, bool resolve_last_link) { } LOG(DEBUG, "external: \"{}\"", resolved); return make_pair(false, resolved); } /** Resolve path to its canonical representation Loading
src/client/preload_util.cpp +3 −6 Original line number Diff line number Diff line Loading @@ -206,9 +206,6 @@ load_hostfile(const std::string& path) { // convert match[11] and match[12] to unsigned integers. CTX->fs_conf()->uid = std::stoi(match[11]); CTX->fs_conf()->gid = std::stoi(match[12]); } if(hosts.empty()) { throw runtime_error( Loading