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

Merge branch '16-i-o-integrate-chunking'

parents 1c85e2dd 25e84b1e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5,18 +5,19 @@
// To enabled logging with info level
#define LOG_INFO
//#define LOG_DEBUG
//#define LOG_TRACE
#define LOG_TRACE
#define LOG_DAEMON_PATH "/tmp/adafs_daemon.log"

// Enable logging for daemon
#define LOG_PRELOAD_INFO
//#define LOG_PRELOAD_DEBUG
//#define LOG_PRELOAD_TRACE
#define LOG_PRELOAD_TRACE
#define LOG_PRELOAD_PATH "/tmp/adafs_preload.log"

// If ACM time should be considered
#define ACMtime //unused
#define BLOCKSIZE 4 // in kilobytes
#define CHUNKSIZE 400 // in bytes

// What metadata is used TODO this has to be parametrized or put into a configuration file
#define MDATA_USE_ATIME false
+10 −3
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
#define IFS_DATA_HPP

#include "../../main.hpp"
#include <preload/preload_util.hpp>

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

@@ -10,9 +11,15 @@ 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 read_file(const std::string& path, rpc_chnk_id_t chnk_id, size_t size, off_t off, char* buf, size_t& read_size);

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, const off_t updated_size);
int write_file(const std::string& path, const char* buf, rpc_chnk_id_t chnk_id, size_t size, off_t off,
               size_t& write_size);

int write_chunks(const std::string& path, const std::vector<void*>& buf_ptrs, const std::vector<hg_size_t>& buf_sizes,
                 off_t offset, size_t& write_size);

int read_chunks(const std::string& path, off_t offset, const std::vector<void*>& buf_ptrs,
                const std::vector<hg_size_t>& buf_sizes, size_t& read_size);

#endif //IFS_DATA_HPP
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ int remove_metadentry(const std::string& path);

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

long update_metadentry_size(const std::string& path, off_t size, bool append);
int update_metadentry_size(const std::string& path, size_t io_size, off_t offset, bool append, size_t& read_size);

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

+4 −4
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ private:
    mode_t mode_;
    uint64_t inode_no_;
    nlink_t link_count_;       // number of names for this inode (hardlinks)
    off_t size_;               // size_ in bytes, might be computed instead of stored
    size_t size_;               // size_ in bytes, might be computed instead of stored
    blkcnt_t blocks_;          // allocated file system blocks_

    std::string path_;
@@ -23,7 +23,7 @@ private:
public:
    Metadata();

    Metadata(const std::string& path, const mode_t mode);
    Metadata(const std::string& path, mode_t mode);

    Metadata(const std::string& path, std::string db_val);

@@ -66,9 +66,9 @@ public:

    void link_count(nlink_t link_count_);

    off_t size() const;
    size_t size() const;

    void size(off_t size_);
    void size(size_t size_);

    blkcnt_t blocks() const;

+17 −0
Original line number Diff line number Diff line
#ifndef IFS_ADAFS_FUNCTIONS_HPP
#define IFS_ADAFS_FUNCTIONS_HPP

#include <preload/preload_util.hpp>

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

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

int adafs_stat64(const std::string& path, struct stat64* buf);

ssize_t adafs_pread_ws(int fd, void* buf, size_t count, off_t offset);

ssize_t adafs_pwrite_ws(int fd, const void* buf, size_t count, off_t offset);


#endif //IFS_ADAFS_FUNCTIONS_HPP
Loading