Loading src/client/gkfs_functions.cpp +16 −6 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ gkfs_open(const std::string& path, mode_t mode, int flags) { // get renamed path from target and retrieve metadata from it auto md_ = gkfs::utils::get_metadata(md.target_path()); new_path = md.target_path(); while(!md_.value().target_path().empty()) { while(!md_.value().target_path().empty() and md_.value().blocks() != -1) { new_path = md_.value().target_path(); md_ = gkfs::utils::get_metadata(md_.value().target_path(), false); Loading Loading @@ -343,7 +344,8 @@ gkfs_remove(const std::string& path) { if(!md.value().target_path().empty()) { auto md_ = gkfs::utils::get_metadata(md.value().target_path()); std::string new_path = md.value().target_path(); while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { new_path = md.value().target_path(); md = gkfs::utils::get_metadata(md.value().target_path(), false); if(!md) { Loading Loading @@ -397,7 +399,7 @@ gkfs_access(const std::string& path, const int mask, bool follow_links) { return -1; } else { while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { LOG(DEBUG, "File exist but it is renamed '{} -> {}'", path, md.value().target_path()); md = gkfs::utils::get_metadata(md.value().target_path(), false); Loading Loading @@ -510,12 +512,16 @@ gkfs_stat(const string& path, struct stat* buf, bool follow_links) { errno = ENOENT; return -1; } else { while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { md = gkfs::utils::get_metadata(md.value().target_path(), false); if(!md) { return -1; } } if(md.value().blocks() == -1) md.value().blocks(md->size() / 4096); } } #endif Loading Loading @@ -551,12 +557,16 @@ gkfs_statx(int dirfs, const std::string& path, int flags, unsigned int mask, errno = ENOENT; return -1; } else { while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { md = gkfs::utils::get_metadata(md.value().target_path(), false); if(!md) { return -1; } } if(md.value().blocks() == -1) md.value().blocks(md->size() / 4096); } } #endif Loading Loading @@ -827,7 +837,7 @@ gkfs_truncate(const std::string& path, off_t length) { return -1; } else if(!md.value().target_path().empty()) { std::string new_path; while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { new_path = md.value().target_path(); md = gkfs::utils::get_metadata(md.value().target_path()); } Loading src/client/hooks.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ hook_fstat(unsigned int fd, struct stat* buf) { // We can change file_map and recall auto md = gkfs::utils::get_metadata(path, false); if(md.has_value() && md.value().blocks() == -1) { path = md.value().rename_path(); path = md.value().target_path(); } #endif return with_errno(gkfs::syscall::gkfs_stat(path, buf)); Loading src/daemon/handler/srv_metadata.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -855,7 +855,7 @@ rpc_srv_get_dirents_extended(hg_handle_t handle) { * * All exceptions must be caught here and dealt with accordingly. Any errors are * placed in the response. * @endinteral * @endinternal * @param handle Mercury RPC handle (path is the symbolic link) * @return Mercury error code to Mercury */ Loading Loading @@ -935,11 +935,11 @@ rpc_srv_rename(hg_handle_t handle) { try { gkfs::metadata::Metadata md = gkfs::metadata::get(in.path); if(md.blocks() == -1) { // if(md.blocks() == -1) { // We need to fill the rename path as this is an inverse path // old -> new md.target_path(in.target_path); } //} GKFS_DATA->spdlogger()->debug( "{}() Updating path '{}' with metadata '{}'", __func__, in.path, md.serialize()); Loading Loading
src/client/gkfs_functions.cpp +16 −6 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ gkfs_open(const std::string& path, mode_t mode, int flags) { // get renamed path from target and retrieve metadata from it auto md_ = gkfs::utils::get_metadata(md.target_path()); new_path = md.target_path(); while(!md_.value().target_path().empty()) { while(!md_.value().target_path().empty() and md_.value().blocks() != -1) { new_path = md_.value().target_path(); md_ = gkfs::utils::get_metadata(md_.value().target_path(), false); Loading Loading @@ -343,7 +344,8 @@ gkfs_remove(const std::string& path) { if(!md.value().target_path().empty()) { auto md_ = gkfs::utils::get_metadata(md.value().target_path()); std::string new_path = md.value().target_path(); while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { new_path = md.value().target_path(); md = gkfs::utils::get_metadata(md.value().target_path(), false); if(!md) { Loading Loading @@ -397,7 +399,7 @@ gkfs_access(const std::string& path, const int mask, bool follow_links) { return -1; } else { while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { LOG(DEBUG, "File exist but it is renamed '{} -> {}'", path, md.value().target_path()); md = gkfs::utils::get_metadata(md.value().target_path(), false); Loading Loading @@ -510,12 +512,16 @@ gkfs_stat(const string& path, struct stat* buf, bool follow_links) { errno = ENOENT; return -1; } else { while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { md = gkfs::utils::get_metadata(md.value().target_path(), false); if(!md) { return -1; } } if(md.value().blocks() == -1) md.value().blocks(md->size() / 4096); } } #endif Loading Loading @@ -551,12 +557,16 @@ gkfs_statx(int dirfs, const std::string& path, int flags, unsigned int mask, errno = ENOENT; return -1; } else { while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { md = gkfs::utils::get_metadata(md.value().target_path(), false); if(!md) { return -1; } } if(md.value().blocks() == -1) md.value().blocks(md->size() / 4096); } } #endif Loading Loading @@ -827,7 +837,7 @@ gkfs_truncate(const std::string& path, off_t length) { return -1; } else if(!md.value().target_path().empty()) { std::string new_path; while(!md.value().target_path().empty()) { while(!md.value().target_path().empty() and md.value().blocks() != -1) { new_path = md.value().target_path(); md = gkfs::utils::get_metadata(md.value().target_path()); } Loading
src/client/hooks.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ hook_fstat(unsigned int fd, struct stat* buf) { // We can change file_map and recall auto md = gkfs::utils::get_metadata(path, false); if(md.has_value() && md.value().blocks() == -1) { path = md.value().rename_path(); path = md.value().target_path(); } #endif return with_errno(gkfs::syscall::gkfs_stat(path, buf)); Loading
src/daemon/handler/srv_metadata.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -855,7 +855,7 @@ rpc_srv_get_dirents_extended(hg_handle_t handle) { * * All exceptions must be caught here and dealt with accordingly. Any errors are * placed in the response. * @endinteral * @endinternal * @param handle Mercury RPC handle (path is the symbolic link) * @return Mercury error code to Mercury */ Loading Loading @@ -935,11 +935,11 @@ rpc_srv_rename(hg_handle_t handle) { try { gkfs::metadata::Metadata md = gkfs::metadata::get(in.path); if(md.blocks() == -1) { // if(md.blocks() == -1) { // We need to fill the rename path as this is an inverse path // old -> new md.target_path(in.target_path); } //} GKFS_DATA->spdlogger()->debug( "{}() Updating path '{}' with metadata '{}'", __func__, in.path, md.serialize()); Loading