Commit c1ad04b8 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Merge branch 'glibc_symlink' into 'master'

Glibc symlink

See merge request !8
parents 98468c06 0e88be9d
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -64,6 +64,12 @@ set_property(CACHE RPC_PROTOCOL PROPERTY STRINGS
message(STATUS "RPC protocol: '${RPC_PROTOCOL}'")
add_definitions(-DRPC_PROTOCOL="${RPC_PROTOCOL}")

option(SYMLINK_SUPPORT "Compile with support for symlinks" ON)
if(SYMLINK_SUPPORT)
    add_definitions(-DHAS_SYMLINKS)
endif()
message(STATUS "Symlink support: ${SYMLINK_SUPPORT}")

# Imported target
add_library(RocksDB INTERFACE IMPORTED GLOBAL)
target_link_libraries(RocksDB
+8 −5
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
#include <client/open_file_map.hpp>
#include <global/metadata.hpp>

std::shared_ptr<Metadata> adafs_metadata(const std::string& path);
std::shared_ptr<Metadata> adafs_metadata(const std::string& path, bool follow_links = false);

int adafs_open(const std::string& path, mode_t mode, int flags);

@@ -12,11 +12,9 @@ int adafs_mk_node(const std::string& path, mode_t mode);

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

int adafs_access(const std::string& path, int mask);
int adafs_access(const std::string& path, int mask, bool follow_links = true);

int adafs_stat(const std::string& path, struct stat* buf);

int adafs_stat64(const std::string& path, struct stat64* buf);
int adafs_stat(const std::string& path, struct stat* buf, bool follow_links = true);

int adafs_statvfs(struct statvfs* buf);

@@ -34,6 +32,11 @@ int adafs_dup(int oldfd);

int adafs_dup2(int oldfd, int newfd);

#ifdef HAS_SYMLINKS
int adafs_mk_symlink(const std::string& path, const std::string& target_path);
int adafs_readlink(const std::string& path, char *buf, int bufsize);
#endif


ssize_t adafs_pwrite(std::shared_ptr<OpenFile> file,
                     const char * buf, size_t count, off64_t offset);
+9 −0
Original line number Diff line number Diff line
@@ -47,6 +47,15 @@ strong_alias(intcp_openat, __openat_2)
int intcp_openat64(int dirfd, const char *path, int flags, ...);
strong_alias(intcp_openat64, openat64)
strong_alias(intcp_openat64, __openat64_2)
int intcp_symlink(const char* oldname, const char* newname) noexcept;
strong_alias(intcp_symlink, symlink)
strong_alias(intcp_symlink, __symlink)
int intcp_symlinkat(const char* oldname, int newfd, const char* newname) noexcept;
strong_alias(intcp_symlinkat, symlinkat)
ssize_t intcp_readlink(const char * cpath, char * buf, size_t bufsize) noexcept;
strong_alias(intcp_readlink, readlink)
ssize_t intcp_readlinkat(int dirfd, const char * cpath, char * buf, size_t bufsize) noexcept;
strong_alias(intcp_readlinkat, readlinkat)

int intcp_statvfs(const char *path, struct statvfs *buf) noexcept;
strong_alias(intcp_statvfs, statvfs)
+2 −1
Original line number Diff line number Diff line
@@ -113,9 +113,10 @@ extern void* libc_get_current_dir_name;

extern void* libc_link;
extern void* libc_linkat;
extern void* libc_symlink;
extern void* libc_symlinkat;

extern void* libc_readlinkat;

extern void* libc_realpath;

void init_passthrough_if_needed();
+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@ extern hg_id_t rpc_trunc_data_id;
extern hg_id_t rpc_get_dirents_id;
extern hg_id_t rpc_chunk_stat_id;

#ifdef HAS_SYMLINKS
extern hg_id_t ipc_mk_symlink_id;
extern hg_id_t rpc_mk_symlink_id;
#endif

// function definitions

int metadata_to_stat(const std::string& path, const Metadata& md, struct stat& attr);
Loading