Unverified Commit ed28e182 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

replace Metadata::to_KVstore with Metada::serialize

parent 96a0a8d7
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@ public:

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

    std::string to_KVentry() const;

    std::string serialize() const;

    //Getter and Setter
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ int create_metadentry(const std::string& path, mode_t mode) {
    if (ADAFS_DATA->inode_no_state())
        md.inode_no(generate_inode_no());

    return db_put_metadentry(path, md.to_KVentry()) ? 0 : -1;
    return db_put_metadentry(path, md.serialize()) ? 0 : -1;
}

int get_metadentry(const std::string& path, std::string& val) {
@@ -132,7 +132,7 @@ int update_metadentry_size(const string& path, size_t io_size, off64_t offset, b
}

int update_metadentry(const string& path, Metadata& md) {
    return db_update_metadentry(path, md.path(), md.to_KVentry()) ? 0 : -1;
    return db_update_metadentry(path, md.path(), md.serialize()) ? 0 : -1;
}

/**
+1 −6
Original line number Diff line number Diff line
@@ -123,13 +123,8 @@ void Metadata::update_ACM_time(bool a, bool c, bool m) {
}

/**
 * Creates a key value metadentry string that is used as a value in the KV store
 * @return
 * Returns the string rapresentation of metadata
 */
std::string Metadata::to_KVentry() const {
    return serialize();
}

std::string Metadata::serialize() const {
    std::string s;
    // The order is important. don't change.