Unverified Commit cdf4e957 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Implement rename family

Implement rename, renameat, renameat2

Added new rcp "forward_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 1cc19b6e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11,6 +11,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, bool follow_links = true);
+4 −0
Original line number Diff line number Diff line
@@ -119,6 +119,10 @@ extern void* libc_readlinkat;

extern void* libc_realpath;

extern void* libc_rename;
extern void* libc___renameat;
extern void* libc_renameat2;

void init_passthrough_if_needed();

#endif //IFS_PASSTHROUGH_HPP
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ extern margo_instance_id ld_margo_rpc_id;
// RPC IDs
extern hg_id_t rpc_config_id;
extern hg_id_t rpc_mk_node_id;
extern hg_id_t rpc_forward_node_id;
extern hg_id_t rpc_stat_id;
extern hg_id_t rpc_rm_node_id;
extern hg_id_t rpc_decr_size_id;
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ namespace rpc_send {

int mk_node(const std::string& path, mode_t mode, fuid_t& fuid);

int forward_node(const std::string& path, const Metadata& md);

int stat(const std::string& path, std::string& attr);

int rm_node(const std::string& path, const fuid_t fuid, const bool remove_metadentry_only);
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,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);
Loading