Loading ifs/include/daemon/classes/metadata.hpp +1 −3 Original line number Diff line number Diff line Loading @@ -31,9 +31,7 @@ public: void update_ACM_time(bool a, bool c, bool m); std::string to_KVentry() const; void serialize(std::string& s) const; std::string serialize() const; //Getter and Setter time_t atime() const; Loading ifs/src/daemon/adafs_ops/metadentry.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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; } /** Loading ifs/src/daemon/classes/metadata.cpp +4 −9 Original line number Diff line number Diff line Loading @@ -123,16 +123,10 @@ 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 { std::string val; this->serialize(val); return val; } void Metadata::serialize(std::string& s) const { std::string Metadata::serialize() const { std::string s; // The order is important. don't change. s += fmt::FormatInt(mode_).c_str(); // add mandatory mode s += dentry_val_delim + fmt::FormatInt(size_).c_str(); // add mandatory size Loading Loading @@ -160,6 +154,7 @@ void Metadata::serialize(std::string& s) const { if (ADAFS_DATA->blocks_state()) { s += dentry_val_delim + fmt::FormatInt(blocks_).c_str(); } return s; } //-------------------------------------------- GETTER/SETTER Loading ifs/src/daemon/db/merge.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ bool MetadataMergeOperator::FullMergeV2( } md.size(fsize); md.serialize(merge_out->new_value); merge_out->new_value = md.serialize(); return true; } Loading Loading
ifs/include/daemon/classes/metadata.hpp +1 −3 Original line number Diff line number Diff line Loading @@ -31,9 +31,7 @@ public: void update_ACM_time(bool a, bool c, bool m); std::string to_KVentry() const; void serialize(std::string& s) const; std::string serialize() const; //Getter and Setter time_t atime() const; Loading
ifs/src/daemon/adafs_ops/metadentry.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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; } /** Loading
ifs/src/daemon/classes/metadata.cpp +4 −9 Original line number Diff line number Diff line Loading @@ -123,16 +123,10 @@ 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 { std::string val; this->serialize(val); return val; } void Metadata::serialize(std::string& s) const { std::string Metadata::serialize() const { std::string s; // The order is important. don't change. s += fmt::FormatInt(mode_).c_str(); // add mandatory mode s += dentry_val_delim + fmt::FormatInt(size_).c_str(); // add mandatory size Loading Loading @@ -160,6 +154,7 @@ void Metadata::serialize(std::string& s) const { if (ADAFS_DATA->blocks_state()) { s += dentry_val_delim + fmt::FormatInt(blocks_).c_str(); } return s; } //-------------------------------------------- GETTER/SETTER Loading
ifs/src/daemon/db/merge.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ bool MetadataMergeOperator::FullMergeV2( } md.size(fsize); md.serialize(merge_out->new_value); merge_out->new_value = md.serialize(); return true; } Loading