Commit ba4577e3 authored by Marc Vef's avatar Marc Vef
Browse files

ifs: read and write (with rpc) done

parent 808adfa5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ set(SOURCE_FILES main.cpp main.hpp configure.hpp util.cpp
        include/rpc/rpc_defs.hpp include/rpc/rpc_types.hpp


        src/daemon/fs_operations.cpp src/daemon/fs_operations.cpp include/daemon/fs_operations.hpp src/adafs_ops/metadentry.cpp include/adafs_ops/metadentry.hpp src/db/db_ops.cpp src/db/db_ops.cpp include/db/db_ops.hpp src/rpc/handler/h_metadentry.cpp src/rpc/sender/c_metadentry.cpp include/rpc/sender/c_metadentry.hpp)
        src/daemon/fs_operations.cpp src/daemon/fs_operations.cpp include/daemon/fs_operations.hpp src/adafs_ops/metadentry.cpp include/adafs_ops/metadentry.hpp src/db/db_ops.cpp src/db/db_ops.cpp include/db/db_ops.hpp src/rpc/handler/h_metadentry.cpp src/rpc/sender/c_metadentry.cpp include/rpc/sender/c_metadentry.hpp src/adafs_ops/data.cpp include/adafs_ops/data.hpp src/rpc/handler/h_data.cpp src/rpc/sender/c_data.cpp include/rpc/sender/c_data.hpp)
add_executable(adafs_daemon ${SOURCE_FILES})
target_link_libraries(adafs_daemon ${ROCKSDB_LIBRARIES}
        # rocksdb libs
+21 −0
Original line number Diff line number Diff line
//
// Created by evie on 9/8/17.
//

#ifndef IFS_DATA_HPP
#define IFS_DATA_HPP

#include "../../main.hpp"

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

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

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

int read_file(char* buf, size_t& read_size, const std::string& path, const size_t size, const off_t off);

int write_file(const std::string& path, const char* buf, size_t& write_size, const size_t size, const off_t off,
               const bool append);

#endif //IFS_DATA_HPP
+10 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ private:
    hg_id_t rpc_minimal_id_;
    hg_id_t rpc_srv_create_node_id_;
    hg_id_t rpc_srv_attr_id_;
    hg_id_t rpc_srv_read_data_id_;
    hg_id_t rpc_srv_write_data_id_;


public:
@@ -96,6 +98,14 @@ public:

    void rpc_srv_attr_id(hg_id_t rpc_srv_attr_id);

    hg_id_t rpc_srv_read_data_id() const;

    void rpc_srv_read_data_id(hg_id_t rpc_srv_read_data_id);

    hg_id_t rpc_srv_write_data_id() const;

    void rpc_srv_write_data_id(hg_id_t rpc_srv_write_data_id);

};


+2 −6
Original line number Diff line number Diff line
@@ -15,13 +15,9 @@ int adafs_close(char* path);

int adafs_stat(char* path, struct stat* buf);

int adafs_fstat(char* path, struct stat* buf);
ssize_t adafs_write(char* path, char* buf, size_t size, off_t offset);

ssize_t adafs_write(char* path, void* buf, size_t count);

ssize_t adafs_read(char* path, void* buf, size_t count);

ssize_t adafs_pread(char* path, void* buf, size_t count, off_t offset);
ssize_t adafs_read(char* path, char* buf, size_t size, off_t offset);


#endif //IFS_FS_OPERATIONS_HPP
+2 −2
Original line number Diff line number Diff line
@@ -10,8 +10,8 @@
#include <stdint.h>
#include <fcntl.h>

#include <open_file_map.hpp>
#include <preload_util.hpp>
#include <preload/open_file_map.hpp>
#include <preload/preload_util.hpp>

//
void* libc;
Loading