Verified Commit 241f2821 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Implement rename family

Implement rename, renameat, renameat2

Added new rcp "insert_node" to insert new metadentry into the metadata DB.
This call differs from the "mk_node" because it will insert the metadata
received from the caller instead of generating them assuming that they
have been generated previously.

It can be used to move entries between metadata nodes
parent ccb3715a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ int create_node(const std::string& path, const uid_t uid, const gid_t gid, mode_

void create_metadentry(const std::string& path, Metadata& md);

void insert_metadentry_str(const std::string& path, const std::string& serialized_metadata);

std::string get_metadentry_str(const std::string& path);

Metadata get_metadentry(const std::string& path);
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ DECLARE_MARGO_RPC_HANDLER(ipc_srv_fs_config)

DECLARE_MARGO_RPC_HANDLER(rpc_srv_mk_node)

DECLARE_MARGO_RPC_HANDLER(rpc_srv_insert_node)

DECLARE_MARGO_RPC_HANDLER(rpc_srv_access)

DECLARE_MARGO_RPC_HANDLER(rpc_srv_stat)
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ namespace hg_tag {
    constexpr auto fs_config = "ipc_srv_fs_config";
    constexpr auto minimal = "rpc_minimal";
    constexpr auto create = "rpc_srv_mk_node";
    constexpr auto insert = "rpc_srv_insert_node";
    constexpr auto access = "rpc_srv_access";
    constexpr auto stat = "rpc_srv_stat";
    constexpr auto remove = "rpc_srv_rm_node";
@@ -26,6 +27,7 @@ namespace hg_tag {
// typedefs
typedef unsigned long rpc_chnk_id_t;
typedef uint_fast64_t fuid_t;
constexpr fuid_t FUID_NULL = 0;

template<typename E>
constexpr typename std::underlying_type<E>::type to_underlying(E e) {
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@ MERCURY_GEN_PROC(rpc_minimal_out_t, ((int32_t) (output)))
MERCURY_GEN_PROC(rpc_err_out_t, ((hg_int32_t) (err)))


MERCURY_GEN_PROC(rpc_insert_node_in_t,
        ((hg_const_string_t) (path))
        ((hg_const_string_t) (serialized_metadata))
)

MERCURY_GEN_PROC(rpc_fuid_out_t,
        ((uint64_t) (fuid)) \
        ((int32_t) (err))  \
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ int adafs_open(const std::string& path, mode_t mode, int flags);
int adafs_mk_node(const std::string& path, mode_t mode, fuid_t& fuid);
int adafs_mk_node(const std::string& path, mode_t mode);

int adafs_rename(const std::string& oldpath, const std::string& newpath);

int adafs_rm_node(const std::string& path);

int adafs_access(const std::string& path, int mask);
Loading