Loading include/client/rpc/rpc_types.hpp +122 −0 Viewed Changes for include/client/rpc/rpc_types.hpp: 122 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1343,6 +1343,128 @@ struct mk_symlink { #endif // HAS_SYMLINKS #ifdef HAS_RENAME //============================================================================== // definitions for rename struct rename { // forward declarations of public input/output types for this RPC class input; class output; // traits used so that the engine knows what to do with the RPC using self_type = rename; using handle_type = hermes::rpc_handle<self_type>; using input_type = input; using output_type = output; using mercury_input_type = rpc_rename_in_t; using mercury_output_type = rpc_err_out_t; // RPC public identifier // (N.B: we reuse the same IDs assigned by Margo so that the daemon // understands Hermes RPCs) constexpr static const uint64_t public_id = 40; // RPC internal Mercury identifier constexpr static const hg_id_t mercury_id = 0; // RPC name constexpr static const auto name = gkfs::rpc::tag::rename; // requires response? constexpr static const auto requires_response = true; // Mercury callback to serialize input arguments constexpr static const auto mercury_in_proc_cb = HG_GEN_PROC_NAME(rpc_rename_in_t); // Mercury callback to serialize output arguments constexpr static const auto mercury_out_proc_cb = HG_GEN_PROC_NAME(rpc_err_out_t); class input { template <typename ExecutionContext> friend hg_return_t hermes::detail::post_to_mercury(ExecutionContext*); public: input(const std::string& path, const std::string& target_path) : m_path(path), m_target_path(target_path) {} input(input&& rhs) = default; input(const input& other) = default; input& operator=(input&& rhs) = default; input& operator=(const input& other) = default; std::string path() const { return m_path; } std::string target_path() const { return m_target_path; } explicit input(const rpc_rename_in_t& other) : m_path(other.path), m_target_path(other.target_path) {} explicit operator rpc_rename_in_t() { return {m_path.c_str(), m_target_path.c_str()}; } private: std::string m_path; std::string m_target_path; }; class output { template <typename ExecutionContext> friend hg_return_t hermes::detail::post_to_mercury(ExecutionContext*); public: output() : m_err() {} output(int32_t err) : m_err(err) {} output(output&& rhs) = default; output(const output& other) = default; output& operator=(output&& rhs) = default; output& operator=(const output& other) = default; explicit output(const rpc_err_out_t& out) { m_err = out.err; } int32_t err() const { return m_err; } private: int32_t m_err; }; }; #endif // HAS_RENAME //============================================================================== // definitions for remove data struct remove_data { Loading include/client/syscalls/args.hpp +1 −0 Viewed Changes for include/client/syscalls/args.hpp: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <sched.h> #include <syscall.h> #include <unistd.h> #include <optional> Loading include/client/gkfs_functions.hpp +2 −1 Viewed Changes for include/client/gkfs_functions.hpp: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ gkfs_access(const std::string& path, int mask, bool follow_links = true); // Implementation of stat, // Follow links is true by default int gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true); gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true, bool bypass_rename = false); // Implementation of statx, it uses the normal stat and maps the information to // the statx structure Follow links is true by default Loading include/client/path.hpp +2 −0 Viewed Changes for include/client/path.hpp: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -54,10 +54,12 @@ resolve(const std::string& path, bool resolve_last_link = true); std::pair<bool, std::string> resolve_new(const std::string& path, bool resolve_last_link = true); #ifdef GKFS_USE_LEGACY_PATH_RESOLVE [[deprecated( "Use GKFS_USE_LEGACY_PATH_RESOLVE to use old implementation")]] bool resolve(const std::string& path, std::string& resolved, bool resolve_last_link = true); #endif std::string get_sys_cwd(); Loading include/client/user_functions.hpp +15 −1 Viewed Changes for include/client/user_functions.hpp: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -84,7 +84,8 @@ ssize_t gkfs_pread(int fd, void* buf, size_t count, off64_t offset); int gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true); gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true, bool bypass_rename = false); int gkfs_statx(int dirfs, const std::string& path, int flags, unsigned int mask, Loading Loading @@ -118,6 +119,19 @@ gkfs_getdents64(unsigned int fd, struct linux_dirent64* dirp, int gkfs_truncate(const std::string& path, off_t offset); #ifdef HAS_SYMLINKS int gkfs_mk_symlink(const std::string& path, const std::string& target); int gkfs_readlink(const std::string& path, char* buf, int bufsize); #endif #ifdef HAS_RENAME int gkfs_rename(const std::string& old_path, const std::string& new_path); #endif int gkfs_fsync(unsigned int fd); } // namespace syscall namespace malleable { Loading Loading
include/client/rpc/rpc_types.hpp +122 −0 Viewed Changes for include/client/rpc/rpc_types.hpp: 122 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -1343,6 +1343,128 @@ struct mk_symlink { #endif // HAS_SYMLINKS #ifdef HAS_RENAME //============================================================================== // definitions for rename struct rename { // forward declarations of public input/output types for this RPC class input; class output; // traits used so that the engine knows what to do with the RPC using self_type = rename; using handle_type = hermes::rpc_handle<self_type>; using input_type = input; using output_type = output; using mercury_input_type = rpc_rename_in_t; using mercury_output_type = rpc_err_out_t; // RPC public identifier // (N.B: we reuse the same IDs assigned by Margo so that the daemon // understands Hermes RPCs) constexpr static const uint64_t public_id = 40; // RPC internal Mercury identifier constexpr static const hg_id_t mercury_id = 0; // RPC name constexpr static const auto name = gkfs::rpc::tag::rename; // requires response? constexpr static const auto requires_response = true; // Mercury callback to serialize input arguments constexpr static const auto mercury_in_proc_cb = HG_GEN_PROC_NAME(rpc_rename_in_t); // Mercury callback to serialize output arguments constexpr static const auto mercury_out_proc_cb = HG_GEN_PROC_NAME(rpc_err_out_t); class input { template <typename ExecutionContext> friend hg_return_t hermes::detail::post_to_mercury(ExecutionContext*); public: input(const std::string& path, const std::string& target_path) : m_path(path), m_target_path(target_path) {} input(input&& rhs) = default; input(const input& other) = default; input& operator=(input&& rhs) = default; input& operator=(const input& other) = default; std::string path() const { return m_path; } std::string target_path() const { return m_target_path; } explicit input(const rpc_rename_in_t& other) : m_path(other.path), m_target_path(other.target_path) {} explicit operator rpc_rename_in_t() { return {m_path.c_str(), m_target_path.c_str()}; } private: std::string m_path; std::string m_target_path; }; class output { template <typename ExecutionContext> friend hg_return_t hermes::detail::post_to_mercury(ExecutionContext*); public: output() : m_err() {} output(int32_t err) : m_err(err) {} output(output&& rhs) = default; output(const output& other) = default; output& operator=(output&& rhs) = default; output& operator=(const output& other) = default; explicit output(const rpc_err_out_t& out) { m_err = out.err; } int32_t err() const { return m_err; } private: int32_t m_err; }; }; #endif // HAS_RENAME //============================================================================== // definitions for remove data struct remove_data { Loading
include/client/syscalls/args.hpp +1 −0 Viewed Changes for include/client/syscalls/args.hpp: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <sched.h> #include <syscall.h> #include <unistd.h> #include <optional> Loading
include/client/gkfs_functions.hpp +2 −1 Viewed Changes for include/client/gkfs_functions.hpp: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -67,7 +67,8 @@ gkfs_access(const std::string& path, int mask, bool follow_links = true); // Implementation of stat, // Follow links is true by default int gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true); gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true, bool bypass_rename = false); // Implementation of statx, it uses the normal stat and maps the information to // the statx structure Follow links is true by default Loading
include/client/path.hpp +2 −0 Viewed Changes for include/client/path.hpp: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -54,10 +54,12 @@ resolve(const std::string& path, bool resolve_last_link = true); std::pair<bool, std::string> resolve_new(const std::string& path, bool resolve_last_link = true); #ifdef GKFS_USE_LEGACY_PATH_RESOLVE [[deprecated( "Use GKFS_USE_LEGACY_PATH_RESOLVE to use old implementation")]] bool resolve(const std::string& path, std::string& resolved, bool resolve_last_link = true); #endif std::string get_sys_cwd(); Loading
include/client/user_functions.hpp +15 −1 Viewed Changes for include/client/user_functions.hpp: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -84,7 +84,8 @@ ssize_t gkfs_pread(int fd, void* buf, size_t count, off64_t offset); int gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true); gkfs_stat(const std::string& path, struct stat* buf, bool follow_links = true, bool bypass_rename = false); int gkfs_statx(int dirfs, const std::string& path, int flags, unsigned int mask, Loading Loading @@ -118,6 +119,19 @@ gkfs_getdents64(unsigned int fd, struct linux_dirent64* dirp, int gkfs_truncate(const std::string& path, off_t offset); #ifdef HAS_SYMLINKS int gkfs_mk_symlink(const std::string& path, const std::string& target); int gkfs_readlink(const std::string& path, char* buf, int bufsize); #endif #ifdef HAS_RENAME int gkfs_rename(const std::string& old_path, const std::string& new_path); #endif int gkfs_fsync(unsigned int fd); } // namespace syscall namespace malleable { Loading