Loading ifs/include/classes/fs_data.hpp +9 −4 Original line number Diff line number Diff line Loading @@ -64,7 +64,16 @@ public: void operator=(FsData const&) = delete; // Utility member functions // fuse_ino_t raise_inode_count(fuse_ino_t count); bool is_local_op(size_t recipient); size_t hash_path(const std::string& path); // getter/setter const std::unordered_map<std::string, std::string>& hashmap() const; void hashmap(const std::unordered_map<std::string, std::string>& hashmap_); Loading Loading @@ -149,11 +158,7 @@ public: void rpc_port(std::string rpc_port); // Utility member functions // fuse_ino_t raise_inode_count(fuse_ino_t count); bool is_local_op(size_t recipient); }; Loading ifs/include/classes/rpc_data.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public: bool get_addr_by_hostid(const uint64_t hostid, hg_addr_t& svr_addr); size_t get_rpc_node(std::string to_hash); size_t get_rpc_node(const std::string& to_hash); // std::string get_dentry_hashable(const fuse_ino_t parent, const char* name); Loading ifs/include/rpc/rpc_defs.hpp 0 → 100644 +32 −0 Original line number Diff line number Diff line // // Created by evie on 6/22/17. // #ifndef LFS_RPC_DEFS_HPP #define LFS_RPC_DEFS_HPP #include "../main.hpp" /* visible API for RPC operations */ DECLARE_MARGO_RPC_HANDLER(rpc_minimal) /** OLD BELOW // mdata ops DECLARE_MARGO_RPC_HANDLER(rpc_srv_create_mdata) DECLARE_MARGO_RPC_HANDLER(rpc_srv_attr) DECLARE_MARGO_RPC_HANDLER(rpc_srv_remove_mdata) // dentry ops DECLARE_MARGO_RPC_HANDLER(rpc_srv_lookup) DECLARE_MARGO_RPC_HANDLER(rpc_srv_create_dentry) DECLARE_MARGO_RPC_HANDLER(rpc_srv_remove_dentry) // data DECLARE_MARGO_RPC_HANDLER(rpc_srv_read_data) DECLARE_MARGO_RPC_HANDLER(rpc_srv_write_data) */ #endif //LFS_RPC_DEFS_HPP ifs/include/rpc/rpc_types.hpp 0 → 100644 +83 −0 Original line number Diff line number Diff line // // Created by evie on 6/22/17. // #ifndef LFS_RPC_TYPES_HPP #define LFS_RPC_TYPES_HPP #include "../main.hpp" /* visible API for RPC data types used in RPCS */ MERCURY_GEN_PROC(rpc_minimal_in_t, ((int32_t) (input))) MERCURY_GEN_PROC(rpc_minimal_out_t, ((int32_t) (output))) // misc generic rpc types MERCURY_GEN_PROC(rpc_res_out_t, ((hg_bool_t) (res))) /** OLD BELOW // create dentry MERCURY_GEN_PROC(rpc_create_dentry_in_t, ((uint64_t) (parent_inode))\ ((hg_const_string_t) (filename))\ ((uint32_t) (mode))) MERCURY_GEN_PROC(rpc_create_dentry_out_t, ((uint64_t) (inode))) // create mdata MERCURY_GEN_PROC(rpc_create_mdata_in_t, ((uint64_t) (inode))\ ((uint32_t) (gid))\ ((uint32_t) (uid))\ ((uint32_t) (mode))) MERCURY_GEN_PROC(rpc_create_mdata_out_t, ((hg_bool_t) (success))) // get_attr MERCURY_GEN_PROC(rpc_get_attr_in_t, ((uint64_t) (inode))) MERCURY_GEN_PROC(rpc_get_attr_out_t, ((uint64_t) (nlink))\ ((uint32_t) (mode))\ ((uint32_t) (uid))\ ((uint32_t) (gid))\ ((int64_t) (size))\ ((int64_t) (blocks))\ ((int64_t) (atime))\ ((int64_t) (mtime))\ ((int64_t) (ctime))) // lookup MERCURY_GEN_PROC(rpc_lookup_in_t, ((uint64_t) (parent_inode))\ ((hg_const_string_t) (filename))) MERCURY_GEN_PROC(rpc_lookup_out_t, ((uint64_t) (inode))) // remove dentry MERCURY_GEN_PROC(rpc_remove_dentry_in_t, ((uint64_t) (parent_inode))\ ((hg_const_string_t) (filename))) MERCURY_GEN_PROC(rpc_remove_dentry_out_t, ((uint64_t) (del_inode))) // remove mdata MERCURY_GEN_PROC(rpc_remove_mdata_in_t, ((uint64_t) (del_inode))) MERCURY_GEN_PROC(rpc_remove_mdata_out_t, ((hg_bool_t) (success))) // data MERCURY_GEN_PROC(rpc_read_data_in_t, ((uint64_t) (inode))\ ((hg_size_t) (size))\ ((int64_t) (offset))\ ((hg_bulk_t) (bulk_handle))) MERCURY_GEN_PROC(rpc_data_out_t, ((int32_t) (res))\ ((hg_size_t) (io_size))) MERCURY_GEN_PROC(rpc_write_data_in_t, ((uint64_t) (inode))\ ((hg_size_t) (size))\ ((int64_t) (offset))\ ((hg_bool_t) (append))\ ((hg_bulk_t) (bulk_handle))) */ #endif //LFS_RPC_TYPES_HPP ifs/src/classes/fs_data.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -4,6 +4,17 @@ #include "classes/fs_data.hpp" // Utility member functions //fuse_ino_t FsData::raise_inode_count(fuse_ino_t count) { // FsData::inode_count_ += count; // return FsData::inode_count_; //} bool FsData::is_local_op(const size_t recipient) { return recipient == host_id_; } // getter/setter const std::unordered_map<std::string, std::string>& FsData::hashmap() const { Loading Loading @@ -174,17 +185,6 @@ void FsData::rpc_port(std::string rpc_port) { FsData::rpc_port_ = rpc_port; } // Utility member functions //fuse_ino_t FsData::raise_inode_count(fuse_ino_t count) { // FsData::inode_count_ += count; // return FsData::inode_count_; //} bool FsData::is_local_op(const size_t recipient) { return recipient == host_id_; } Loading Loading
ifs/include/classes/fs_data.hpp +9 −4 Original line number Diff line number Diff line Loading @@ -64,7 +64,16 @@ public: void operator=(FsData const&) = delete; // Utility member functions // fuse_ino_t raise_inode_count(fuse_ino_t count); bool is_local_op(size_t recipient); size_t hash_path(const std::string& path); // getter/setter const std::unordered_map<std::string, std::string>& hashmap() const; void hashmap(const std::unordered_map<std::string, std::string>& hashmap_); Loading Loading @@ -149,11 +158,7 @@ public: void rpc_port(std::string rpc_port); // Utility member functions // fuse_ino_t raise_inode_count(fuse_ino_t count); bool is_local_op(size_t recipient); }; Loading
ifs/include/classes/rpc_data.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public: bool get_addr_by_hostid(const uint64_t hostid, hg_addr_t& svr_addr); size_t get_rpc_node(std::string to_hash); size_t get_rpc_node(const std::string& to_hash); // std::string get_dentry_hashable(const fuse_ino_t parent, const char* name); Loading
ifs/include/rpc/rpc_defs.hpp 0 → 100644 +32 −0 Original line number Diff line number Diff line // // Created by evie on 6/22/17. // #ifndef LFS_RPC_DEFS_HPP #define LFS_RPC_DEFS_HPP #include "../main.hpp" /* visible API for RPC operations */ DECLARE_MARGO_RPC_HANDLER(rpc_minimal) /** OLD BELOW // mdata ops DECLARE_MARGO_RPC_HANDLER(rpc_srv_create_mdata) DECLARE_MARGO_RPC_HANDLER(rpc_srv_attr) DECLARE_MARGO_RPC_HANDLER(rpc_srv_remove_mdata) // dentry ops DECLARE_MARGO_RPC_HANDLER(rpc_srv_lookup) DECLARE_MARGO_RPC_HANDLER(rpc_srv_create_dentry) DECLARE_MARGO_RPC_HANDLER(rpc_srv_remove_dentry) // data DECLARE_MARGO_RPC_HANDLER(rpc_srv_read_data) DECLARE_MARGO_RPC_HANDLER(rpc_srv_write_data) */ #endif //LFS_RPC_DEFS_HPP
ifs/include/rpc/rpc_types.hpp 0 → 100644 +83 −0 Original line number Diff line number Diff line // // Created by evie on 6/22/17. // #ifndef LFS_RPC_TYPES_HPP #define LFS_RPC_TYPES_HPP #include "../main.hpp" /* visible API for RPC data types used in RPCS */ MERCURY_GEN_PROC(rpc_minimal_in_t, ((int32_t) (input))) MERCURY_GEN_PROC(rpc_minimal_out_t, ((int32_t) (output))) // misc generic rpc types MERCURY_GEN_PROC(rpc_res_out_t, ((hg_bool_t) (res))) /** OLD BELOW // create dentry MERCURY_GEN_PROC(rpc_create_dentry_in_t, ((uint64_t) (parent_inode))\ ((hg_const_string_t) (filename))\ ((uint32_t) (mode))) MERCURY_GEN_PROC(rpc_create_dentry_out_t, ((uint64_t) (inode))) // create mdata MERCURY_GEN_PROC(rpc_create_mdata_in_t, ((uint64_t) (inode))\ ((uint32_t) (gid))\ ((uint32_t) (uid))\ ((uint32_t) (mode))) MERCURY_GEN_PROC(rpc_create_mdata_out_t, ((hg_bool_t) (success))) // get_attr MERCURY_GEN_PROC(rpc_get_attr_in_t, ((uint64_t) (inode))) MERCURY_GEN_PROC(rpc_get_attr_out_t, ((uint64_t) (nlink))\ ((uint32_t) (mode))\ ((uint32_t) (uid))\ ((uint32_t) (gid))\ ((int64_t) (size))\ ((int64_t) (blocks))\ ((int64_t) (atime))\ ((int64_t) (mtime))\ ((int64_t) (ctime))) // lookup MERCURY_GEN_PROC(rpc_lookup_in_t, ((uint64_t) (parent_inode))\ ((hg_const_string_t) (filename))) MERCURY_GEN_PROC(rpc_lookup_out_t, ((uint64_t) (inode))) // remove dentry MERCURY_GEN_PROC(rpc_remove_dentry_in_t, ((uint64_t) (parent_inode))\ ((hg_const_string_t) (filename))) MERCURY_GEN_PROC(rpc_remove_dentry_out_t, ((uint64_t) (del_inode))) // remove mdata MERCURY_GEN_PROC(rpc_remove_mdata_in_t, ((uint64_t) (del_inode))) MERCURY_GEN_PROC(rpc_remove_mdata_out_t, ((hg_bool_t) (success))) // data MERCURY_GEN_PROC(rpc_read_data_in_t, ((uint64_t) (inode))\ ((hg_size_t) (size))\ ((int64_t) (offset))\ ((hg_bulk_t) (bulk_handle))) MERCURY_GEN_PROC(rpc_data_out_t, ((int32_t) (res))\ ((hg_size_t) (io_size))) MERCURY_GEN_PROC(rpc_write_data_in_t, ((uint64_t) (inode))\ ((hg_size_t) (size))\ ((int64_t) (offset))\ ((hg_bool_t) (append))\ ((hg_bulk_t) (bulk_handle))) */ #endif //LFS_RPC_TYPES_HPP
ifs/src/classes/fs_data.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -4,6 +4,17 @@ #include "classes/fs_data.hpp" // Utility member functions //fuse_ino_t FsData::raise_inode_count(fuse_ino_t count) { // FsData::inode_count_ += count; // return FsData::inode_count_; //} bool FsData::is_local_op(const size_t recipient) { return recipient == host_id_; } // getter/setter const std::unordered_map<std::string, std::string>& FsData::hashmap() const { Loading Loading @@ -174,17 +185,6 @@ void FsData::rpc_port(std::string rpc_port) { FsData::rpc_port_ = rpc_port; } // Utility member functions //fuse_ino_t FsData::raise_inode_count(fuse_ino_t count) { // FsData::inode_count_ += count; // return FsData::inode_count_; //} bool FsData::is_local_op(const size_t recipient) { return recipient == host_id_; } Loading