Commit 105458a0 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch '14-adafs_write-add-append-size-update-chunking'

parents f7a64d16 d11056e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ set(SOURCE_FILES main.cpp main.hpp configure.hpp util.cpp
        src/rpc/handler/h_metadentry.cpp
        src/adafs_ops/data.cpp include/adafs_ops/data.hpp src/rpc/handler/h_data.cpp
        src/rpc/handler/h_preload.cpp
        )
        include/rpc/rpc_utils.hpp src/rpc/rpc_utils.cpp)
add_executable(adafs_daemon ${SOURCE_FILES})
target_link_libraries(adafs_daemon ${ROCKSDB_LIBRARIES}
        # rocksdb libs
+11 −0
Original line number Diff line number Diff line
@@ -20,6 +20,17 @@
#define ACMtime //unused
#define BLOCKSIZE 4 // in kilobytes

// What metadata is used TODO this has to be parametrized or put into a configuration file
#define MDATA_USE_ATIME false
#define MDATA_USE_MTIME false
#define MDATA_USE_CTIME false
#define MDATA_USE_UID false
#define MDATA_USE_GID false
#define MDATA_USE_INODE_NO false
#define MDATA_USE_LINK_CNT false
#define MDATA_USE_BLOCKS false
#define MDATA_USE_SIZE true // XXX to be added in ADAFS_DATA. currently on by default

// If access permissions should be checked while opening a file
//#define CHECK_ACCESS //unused

+6 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#ifndef IFS_METADENTRY_HPP
#define IFS_METADENTRY_HPP

#include <classes/metadata.hpp>
#include "../../main.hpp"

int create_node(const std::string& path, const uid_t uid, const gid_t gid, mode_t mode);
@@ -13,10 +14,14 @@ int create_metadentry(const std::string& path, mode_t mode);

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

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

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

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

int update_metadentry_size(const std::string& path, off_t size);

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

#endif //IFS_METADENTRY_HPP
+9 −3
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@

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


class Metadata {

private:
@@ -19,18 +18,21 @@ private:
    off_t size_;               // size_ in bytes, might be computed instead of stored
    blkcnt_t blocks_;          // allocated file system blocks_

    std::string path_;

public:
    Metadata();

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

    Metadata(mode_t mode, uid_t uid, gid_t gid, uint64_t inode);
    Metadata(const std::string& path, std::string db_val);

    void init_ACM_time();

    void update_ACM_time(bool a, bool c, bool m);

    std::string to_KVentry();

    //Getter and Setter
    time_t atime() const;

@@ -72,6 +74,10 @@ public:

    void blocks(blkcnt_t blocks_);

    const std::string& path() const;

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

};


+2 −0
Original line number Diff line number Diff line
@@ -17,4 +17,6 @@ bool db_metadentry_exists(const std::string& key);

bool db_is_dir_entry(const std::string& dir_path);

bool db_update_metadentry(const std::string& old_key, const std::string& new_key, const std::string& val);

#endif //IFS_DB_OPS_HPP
Loading