Verified Commit 576bf41d authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Merge branch 'sys_intercept_symlink' into compss

parents 9cd2f6f2 e1bee194
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -129,6 +129,10 @@ if (NOT USE_OFI_VERBS AND NOT USE_OFI_PSM2 AND NOT USE_CCI AND NOT USE_BMI AND N
    add_definitions(-DRPC_PROTOCOL="bmi+tcp")
endif()

option(SYMLINK_SUPPORT "Compile with support for symlinks" ON)
if(SYMLINK_SUPPORT)
    add_compile_definitions(HAS_SYMLINKS)
endif()

# Imported target
add_library(RocksDB INTERFACE IMPORTED GLOBAL)
+5 −0
Original line number Diff line number Diff line
@@ -32,6 +32,11 @@ DECLARE_MARGO_RPC_HANDLER(rpc_srv_update_metadentry_size)

DECLARE_MARGO_RPC_HANDLER(rpc_srv_get_dirents)

#ifdef HAS_SYMLINKS
DECLARE_MARGO_RPC_HANDLER(rpc_srv_mk_symlink)
#endif


// data
DECLARE_MARGO_RPC_HANDLER(rpc_srv_read_data)

+3 −0
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@ namespace hg_tag {
    constexpr auto get_metadentry_size = "rpc_srv_get_metadentry_size";
    constexpr auto update_metadentry_size = "rpc_srv_update_metadentry_size";
    constexpr auto get_dirents = "rpc_srv_get_dirents";
#ifdef HAS_SYMLINKS
    constexpr auto mk_symlink = "rpc_srv_mk_symlink";
#endif
    constexpr auto write_data = "rpc_srv_write_data";
    constexpr auto read_data = "rpc_srv_read_data";
    constexpr auto trunc_data = "rpc_srv_trunc_data";
+15 −1
Original line number Diff line number Diff line
@@ -5,10 +5,12 @@

#include "global/configure.hpp"
#include <sys/types.h>
#include <sys/stat.h>
#include <string>


typedef uint64_t fuid_t; // File Unique ID
constexpr mode_t LINK_MODE = ((S_IRWXU | S_IRWXG | S_IRWXO) | S_IFLNK);


class Metadata {
@@ -23,10 +25,17 @@ private:
    nlink_t link_count_;   // number of names for this inode (hardlinks)
    size_t size_;          // size_ in bytes, might be computed instead of stored
    blkcnt_t blocks_;      // allocated file system blocks_
#ifdef HAS_SYMLINKS
    std::string target_path_;  // For links this is the path of the target file
#endif


public:
    Metadata();
    Metadata(mode_t mode);
    explicit Metadata(mode_t mode);
#ifdef HAS_SYMLINKS
    Metadata(mode_t mode, const std::string& target_path);
#endif
    // Construct from a binary representation of the object
    Metadata(const std::string& binary_str);

@@ -56,6 +65,11 @@ public:
    void size(size_t size_);
    blkcnt_t blocks() const;
    void blocks(blkcnt_t blocks_);
#ifdef HAS_SYMLINKS
    std::string target_path() const;
    void target_path(const std::string& target_path);
    bool is_link() const;
#endif
};


+7 −0
Original line number Diff line number Diff line
@@ -83,6 +83,13 @@ MERCURY_GEN_PROC(rpc_update_metadentry_size_out_t, ((hg_int32_t) (err))
MERCURY_GEN_PROC(rpc_get_metadentry_size_out_t, ((hg_int32_t) (err))
        ((hg_int64_t) (ret_size)))

#ifdef HAS_SYMLINKS
MERCURY_GEN_PROC(rpc_mk_symlink_in_t,
    ((hg_const_string_t) (path))\
    ((hg_const_string_t) (target_path))
)
#endif

// data
MERCURY_GEN_PROC(rpc_read_data_in_t,
        ((hg_uint64_t) (fuid))\
Loading